All Video Conversion Audio Conversion Video Cutting Video Merging Video Compression Subtitle Processing Watermark Adding Format Info
πŸ”

No matching commands found. Please try other keywords.

πŸ”„ Video Conversion

Video to MP4 Format (H.264 + AAC)

Convert any video format to the universal MP4 format using H.264 video codec and AAC audio codec for the best compatibility.

ffmpeg -i input.avi -c:v libx264 -c:a aac -strict experimental output.mp4

Video to MKV Format (Lossless Remux)

Directly copy audio and video streams without re-encoding. Extremely fast and preserves original quality.

ffmpeg -i input.mp4 -c copy output.mkv

Video to WebM Format (VP9 + Opus)

Convert to WebM format, suitable for web video playback with smaller file sizes.

ffmpeg -i input.mp4 -c:v libvpx-vp9 -c:a libopus output.webm

Video to GIF Animation

Convert video clips to GIF animations, with support for custom frame rates and palette optimization for better quality.

ffmpeg -i input.mp4 -vf "fps=10,scale=720:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 output.gif

MP4 to M3U8 (HLS Streaming Segments)

Convert MP4 video to HLS streaming format (M3U8 + TS segments), suitable for live streaming and video-on-demand.

ffmpeg -i input.mp4 -c:v libx264 -c:a aac -hls_time 10 -hls_list_size 0 -hls_segment_filename "output_%03d.ts" output.m3u8

🎡 Audio Conversion

Extract MP3 Audio from Video

Extract audio from video files and save as high-quality MP3 format.

ffmpeg -i input.mp4 -vn -c:a libmp3lame -q:a 2 output.mp3

Audio to WAV Lossless Format

Convert to lossless WAV format, ideal for audio editing and post-processing.

ffmpeg -i input.mp3 -c:a pcm_s16le output.wav

Audio to AAC Format

Convert to AAC format with good sound quality and small file size, suitable for mobile and web use.

ffmpeg -i input.mp3 -c:a aac -b:a 192k output.aac

Audio to FLAC Lossless Compression Format

Convert to FLAC lossless compression format, reducing file size while maintaining audio quality.

ffmpeg -i input.wav -c:a flac output.flac

Audio to Opus Format

Convert to Opus format, excellent quality at low bitrates, ideal for internet voice transmission.

ffmpeg -i input.mp3 -c:a libopus -b:a 128k output.opus

βœ‚οΈ Video Cutting

Cut Video Clip (Starting from Specified Time)

Extract a segment from a video. -ss specifies the start time, -t specifies the duration.

ffmpeg -i input.mp4 -ss 00:01:00 -t 00:00:30 -c copy output.mp4

Precise Video Cutting (Re-encoding Method)

Precise cutting using re-encoding, accurate to the frame, but slower.

ffmpeg -i input.mp4 -ss 00:01:23.456 -t 00:00:10.123 -c:v libx264 -c:a aac output.mp4

Crop Video Frame Dimensions

Crop the video frame. crop=width:height:start_x:start_y.

ffmpeg -i input.mp4 -vf "crop=720:480:100:50" -c:a copy output.mp4

Remove Video Black Bars (Auto-detect)

Automatically detect and crop video black bars.

ffmpeg -i input.mp4 -vf "cropdetect" -f null -

πŸ“¦ Video Merging

Lossless Merge Multiple Videos (Same Codec)

Use the concat protocol to merge video files with the same codec. Fast and lossless quality.

ffmpeg -f concat -i filelist.txt -c copy output.mp4

Generate Merge File List

filelist.txt file format example, listing all files to be merged in order.

file 'input1.mp4' file 'input2.mp4' file 'input3.mp4'

TS Segment File Batch Merge

Merge multiple TS segment files into a complete video.

ffmpeg -i "concat:file1.ts|file2.ts|file3.ts" -c copy output.mp4

Merge Different Codec Videos (Re-encoding)

Merge videos of different codec formats, requires re-encoding.

ffmpeg -i input1.mp4 -i input2.avi -filter_complex "[0:v][0:a][1:v][1:a]concat=n=2:v=1:a=1[v][a]" -map "[v]" -map "[a]" output.mp4

πŸ“‰ Video Compression

Compress Video Size (Specified Bitrate)

Compress video file size by specifying video bitrate, balancing quality and file size.

ffmpeg -i input.mp4 -c:v libx264 -b:v 1000k -c:a aac -b:a 128k output.mp4

Constant Quality Compression (CRF Method)

Compress using CRF (Constant Rate Factor). Value range 0-51, default 23. Higher values produce smaller files.

ffmpeg -i input.mp4 -c:v libx264 -crf 28 -c:a copy output.mp4

Compress Video Resolution

Reduce video resolution to decrease file size. -1 means auto-calculate to maintain aspect ratio.

ffmpeg -i input.mp4 -vf "scale=1280:-1" -c:a copy output.mp4

H.265/HEVC Efficient Compression

Compress using H.265 codec, approximately 50% smaller file size than H.264 at the same quality.

ffmpeg -i input.mp4 -c:v libx265 -crf 28 -c:a copy output.mp4

Compress to Specified File Size

Calculate target bitrate to compress video to a specified size (e.g., compress to 10MB).

ffmpeg -i input.mp4 -c:v libx264 -b:v 800k -c:a aac -b:a 128k -pass 2 -f mp4 /dev/null && ffmpeg -i input.mp4 -c:v libx264 -b:v 800k -c:a aac -b:a 128k -pass 2 output.mp4

πŸ“ Subtitle Processing

Embed Subtitles into Video (Hard Subtitles)

Burn subtitle files into the video frame so subtitles are visible on any player.

ffmpeg -i input.mp4 -vf "subtitles=subtitle.srt" -c:a copy output.mp4

Add Soft Subtitles to Video (Embedded Subtitles)

Package subtitle files into the video. Can be toggled on/off without affecting video quality.

ffmpeg -i input.mp4 -i subtitle.srt -c copy -c:s mov_text output.mp4

Extract Subtitles from Video

Extract subtitle files from videos containing soft subtitles.

ffmpeg -i input.mp4 -map 0:s:0 subtitle.srt

Custom Subtitle Style (Font, Size, Color)

Customize subtitle font, size, color and other style parameters.

ffmpeg -i input.mp4 -vf "subtitles=subtitle.srt:force_style='FontName=Arial,FontSize=24,PrimaryColour=&Hffffff&'" -c:a copy output.mp4

Using ASS/SSA Advanced Subtitles

Use more feature-rich ASS format subtitles, supporting animations, effects and more.

ffmpeg -i input.mp4 -vf "ass=subtitle.ass" -c:a copy output.mp4

πŸ’§ Watermark Adding

Add Image Watermark (Bottom Right)

Add an image watermark to the bottom right corner of the video. Position and size can be adjusted.

ffmpeg -i input.mp4 -i watermark.png -filter_complex "overlay=W-w-20:H-h-20" -c:a copy output.mp4

Add Text Watermark

Add a text watermark to the video. Font, size, color, and position can be set.

ffmpeg -i input.mp4 -vf "drawtext=text='CGJU Tools':fontsize=36:fontcolor=white@0.8:x=20:y=20" -c:a copy output.mp4

Add Translucent Watermark

Add a translucent image watermark that doesn't obscure the video content.

ffmpeg -i input.mp4 -i watermark.png -filter_complex "[1:v]format=rgba,colorchannelmixer=aa=0.5[wm];[0:v][wm]overlay=W-w-20:H-h-20" -c:a copy output.mp4

Watermark Position Parameters Reference

Common watermark position parameters. W/H is video width/height, w/h is watermark width/height.

# Top Left overlay=20:20 # Top Right overlay=W-w-20:20 # Bottom Left overlay=20:H-h-20 # Bottom Right overlay=W-w-20:H-h-20 # Center overlay=(W-w)/2:(H-h)/2

Scrolling/Moving Text Watermark

Add a text watermark effect that scrolls from right to left.

ffmpeg -i input.mp4 -vf "drawtext=text='CGJU':fontsize=36:fontcolor=white:x=w-mod(t*100\,w+tw):y=20" -c:a copy output.mp4

πŸ“‹ Format Information

View Video File Detailed Information

View detailed video information including codec format, resolution, bitrate, duration, and more.

ffprobe -v quiet -print_format json -show_format -show_streams input.mp4

View File Information Using ffmpeg

Use the ffmpeg command to view basic video file information.

ffmpeg -i input.mp4

Get Only Video Resolution

Quickly get the width and height of a video.

ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=p=0 input.mp4

Get Video Duration

Get the total duration of a video in seconds.

ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 input.mp4

Get Video Frame Count and Frame Rate

Get the total frame count and frame rate information of a video.

ffprobe -v error -select_streams v:0 -count_packets -show_entries stream=nb_read_packets,r_frame_rate -of csv=p=0 input.mp4

View Supported Encoders

View all encoders supported by the current ffmpeg version.

ffmpeg -encoders