cmdxray / commands / ffmpeg

What does ffmpeg do?

record, convert and stream audio and video.

▸ Explain your own ffmpeg command →

ffmpeg examples, explained

$ ffmpeg -i in.mov -c:v libx264 -crf 23 -preset medium out.mp4

  • ffmpegrecord, convert and stream audio and video
  • -iread from this input file (repeat for multiple inputs)
  • in.movvalue for -i
  • -c:vset the video codec (e.g. libx264, libx265)
  • libx264value for -c:v
  • -crfconstant rate factor — quality vs size (lower = better, x264/x265)
  • 23value for -crf
  • -presetencoding speed vs compression trade-off (ultrafast … veryslow)
  • mediumvalue for -preset
  • out.mp4an argument passed to the command

$ ffmpeg -i in.mp4 -vf scale=1280:-1 -an out.webm

  • ffmpegrecord, convert and stream audio and video
  • -iread from this input file (repeat for multiple inputs)
  • in.mp4value for -i
  • -vfapply a video filter graph (scale, crop, fps, overlay, …)
  • scale=1280:-1value for -vf
  • -androp the audio stream (no audio)
  • out.webman argument passed to the command

ffmpeg flags & options

-iread from this input file (repeat for multiple inputs)
-vfapply a video filter graph (scale, crop, fps, overlay, …)
-afapply an audio filter graph
-filter_complexapply a filter graph across multiple inputs/outputs
-cset the codec (use -c:v for video, -c:a for audio, copy = remux)
-c:vset the video codec (e.g. libx264, libx265)
-c:aset the audio codec (e.g. aac, libmp3lame)
-vcodecset the video codec (older spelling of -c:v)
-acodecset the audio codec (older spelling of -c:a)
-b:vset the target video bitrate (e.g. 1M)
-b:aset the target audio bitrate (e.g. 128k)
-crfconstant rate factor — quality vs size (lower = better, x264/x265)
-presetencoding speed vs compression trade-off (ultrafast … veryslow)
-rset the frame rate in frames per second
-sset the frame size as WxH (e.g. 1280x720)
-ssseek to this start time before processing
-tlimit the output to this duration
-tostop writing at this timestamp
-mapchoose which input streams end up in the output
-fforce this container/output format
-androp the audio stream (no audio)
-vndrop the video stream (no video)
-sndrop the subtitle stream
-yoverwrite the output file without asking
-nnever overwrite an existing output file
-loglevelset how verbose ffmpeg's logging is
-hide_bannersuppress the startup copyright/build banner

Other commands

Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.