ffmpeg is the Swiss Army knife of multimedia: it can decode, encode, transcode, mux, demux, stream, filter, and play nearly any audio or video format. The basic syntax is:
ffmpeg [global opts] [input opts] -i input [output opts] output
Options before -i apply to the input; options after apply to the output. Order matters.
| -vcodec / -c:v | Set video codec. Common: libx264, libx265, libvpx-vp9, copy (stream copy, no re-encode). |
| -crf <n> | Constant Rate Factor — quality-based encoding. Lower = better quality. Typical: 18–28 for H.264. |
| -b:v <rate> | Target video bitrate: e.g. 2M, 500k. Use with -maxrate/-bufsize for CBR/VBR control. |
| -r <fps> | Frame rate: 24, 30, 60, etc. |
| -s <WxH> | Output resolution: e.g. 1920x1080, 1280x720. |
| -vf | Video filter graph: scale, crop, rotate, drawtext, etc. |
| -preset | Encoding speed vs. compression: ultrafast → veryslow. Slower = smaller file. |
| -tune | Tune encoder for content type: film, animation, grain, stillimage, zerolatency. |
| -pix_fmt | Pixel format: yuv420p (most compatible), yuv444p, etc. |
| -acodec / -c:a | Audio codec: aac, mp3, libopus, flac, copy. |
| -b:a <rate> | Audio bitrate: 128k, 192k, 320k. |
| -ar <hz> | Audio sample rate: 44100, 48000. |
| -ac <n> | Audio channel count: 1 (mono), 2 (stereo), 6 (5.1). |
| -an | Remove audio stream entirely. |
| -af | Audio filter: volume=2.0, loudnorm, highpass, etc. |
| -map | Select streams explicitly: -map 0:v:0 -map 0:a:1 |
| -f <fmt> | Force container format: mp4, matroska, webm, mp3, image2, etc. |
| -ss <time> | Seek to position before input (fast) or after (slow but accurate). |
| -t <time> | Duration of output: seconds or HH:MM:SS. |
| -to <time> | Stop at this timestamp. |
| -vn | Remove video stream. |
| -sn | Remove subtitle stream. |
| -dn | Remove data stream. |
| -y | Overwrite output without asking. |
| -n | Never overwrite; exit if output exists. |
| -loglevel | Verbosity: quiet, error, warning, info (default), verbose, debug. |
| -threads <n> | Number of CPU threads. 0 = auto. |
| -hwaccel | Hardware acceleration: cuda, vaapi, videotoolbox, qsv, dxva2. |
| -stats | Print encoding progress stats (on by default). |
| -progress <url> | Send progress to URL or pipe: -progress pipe:1 |
• Use -c copy to remux without re-encoding (instant, lossless).
• Put -ss before -i for fast keyframe seek; after -i for frame-accurate seek.
• Chain filters with commas: -vf "scale=1280:-2,fps=30"
• Use -map 0 to include all streams from input 0.
• Two-pass encoding: run with -pass 1 -f null /dev/null then -pass 2 for best quality/size.
This is an educational tool. The commands it builds are real — they will do exactly what you tell them to. Some flags are destructive (deletion, overwriting, forced operations) and even non-destructive options can cause data loss or system trouble in the wrong circumstances.
• Always review the generated command before running it.
• Test on disposable files and directories first.
• If you do not understand what a flag does, look it up in the official manual page (man command).
The author of these pages is not responsible for any damage, data loss, or other consequences resulting from commands generated, copied, or run from this site. Use at your own risk.
⚠ These tools build real shell commands. Review every command before running it. The author is not responsible for any damage, data loss, or other consequences resulting from commands generated, copied, or run from this site. Use at your own risk.
Send comments and bug reports to chris@chrisspackman.com.
Version 0.3.0 — Last updated: 2026-05-26
This page is Copyright © 2026
Chris Spackman <chris@chrisspackman.com>.
This web site developed entirely on GNU/Linux with Free / Open Source Software.
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.