(ffmpeg.org) FFmpeg
ROAM_REFS: https://ffmpeg.org/
A complete, cross-platform solution to record, convert and stream audio and video.
(ffmpeg.org) Documentation
ROAM_REFS: https://ffmpeg.org/documentation.html
The following documentation is regenerated nightly, and corresponds to the newest FFmpeg revision. Consult your locally installed documentation for older versions.
(ffmpeg.org) ffmpeg Documentation
ROAM_REFS: https://ffmpeg.org/ffmpeg.html
- ffmpeg Documentation
** 1 Synopsis
ffmpeg [=globaloptions=] {[=inputfileoptions=] -i
input_url} … {[=outputfileoptions=]output_url} …** 2 Description
ffmpegis a universal media converter. It can read a wide variety of inputs - including live grabbing/recording devices - filter, and transcode them into a plethora of output formats.ffmpegreads from an arbitrary number of inputs (which can be regular files, pipes, network streams, grabbing devices, etc.), specified by the-ioption, and writes to an arbitrary number of outputs, which are specified by a plain output url. Anything found on the command line which cannot be interpreted as an option is considered to be an output url.Each input or output can, in principle, contain any number of elementary streams of different types (video/audio/subtitle/attachment/data), though the allowed stream counts and/or types may be limited by the container format. Selecting which streams from which inputs will go into which output is either done automatically or with the
-mapoption (see the Stream selection chapter).To refer to inputs/outputs in options, you must use their indices (0-based). E.g. the first input is
0, the second is1, etc. Similarly, streams within an input/output are referred to by their indices. E.g.2:3refers to the fourth stream in the third input or output. Also see the Stream specifiers chapter.As a general rule, options are applied to the next specified file. Therefore, order is important, and you can have the same option on the command line multiple times. Each occurrence is then applied to the next input or output file. Exceptions from this rule are the global options (e.g. verbosity level), which should be specified first.
Do not mix input and output files – first specify all input files, then all output files. Also do not mix options which belong to different files. All options apply ONLY to the next input or output file and are reset between files.
Some simple examples follow.
Convert an input media file to a different format, by re-encoding media streams:
ffmpeg -i input.avi output.mp4Set the video bitrate of the output file to 64 kbit/s:
ffmpeg -i input.avi -b:v 64k -bufsize 64k output.mp4Force the frame rate of the output file to 24 fps:
ffmpeg -i input.avi -r 24 output.mp4Force the frame rate of the input file (valid for raw formats only) to 1 fps and the frame rate of the output file to 24 fps:
ffmpeg -r 1 -i input.m2v -r 24 output.mp4The format option may be needed for raw input files.