FFmpeg cheatsheet

Written by on .

FFmpeg is ideal for processing video (and audio). If you are dealing with video files, FFmpeg is likely a useful tool. The documentation of FFmpeg is very limited. This cheatsheet lists some common usage of FFmpeg. DISCLAIMER: May contain errors and/or misconceptions, always check the documentation and thoroughly test the result.

General usage

FFmpeg takes input and processes it into an output, and has the following general usage:


The order of the input and output options is usually not important.

Input options

Output options


List all possible values for the input_format input option that the given webcam supports:

ffmpeg -f video4linux2 -list_formats all -i /dev/video0

This is the FFmpeg-interpreted equivalent of v4l2-ctl --list-formats-ext -d /dev/video0. Note that FFmpeg will try to negotiate an input format based on your input options with the input device.