General FFmpeg commands do have the following syntaxes1:

  [input_options] -i input_file {[input_options] -i input_file}
  [output_options] output_file {[output_options] output_file}

  [input_options] input_file

  [input_options] input_file

In this Cookbook monospaced bolt font is used for the parts of the command that can be copied and pasted directly into the Terminal, without any need of adaptation, and monospaced italic font for parts that must be modified in order to match the actual needs.

In this Cookbook a single command is splitten into more lines for readability. However, you must write them in one line into the Terminal or use the backward slash \ in order to escape the newline.


Those syntaxes by the author are not exactly the ones used by FFmpeg’s maintainers. As defined in EBNF, [ ] contains an optional part and { } an optional part that may be repeated. (The Extended Backus–Naur Form has been standardised in ISO/IEC 14977:1996, yet this is shamefully behind a paywall.)