1. Home
  2. Docs
  3. ffmpeg
  4. ffmpeg usage

ffmpeg usage

ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Getting help:
-h — print basic options
-h long — print more options
-h full — print all options (including all format and codec specific options, very long)

Print help / information / capabilities:

-L show license
-h topic show help
-? topic show help
-help topic show help
--help topic show help
-version show version
-buildconf show build configuration
-formats show available formats
-muxers show available muxers
-demuxers show available demuxers
-devices show available devices
-codecs show available codecs
-decoders show available decoders
-encoders show available encoders
-bsfs show available bit stream filters
-protocols show available protocols
-filters show available filters
-pix_fmts show available pixel formats
-layouts show standard channel layouts
-sample_fmts show available audio sample formats
-colors show available color names
-opencl_bench run benchmark on all OpenCL devices and show results
-sources device list sources of the input device
-sinks device list sinks of the output device
-hwaccels show available HW acceleration methods

Global options

(affect whole program instead of just one file)
-filter_complex_threads number of threads for -filter_complex
-filter_threads number of non-complex filter threads
-ignore_unknown Ignore unknown stream types
-loglevel loglevel set logging level
-max_alloc bytes set maximum size of a single allocated block
-max_error_rate ratio of errors (0.0: no errors, 1.0: 100% error maximum error rate
-n never overwrite output files
-opencl_options set OpenCL environment options
-report generate a report
-stats print progress report during encoding
-v loglevel set logging level
-y overwrite output files

Per-file main options:

-c codec codec name
-codec codec codec name
-discard discard
-disposition disposition
-f fmt force format
-filter filter_graph set stream filtergraph
-filter_script filename read stream filtergraph description from a file
-frames number set the number of frames to output
-fs limit_size set the limit file size in bytes
-map_metadata outfile[,metadata]:infile[,metadata] set metadata information of outfile from infile
-metadata string=string add metadata
-pre preset preset name
-program title=string:st=number... add program with specified streams
-reinit_filter reinit filtergraph on input parameter changes
-seek_timestamp enable/disable seeking by timestamp with -ss
-ss time_off set the start time offset
-sseof time_off set the start time offset relative to EOF
-t duration record or transcode “duration” seconds of audio/video
-target type specify target file type (“vcd”, “svcd”, “dvd”, “dv” or “dv50” with optional prefixes “pal-“, “ntsc-” or “film-“)
-timestamp time set the recording timestamp (‘now’ to set the current time)
-to time_stop record or transcode stop time

Video options:

-aspect aspect set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)
-b bitrate video bitrate (please use -b:v)
-bits_per_raw_sample number set the number of bits per raw sample
-c:v codec force video codec (‘copy’ to copy stream)
-dn disable data
-pass n select the pass number (1 to 3)
-r rate set frame rate (Hz value, fraction or abbreviation)
-s size set frame size (WxH or abbreviation)
-timecode hh:mm:ss[:;.]ff set initial TimeCode value.
-vcodec codec force video codec (‘copy’ to copy stream)
-vf filter_graph set video filters
-vframes number set the number of video frames to output
-vn disable video

Audio options:

-ab bitrate audio bitrate (please use -b:a)
-ac channels set number of audio channels
-acodec codec force audio codec (‘copy’ to copy stream)
-af filter_graph set audio filters
-aframes number set the number of audio frames to output
-an disable audio
-apad pad audio with silence
-aq quality set audio quality (codec-specific)
-ar rate set audio sampling rate (in Hz)
-c:a codec force audio codec (‘copy’ to copy stream)
-vol volume change audio volume (256=normal)

Subtitle options:

-canvas_size size set canvas size (WxH or abbreviation)
-fix_sub_duration fix subtitles duration
-s size set frame size (WxH or abbreviation)
-scodec codec force subtitle codec (‘copy’ to copy stream)
-sn disable subtitle
-spre preset set the subtitle options to the indicated preset
-stag fourcc/tag force subtitle tag/fourcc

(based on version 3.4.2 on MacOS Mojave – Copyright (c) 2000-2018 the FFmpeg developers )

Articles

Tags , , , , ,