FFmpeg Command-line toolkit for recording, converting, and streaming audio and video

Command Reference

A quick-lookup cheat sheet. See the linked page for each section for full explanations and examples.

Setup & Inspection

CommandDescription
ffmpeg -versionPrint version and build config
ffmpeg -codecsList available encoders/decoders
ffprobe filePrint container/codec/duration info
ffprobe -show_streams -show_format fileDetailed stream metadata

Input / Output

FlagDescription
-i <file>Specify an input file
-c copyCopy all streams without re-encoding
-c:v <codec>Set video codec
-c:a <codec>Set audio codec
-vn / -anDrop video / audio stream from output
-y / -nAlways / never overwrite output without asking

Trimming

FlagDescription
-ss <time>Start time (before -i: fast/keyframe; after: exact)
-t <dur>Duration to keep
-to <time>Absolute end timestamp

Video filters & quality

FlagDescription
-vf scale=W:HResize video (use -1 or -2 for auto dimension)
-crf NConstant-quality factor (lower = better; 18-28 typical)
-b:v <rate>Target video bitrate, e.g. 2M
-preset <name>Encoder speed/efficiency tradeoff
-vf fps=NChange/limit frame rate
-frames:v NOutput only N video frames

Audio

FlagDescription
-b:a <rate>Target audio bitrate, e.g. 192k
-ar <hz>Set audio sample rate
-ac <n>Set number of audio channels
-q:a NVariable-quality audio (codec-specific scale)

GIFs & Concatenation

Command / flagDescription
-vf "fps=15,scale=480:-1"Basic GIF-ready filter chain
palettegen / paletteuseTwo-pass high-quality GIF palette
-f concat -safe 0 -i list.txtJoin files listed in a text manifest

Miscellaneous

FlagDescription
-hide_bannerSuppress the build/config banner
-loglevel <level>Control log verbosity (quiet, error, info, debug)
-filter_complex "..."Chain filters across multiple inputs/outputs
-map 0:v:0 -map 1:a:0Manually pick which streams go to output