{
    "mode": "man",
    "parameter": "ffmpeg",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/ffmpeg/1/json",
    "generated": "2026-09-04T02:13:10Z",
    "synopsis": "ffmpeg [globaloptions] {[inputfileoptions] -i inputurl} ... {[outputfileoptions]\noutputurl} ...",
    "sections": {
        "NAME": {
            "content": "ffmpeg - ffmpeg media converter\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "ffmpeg [globaloptions] {[inputfileoptions] -i inputurl} ... {[outputfileoptions]\noutputurl} ...\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "ffmpeg is a universal media converter. It can read a wide variety of inputs - including live\ngrabbing/recording devices - filter, and transcode them into a plethora of output formats.\n\nffmpeg reads from an arbitrary number of input \"files\" (which can be regular files, pipes,\nnetwork streams, grabbing devices, etc.), specified by the \"-i\" option, and writes to an\narbitrary number of output \"files\", which are specified by a plain output url. Anything found\non the command line which cannot be interpreted as an option is considered to be an output\nurl.\n\nEach input or output url can, in principle, contain any number of streams of different types\n(video/audio/subtitle/attachment/data). The allowed number and/or types of streams may be\nlimited by the container format. Selecting which streams from which inputs will go into which\noutput is either done automatically or with the \"-map\" option (see the Stream selection\nchapter).\n\nTo refer to input files in options, you must use their indices (0-based). E.g.  the first\ninput file is 0, the second is 1, etc. Similarly, streams within a file are referred to by\ntheir indices. E.g. \"2:3\" refers to the fourth stream in the third input file. Also see the\nStream specifiers chapter.\n\nAs a general rule, options are applied to the next specified file. Therefore, order is\nimportant, and you can have the same option on the command line multiple times. Each\noccurrence is then applied to the next input or output file.  Exceptions from this rule are\nthe global options (e.g. verbosity level), which should be specified first.\n\nDo not mix input and output files -- first specify all input files, then all output files.\nAlso do not mix options which belong to different files. All options apply ONLY to the next\ninput or output file and are reset between files.\n\nSome simple examples follow.\n\n•   Convert an input media file to a different format, by re-encoding media streams:\n\nffmpeg -i input.avi output.mp4\n\n•   Set the video bitrate of the output file to 64 kbit/s:\n\nffmpeg -i input.avi -b:v 64k -bufsize 64k output.mp4\n\n•   Force the frame rate of the output file to 24 fps:\n\nffmpeg -i input.avi -r 24 output.mp4\n\n•   Force  the  frame  rate  of  the input file (valid for raw formats only) to 1 fps and the\nframe rate of the output file to 24 fps:\n\nffmpeg -r 1 -i input.m2v -r 24 output.mp4\n\nThe format option may be needed for raw input files.\n",
            "subsections": []
        },
        "DETAILED DESCRIPTION": {
            "content": "The transcoding process in ffmpeg for each output can be described by the following diagram:\n\n\n|       |            |              |\n| input |  demuxer   | encoded data |   decoder\n| file  | ---------> | packets      | -----+\n||            ||      |\nv\n\n|         |\n| decoded |\n| frames  |\n||\n|\n|        |           |              |      |\n| output | <-------- | encoded data | <----+\n| file   |   muxer   | packets      |   encoder\n||           ||\n\nffmpeg calls the libavformat library (containing  demuxers)  to  read  input  files  and  get\npackets  containing encoded data from them. When there are multiple input files, ffmpeg tries\nto keep them synchronized by tracking lowest timestamp on any active input stream.\n\nEncoded packets are then passed to the decoder (unless streamcopy is selected for the stream,\nsee further for a description). The  decoder  produces  uncompressed  frames  (raw  video/PCM\naudio/...)  which  can be processed further by filtering (see next section). After filtering,\nthe frames are passed to the encoder, which encodes them and outputs encoded packets. Finally\nthose are passed to the muxer, which writes the encoded packets to the output file.\n",
            "subsections": [
                {
                    "name": "Filtering",
                    "content": "Before encoding, ffmpeg can process raw  audio  and  video  frames  using  filters  from  the\nlibavfilter  library.  Several  chained  filters  form  a  filter graph. ffmpeg distinguishes\nbetween two types of filtergraphs: simple and complex.\n\nSimple filtergraphs\n\nSimple filtergraphs are those that have exactly one input and output, both of the same  type.\nIn  the  above diagram they can be represented by simply inserting an additional step between\ndecoding and encoding:\n\n\n|         |                      |              |\n| decoded |                      | encoded data |\n| frames  |\\                    | packets      |\n|| \\                  /|||\n\\      /\nsimple     \\||          | /  encoder\nfiltergraph   | filtered |/\n| frames   |\n||\n\nSimple filtergraphs are configured with the per-stream  -filter  option  (with  -vf  and  -af\naliases  for  video  and  audio  respectively).   A simple filtergraph for video can look for\nexample like this:\n\n\n|       |      |             |      |       |      |        |\n| input | ---> | deinterlace | ---> | scale | ---> | output |\n||      ||      ||      ||\n\nNote that some filters change frame properties but not frame contents. E.g. the \"fps\"  filter\nin the example above changes number of frames, but does not touch the frame contents. Another\nexample  is  the  \"setpts\" filter, which only sets timestamps and otherwise passes the frames\nunchanged.\n\nComplex filtergraphs\n\nComplex filtergraphs are those which cannot be described as simply a linear processing  chain\napplied  to one stream. This is the case, for example, when the graph has more than one input\nand/or output, or when output stream type is different from input. They  can  be  represented\nwith the following diagram:\n\n\n|         |\n| input 0 |\\\n|| \\                  |          |\n\\       /| output 0 |\n\\ |         |  / ||\n\\| complex | /\n|         |     |         |/\n| input 1 |---->| filter  |\\\n||     |         | \\\n/| graph   |  \\ |          |\n/ |         |   \\| output 1 |\n/  ||    ||\n|         | /\n| input 2 |/\n||\n\nComplex  filtergraphs  are configured with the -filtercomplex option.  Note that this option\nis global, since a complex filtergraph, by its nature,  cannot  be  unambiguously  associated\nwith a single stream or file.\n\nThe -lavfi option is equivalent to -filtercomplex.\n\nA  trivial  example  of  a  complex  filtergraph is the \"overlay\" filter, which has two video\ninputs and one video output, containing one video overlaid on top of  the  other.  Its  audio\ncounterpart is the \"amix\" filter.\n"
                },
                {
                    "name": "Stream copy",
                    "content": "Stream  copy  is  a  mode selected by supplying the \"copy\" parameter to the -codec option. It\nmakes ffmpeg omit the decoding and encoding step for the specified stream, so  it  does  only\ndemuxing  and  muxing. It is useful for changing the container format or modifying container-\nlevel metadata. The diagram above will, in this case, simplify to this:\n\n\n|       |            |              |          |        |\n| input |  demuxer   | encoded data |  muxer   | output |\n| file  | ---------> | packets      | -------> | file   |\n||            ||          ||\n\nSince there is no decoding or encoding, it is  very  fast  and  there  is  no  quality  loss.\nHowever,  it  might  not  work  in  some  cases  because of many factors. Applying filters is\nobviously also impossible, since filters work on uncompressed data.\n"
                }
            ]
        },
        "STREAM SELECTION": {
            "content": "ffmpeg provides the \"-map\" option for manual control of stream selection in each output file.\nUsers can skip \"-map\" and let ffmpeg perform automatic stream selection as  described  below.\nThe  \"-vn  / -an / -sn / -dn\" options can be used to skip inclusion of video, audio, subtitle\nand data streams respectively, whether manually mapped or automatically selected, except  for\nthose streams which are outputs of complex filtergraphs.\n",
            "subsections": [
                {
                    "name": "Description",
                    "content": "The  sub-sections  that  follow  describe  the  various  rules  that  are  involved in stream\nselection.  The examples that follow next show how these rules are applied in practice.\n\nWhile every effort is made to accurately reflect the behavior of the program, FFmpeg is under\ncontinuous development and the code may have changed since the time of this writing.\n\nAutomatic stream selection\n\nIn the absence of any map options for a particular output file, ffmpeg  inspects  the  output\nformat  to  check  which  type  of  streams  can  be included in it, viz. video, audio and/or\nsubtitles. For each acceptable stream type, ffmpeg will pick one stream, when available, from\namong all the inputs.\n\nIt will select that stream based upon the following criteria:\n\n•   for video, it is the stream with the highest resolution,\n\n•   for audio, it is the stream with the most channels,\n\n•   for subtitles, it is the first subtitle stream found but there's a  caveat.   The  output\nformat's  default  subtitle  encoder  can be either text-based or image-based, and only a\nsubtitle stream of the same type will be chosen.\n\nIn the case where several streams of the same type rate equally, the stream with  the  lowest\nindex is chosen.\n\nData  or  attachment  streams  are  not automatically selected and can only be included using\n\"-map\".\n\nManual stream selection\n\nWhen \"-map\" is used, only user-mapped streams are included in  that  output  file,  with  one\npossible exception for filtergraph outputs described below.\n\nComplex filtergraphs\n\nIf  there  are any complex filtergraph output streams with unlabeled pads, they will be added\nto the first output file. This will lead to a fatal error if the stream type is not supported\nby the output format. In the absence of the map option, the inclusion of these streams  leads\nto  the  automatic stream selection of their types being skipped. If map options are present,\nthese filtergraph streams are included in addition to the mapped streams.\n\nComplex filtergraph output streams with labeled pads must be mapped once and exactly once.\n\nStream handling\n\nStream handling is independent of stream selection, with an exception for subtitles described\nbelow. Stream handling is set via the \"-codec\" option addressed to streams within a  specific\noutput  file.  In  particular, codec options are applied by ffmpeg after the stream selection\nprocess and thus do not influence the latter. If no \"-codec\" option is specified for a stream\ntype, ffmpeg will select the default encoder registered by the output file muxer.\n\nAn exception exists for subtitles. If a subtitle encoder is specified for an output file, the\nfirst subtitle stream found of any type, text or image, will be  included.  ffmpeg  does  not\nvalidate  if the specified encoder can convert the selected stream or if the converted stream\nis acceptable within the output format. This applies generally as well: when the user sets an\nencoder manually, the stream selection process cannot check if  the  encoded  stream  can  be\nmuxed  into  the output file.  If it cannot, ffmpeg will abort and all output files will fail\nto be processed.\n"
                },
                {
                    "name": "Examples",
                    "content": "The following examples illustrate the behavior, quirks and  limitations  of  ffmpeg's  stream\nselection methods.\n\nThey assume the following three input files.\n\ninput file 'A.avi'\nstream 0: video 640x360\nstream 1: audio 2 channels\n\ninput file 'B.mp4'\nstream 0: video 1920x1080\nstream 1: audio 2 channels\nstream 2: subtitles (text)\nstream 3: audio 5.1 channels\nstream 4: subtitles (text)\n\ninput file 'C.mkv'\nstream 0: video 1280x720\nstream 1: audio 2 channels\nstream 2: subtitles (image)\n\nExample: automatic stream selection\n\nffmpeg -i A.avi -i B.mp4 out1.mkv out2.wav -map 1:a -c:a copy out3.mov\n\nThere  are three output files specified, and for the first two, no \"-map\" options are set, so\nffmpeg will select streams for these two files automatically.\n\nout1.mkv is a Matroska container file and accepts  video,  audio  and  subtitle  streams,  so\nffmpeg  will  try to select one of each type.For video, it will select \"stream 0\" from B.mp4,\nwhich has the highest resolution among all the input video streams.For audio, it will  select\n\"stream  3\"  from  B.mp4, since it has the greatest number of channels.For subtitles, it will\nselect \"stream 2\" from B.mp4, which is the first subtitle stream from among A.avi and B.mp4.\n\nout2.wav accepts only audio streams, so only \"stream 3\" from B.mp4 is selected.\n\nFor out3.mov, since a \"-map\" option is set, no automatic stream  selection  will  occur.  The\n\"-map 1:a\" option will select all audio streams from the second input B.mp4. No other streams\nwill be included in this output file.\n\nFor  the first two outputs, all included streams will be transcoded. The encoders chosen will\nbe the default ones registered by each output format, which may not match the  codec  of  the\nselected input streams.\n\nFor  the third output, codec option for audio streams has been set to \"copy\", so no decoding-\nfiltering-encoding operations will occur, or can occur.  Packets of selected streams shall be\nconveyed from the input file and muxed within the output file.\n\nExample: automatic subtitles selection\n\nffmpeg -i C.mkv out1.mkv -c:s dvdsub -an out2.mkv\n\nAlthough out1.mkv is a Matroska container file which accepts subtitle streams, only  a  video\nand  audio  stream  shall  be  selected.  The subtitle stream of C.mkv is image-based and the\ndefault subtitle encoder of the Matroska muxer is text-based, so a  transcode  operation  for\nthe  subtitles is expected to fail and hence the stream isn't selected. However, in out2.mkv,\na subtitle encoder is specified in the command and so, the subtitle stream  is  selected,  in\naddition  to  the  video  stream.  The  presence of \"-an\" disables audio stream selection for\nout2.mkv.\n\nExample: unlabeled filtergraph outputs\n\nffmpeg -i A.avi -i C.mkv -i B.mp4 -filtercomplex \"overlay\" out1.mp4 out2.srt\n\nA filtergraph is setup here using the \"-filtercomplex\" option and consists of a single video\nfilter. The \"overlay\" filter requires exactly two video inputs, but none  are  specified,  so\nthe  first  two available video streams are used, those of A.avi and C.mkv. The output pad of\nthe filter has no label and so is sent to the  first  output  file  out1.mp4.  Due  to  this,\nautomatic  selection  of the video stream is skipped, which would have selected the stream in\nB.mp4. The audio stream with most channels viz. \"stream 3\" in B.mp4, is chosen automatically.\nNo subtitle stream is chosen however, since the MP4 format has no  default  subtitle  encoder\nregistered, and the user hasn't specified a subtitle encoder.\n\nThe  2nd output file, out2.srt, only accepts text-based subtitle streams. So, even though the\nfirst subtitle stream available belongs to C.mkv, it is image-based and hence  skipped.   The\nselected stream, \"stream 2\" in B.mp4, is the first text-based subtitle stream.\n\nExample: labeled filtergraph outputs\n\nffmpeg -i A.avi -i B.mp4 -i C.mkv -filtercomplex \"[1:v]hue=s=0[outv];overlay;aresample\" \\\n-map '[outv]' -an        out1.mp4 \\\nout2.mkv \\\n-map '[outv]' -map 1:a:0 out3.mkv\n\nThe above command will fail, as the output pad labelled \"[outv]\" has been mapped twice.  None\nof the output files shall be processed.\n\nffmpeg -i A.avi -i B.mp4 -i C.mkv -filtercomplex \"[1:v]hue=s=0[outv];overlay;aresample\" \\\n-an        out1.mp4 \\\nout2.mkv \\\n-map 1:a:0 out3.mkv\n\nThis  command above will also fail as the hue filter output has a label, \"[outv]\", and hasn't\nbeen mapped anywhere.\n\nThe command should be modified as follows,\n\nffmpeg -i A.avi -i B.mp4 -i C.mkv -filtercomplex \"[1:v]hue=s=0,split=2[outv1][outv2];overlay;aresample\" \\\n-map '[outv1]' -an        out1.mp4 \\\nout2.mkv \\\n-map '[outv2]' -map 1:a:0 out3.mkv\n\nThe video stream from B.mp4 is sent to the hue filter, whose output is cloned once using  the\nsplit  filter,  and  both outputs labelled. Then a copy each is mapped to the first and third\noutput files.\n\nThe overlay filter, requiring two video inputs, uses the  first  two  unused  video  streams.\nThose  are the streams from A.avi and C.mkv. The overlay output isn't labelled, so it is sent\nto the first output file out1.mp4, regardless of the presence of the \"-map\" option.\n\nThe aresample filter is sent the first unused audio stream, that of A.avi. Since this  filter\noutput  is  also unlabelled, it too is mapped to the first output file. The presence of \"-an\"\nonly suppresses automatic or manual stream selection of audio streams, not outputs sent  from\nfiltergraphs.  Both  these  mapped  streams  shall  be  ordered  before  the mapped stream in\nout1.mp4.\n\nThe video, audio and subtitle  streams  mapped  to  \"out2.mkv\"  are  entirely  determined  by\nautomatic stream selection.\n\nout3.mkv  consists  of the cloned video output from the hue filter and the first audio stream\nfrom B.mp4.\n"
                }
            ]
        },
        "OPTIONS": {
            "content": "All the numerical options, if not specified otherwise, accept a string representing a  number\nas  input,  which  may  be followed by one of the SI unit prefixes, for example: 'K', 'M', or\n'G'.\n\nIf 'i' is appended to the SI unit prefix, the complete prefix will be interpreted as  a  unit\nprefix  for  binary  multiples,  which are based on powers of 1024 instead of powers of 1000.\nAppending 'B' to the SI unit prefix multiplies  the  value  by  8.  This  allows  using,  for\nexample: 'KB', 'MiB', 'G' and 'B' as number suffixes.\n\nOptions  which  do not take arguments are boolean options, and set the corresponding value to\ntrue. They can be set to false by prefixing the option name  with  \"no\".  For  example  using\n\"-nofoo\" will set the boolean option with name \"foo\" to false.\n",
            "subsections": [
                {
                    "name": "Stream specifiers",
                    "content": "Some  options  are  applied  per-stream, e.g. bitrate or codec. Stream specifiers are used to\nprecisely specify which stream(s) a given option belongs to.\n\nA stream specifier is a string generally appended to the option name and separated from it by\na colon. E.g. \"-codec:a:1 ac3\" contains the \"a:1\" stream specifier, which matches the  second\naudio stream. Therefore, it would select the ac3 codec for the second audio stream.\n\nA  stream  specifier can match several streams, so that the option is applied to all of them.\nE.g. the stream specifier in \"-b:a 128k\" matches all audio streams.\n\nAn empty stream specifier matches all streams. For example, \"-codec copy\" or  \"-codec:  copy\"\nwould copy all the streams without reencoding.\n\nPossible forms of stream specifiers are:\n\nstreamindex\nMatches  the  stream  with this index. E.g. \"-threads:1 4\" would set the thread count for\nthe second stream to 4. If streamindex is used as an additional  stream  specifier  (see\nbelow),  then  it  selects  stream  number streamindex from the matching streams. Stream\nnumbering is based on the order of the streams as detected by libavformat except  when  a\nprogram  ID is also specified. In this case it is based on the ordering of the streams in\nthe program.\n\nstreamtype[:additionalstreamspecifier]\nstreamtype is one of following: 'v' or 'V' for video, 'a' for audio, 's'  for  subtitle,\n'd'  for  data,  and 't' for attachments. 'v' matches all video streams, 'V' only matches\nvideo streams which are not  attached  pictures,  video  thumbnails  or  cover  arts.  If\nadditionalstreamspecifier  is  used,  then it matches streams which both have this type\nand match the additionalstreamspecifier. Otherwise,  it  matches  all  streams  of  the\nspecified type.\n\np:programid[:additionalstreamspecifier]\nMatches   streams   which   are   in   the   program   with   the   id   programid.   If\nadditionalstreamspecifier is used, then it matches streams which both are part  of  the\nprogram and match the additionalstreamspecifier.\n\n#streamid or i:streamid\nMatch the stream by stream id (e.g. PID in MPEG-TS container).\n\nm:key[:value]\nMatches  streams  with  the  metadata tag key having the specified value. If value is not\ngiven, matches streams that contain the given tag with any value.\n\nu   Matches streams with usable configuration, the codec must be defined  and  the  essential\ninformation such as video dimension or audio sample rate must be present.\n\nNote that in ffmpeg, matching by metadata will only work properly for input files.\n"
                },
                {
                    "name": "Generic options",
                    "content": "These options are shared amongst the ff* tools.\n"
                },
                {
                    "name": "-L",
                    "content": "",
                    "flag": "-L"
                },
                {
                    "name": "-h, -?, -help, --help [_",
                    "content": "Show help. An optional parameter may be specified to print help about a specific item. If\nno argument is specified, only basic (non advanced) tool options are shown.\n\nPossible values of arg are:\n\nlong\nPrint advanced tool options in addition to the basic tool options.\n\nfull\nPrint  complete  list  of options, including shared and private options for encoders,\ndecoders, demuxers, muxers, filters, etc.\n\ndecoder=decodername\nPrint detailed information about the decoder named decodername.  Use  the  -decoders\noption to get a list of all decoders.\n\nencoder=encodername\nPrint  detailed  information  about the encoder named encodername. Use the -encoders\noption to get a list of all encoders.\n\ndemuxer=demuxername\nPrint detailed information about the demuxer named  demuxername.  Use  the  -formats\noption to get a list of all demuxers and muxers.\n\nmuxer=muxername\nPrint  detailed information about the muxer named muxername. Use the -formats option\nto get a list of all muxers and demuxers.\n\nfilter=filtername\nPrint detailed information about the  filter  named  filtername.  Use  the  -filters\noption to get a list of all filters.\n\nbsf=bitstreamfiltername\nPrint  detailed  information  about the bitstream filter named bitstreamfiltername.\nUse the -bsfs option to get a list of all bitstream filters.\n\nprotocol=protocolname\nPrint  detailed  information  about  the  protocol  named  protocolname.   Use   the\n-protocols option to get a list of all protocols.\n",
                    "flag": "-?",
                    "long": "--help"
                },
                {
                    "name": "-version",
                    "content": "Show version.\n"
                },
                {
                    "name": "-buildconf",
                    "content": "Show the build configuration, one option per line.\n"
                },
                {
                    "name": "-formats",
                    "content": "Show available formats (including devices).\n"
                },
                {
                    "name": "-demuxers",
                    "content": "Show available demuxers.\n"
                },
                {
                    "name": "-muxers",
                    "content": "Show available muxers.\n"
                },
                {
                    "name": "-devices",
                    "content": "Show available devices.\n"
                },
                {
                    "name": "-codecs",
                    "content": "Show all codecs known to libavcodec.\n\nNote  that  the term 'codec' is used throughout this documentation as a shortcut for what\nis more correctly called a media bitstream format.\n"
                },
                {
                    "name": "-decoders",
                    "content": "Show available decoders.\n"
                },
                {
                    "name": "-encoders",
                    "content": "Show all available encoders.\n"
                },
                {
                    "name": "-bsfs",
                    "content": "Show available bitstream filters.\n"
                },
                {
                    "name": "-protocols",
                    "content": "Show available protocols.\n"
                },
                {
                    "name": "-filters",
                    "content": "Show available libavfilter filters.\n"
                },
                {
                    "name": "-pix_fmts",
                    "content": "Show available pixel formats.\n"
                },
                {
                    "name": "-sample_fmts",
                    "content": "Show available sample formats.\n"
                },
                {
                    "name": "-layouts",
                    "content": "Show channel names and standard channel layouts.\n"
                },
                {
                    "name": "-dispositions",
                    "content": "Show stream dispositions.\n"
                },
                {
                    "name": "-colors",
                    "content": "Show recognized color names.\n"
                },
                {
                    "name": "-sources _",
                    "content": "Show autodetected sources of the input device.  Some devices may provide system-dependent\nsource names that cannot be autodetected.  The returned list  cannot  be  assumed  to  be\nalways complete.\n\nffmpeg -sources pulse,server=192.168.0.4\n"
                },
                {
                    "name": "-sinks _",
                    "content": "Show  autodetected sinks of the output device.  Some devices may provide system-dependent\nsink names that cannot be autodetected.  The returned list cannot be assumed to be always\ncomplete.\n\nffmpeg -sinks pulse,server=192.168.0.4\n"
                },
                {
                    "name": "-loglevel [_",
                    "content": "Set logging level and flags used by the library.\n\nThe optional flags prefix can consist of the following values:\n\nrepeat\nIndicates that repeated log output should not be compressed to the first line and the\n\"Last message repeated n times\" line will be omitted.\n\nlevel\nIndicates that log output should add a \"[level]\" prefix to each  message  line.  This\ncan be used as an alternative to log coloring, e.g. when dumping the log to file.\n\nFlags  can  also  be  used  alone  by  adding a '+'/'-' prefix to set/reset a single flag\nwithout affecting other flags or changing loglevel. When setting both flags and loglevel,\na '+' separator is expected between the last flags value and before loglevel.\n\nloglevel is a string or a number containing one of the following values:\n\nquiet, -8\nShow nothing at all; be silent.\n\npanic, 0\nOnly show fatal errors which could lead the process to crash, such  as  an  assertion\nfailure. This is not currently used for anything.\n\nfatal, 8\nOnly  show  fatal  errors. These are errors after which the process absolutely cannot\ncontinue.\n\nerror, 16\nShow all errors, including ones which can be recovered from.\n\nwarning, 24\nShow all warnings and errors. Any message related to possibly incorrect or unexpected\nevents will be shown.\n\ninfo, 32\nShow informative messages during processing. This is  in  addition  to  warnings  and\nerrors. This is the default value.\n\nverbose, 40\nSame as \"info\", except more verbose.\n\ndebug, 48\nShow everything, including debugging information.\n\ntrace, 56\n\nFor  example  to  enable repeated log output, add the \"level\" prefix, and set loglevel to\n\"verbose\":\n\nffmpeg -loglevel repeat+level+verbose -i input output\n\nAnother example that enables repeated log  output  without  affecting  current  state  of\n\"level\" prefix flag or loglevel:\n\nffmpeg [...] -loglevel +repeat\n\nBy  default  the program logs to stderr. If coloring is supported by the terminal, colors\nare used to  mark  errors  and  warnings.  Log  coloring  can  be  disabled  setting  the\nenvironment  variable  AVLOGFORCENOCOLOR,  or  can  be  forced setting the environment\nvariable AVLOGFORCECOLOR.\n"
                },
                {
                    "name": "-report",
                    "content": "Dump full command line and log output to a file  named  \"program-YYYYMMDD-HHMMSS.log\"  in\nthe  current  directory.   This  file  can  be  useful  for bug reports.  It also implies\n\"-loglevel debug\".\n\nSetting the environment variable FFREPORT to any value has the same effect. If the  value\nis  a  ':'-separated  key=value  sequence,  these  options will affect the report; option\nvalues must be escaped if they contain special characters or the  options  delimiter  ':'\n(see the ``Quoting and escaping'' section in the ffmpeg-utils manual).\n\nThe following options are recognized:\n\nfile\nset  the  file name to use for the report; %p is expanded to the name of the program,\n%t is expanded to a timestamp, \"%%\" is expanded to a plain \"%\"\n\nlevel\nset the log verbosity level using a numerical value (see \"-loglevel\").\n\nFor example, to output a report to a file named ffreport.log using  a  log  level  of  32\n(alias for log level \"info\"):\n\nFFREPORT=file=ffreport.log:level=32 ffmpeg -i input output\n\nErrors  in  parsing  the  environment  variable are not fatal, and will not appear in the\nreport.\n"
                },
                {
                    "name": "-hide_banner",
                    "content": "Suppress printing banner.\n\nAll FFmpeg tools will normally  show  a  copyright  notice,  build  options  and  library\nversions. This option can be used to suppress printing this information.\n"
                },
                {
                    "name": "-cpuflags flags (_",
                    "content": "Allows setting and clearing cpu flags. This option is intended for testing. Do not use it\nunless you know what you're doing.\n\nffmpeg -cpuflags -sse+mmx ...\nffmpeg -cpuflags mmx ...\nffmpeg -cpuflags 0 ...\n\nPossible flags for this option are:\n\nx86\nmmx\nmmxext\nsse\nsse2\nsse2slow\nsse3\nsse3slow\nssse3\natom\nsse4.1\nsse4.2\navx\navx2\nxop\nfma3\nfma4\n3dnow\n3dnowext\nbmi1\nbmi2\ncmov\nARM\narmv5te\narmv6\narmv6t2\nvfp\nvfpv3\nneon\nsetend\nAArch64\narmv8\nvfp\nneon\nPowerPC\naltivec\nSpecific Processors\npentium2\npentium3\npentium4\nk6\nk62\nathlon\nathlonxp\nk8"
                },
                {
                    "name": "-cpucount _",
                    "content": "Override  detection  of  CPU  count.  This  option is intended for testing. Do not use it\nunless you know what you're doing.\n\nffmpeg -cpucount 2\n"
                },
                {
                    "name": "-max_alloc _",
                    "content": "Set the maximum size limit for allocating a block on  the  heap  by  ffmpeg's  family  of\nmalloc  functions.  Exercise  extreme caution when using this option. Don't use if you do\nnot understand the full consequence of doing so.  Default is INTMAX.\n"
                },
                {
                    "name": "AVOptions",
                    "content": "These options are provided directly by the libavformat, libavdevice and libavcodec libraries.\nTo see the list of available AVOptions, use the -help option. They  are  separated  into  two\ncategories:\n"
                },
                {
                    "name": "generic",
                    "content": "These  options  can be set for any container, codec or device. Generic options are listed\nunder AVFormatContext options for containers/devices and under AVCodecContext options for\ncodecs.\n"
                },
                {
                    "name": "private",
                    "content": "These options are specific to the given container, device or codec. Private  options  are\nlisted under their corresponding containers/devices/codecs.\n\nFor  example  to write an ID3v2.3 header instead of a default ID3v2.4 to an MP3 file, use the\nid3v2version private option of the MP3 muxer:\n\nffmpeg -i input.flac -id3v2version 3 out.mp3\n\nAll codec AVOptions are per-stream, and thus a stream specifier should be attached to them:\n\nffmpeg -i multichannel.mxf -map 0:v:0 -map 0:a:0 -map 0:a:0 -c:a:0 ac3 -b:a:0 640k -ac:a:1 2 -c:a:1 aac -b:2 128k out.mp4\n\nIn the above example, a multichannel audio stream is mapped  twice  for  output.   The  first\ninstance  is  encoded with codec ac3 and bitrate 640k.  The second instance is downmixed to 2\nchannels and encoded with codec aac. A bitrate of 128k is specified  for  it  using  absolute\nindex of the output stream.\n\nNote: the -nooption syntax cannot be used for boolean AVOptions, use -option 0/-option 1.\n\nNote:  the old undocumented way of specifying per-stream AVOptions by prepending v/a/s to the\noptions name is now obsolete and will be removed soon.\n"
                },
                {
                    "name": "Main options",
                    "content": ""
                },
                {
                    "name": "-f _",
                    "content": "Force input or output file format. The format is normally auto detected for  input  files\nand  guessed  from  the  file extension for output files, so this option is not needed in\nmost cases.\n",
                    "flag": "-f"
                },
                {
                    "name": "-i _",
                    "content": "input file url\n",
                    "flag": "-i"
                },
                {
                    "name": "-y (_",
                    "content": "Overwrite output files without asking.\n",
                    "flag": "-y"
                },
                {
                    "name": "-n (_",
                    "content": "Do not overwrite output files, and exit immediately if a specified  output  file  already\nexists.\n",
                    "flag": "-n"
                },
                {
                    "name": "-stream_loop _",
                    "content": "Set  number  of  times  input stream shall be looped. Loop 0 means no loop, loop -1 means\ninfinite loop.\n"
                },
                {
                    "name": "-recast_media (_",
                    "content": "Allow forcing a decoder of a different media type than the one detected or designated  by\nthe demuxer. Useful for decoding media data muxed as data streams.\n"
                },
                {
                    "name": "-c[:_",
                    "content": ""
                },
                {
                    "name": "-codec[:_",
                    "content": "Select  an  encoder  (when  used before an output file) or a decoder (when used before an\ninput file) for one or more streams. codec is the name of a decoder/encoder or a  special\nvalue \"copy\" (output only) to indicate that the stream is not to be re-encoded.\n\nFor example\n\nffmpeg -i INPUT -map 0 -c:v libx264 -c:a copy OUTPUT\n\nencodes all video streams with libx264 and copies all audio streams.\n\nFor each stream, the last matching \"c\" option is applied, so\n\nffmpeg -i INPUT -map 0 -c copy -c:v:1 libx264 -c:a:137 libvorbis OUTPUT\n\nwill  copy  all  the streams except the second video, which will be encoded with libx264,\nand the 138th audio, which will be encoded with libvorbis.\n"
                },
                {
                    "name": "-t _",
                    "content": "When used as an input option (before \"-i\"), limit the duration  of  data  read  from  the\ninput file.\n\nWhen  used  as an output option (before an output url), stop writing the output after its\nduration reaches duration.\n\nduration must be a time duration specification, see the  Time  duration  section  in  the\nffmpeg-utils(1) manual.\n\n-to and -t are mutually exclusive and -t has priority.\n",
                    "flag": "-t"
                },
                {
                    "name": "-to _",
                    "content": "Stop  writing  the  output  or  reading  the  input at position.  position must be a time\nduration specification, see the Time duration section in the ffmpeg-utils(1) manual.\n\n-to and -t are mutually exclusive and -t has priority.\n"
                },
                {
                    "name": "-fs _",
                    "content": "Set the file size limit, expressed in bytes. No further chunk of bytes is  written  after\nthe  limit  is  exceeded. The size of the output file is slightly more than the requested\nfile size.\n"
                },
                {
                    "name": "-ss _",
                    "content": "When used as an input option (before \"-i\"), seeks in this input file  to  position.  Note\nthat  in  most  formats  it  is  not possible to seek exactly, so ffmpeg will seek to the\nclosest seek point before position.  When transcoding and -accurateseek is enabled  (the\ndefault),  this  extra  segment  between  the seek point and position will be decoded and\ndiscarded. When doing stream copy or when -noaccurateseek is used, it will be preserved.\n\nWhen used as an output option (before an output url), decodes but  discards  input  until\nthe timestamps reach position.\n\nposition  must  be  a  time  duration specification, see the Time duration section in the\nffmpeg-utils(1) manual.\n"
                },
                {
                    "name": "-sseof _",
                    "content": "Like the \"-ss\" option but relative to the \"end of file\".  That  is  negative  values  are\nearlier in the file, 0 is at EOF.\n"
                },
                {
                    "name": "-isync _",
                    "content": "Assign an input as a sync source.\n\nThis  will take the difference between the start times of the target and reference inputs\nand offset the timestamps of the target file by that difference. The source timestamps of\nthe two inputs should derive from the same clock source for expected results. If \"copyts\"\nis set then \"startatzero\" must also be set. If either of the  inputs  has  no  starting\ntimestamp then no sync adjustment is made.\n\nAcceptable  values  are  those  that  refer  to  a  valid ffmpeg input index. If the sync\nreference is the target index itself  or  -1,  then  no  adjustment  is  made  to  target\ntimestamps. A sync reference may not itself be synced to any other input.\n\nDefault value is -1.\n"
                },
                {
                    "name": "-itsoffset _",
                    "content": "Set the input time offset.\n\noffset  must  be  a  time  duration  specification,  see the Time duration section in the\nffmpeg-utils(1) manual.\n\nThe offset is added to the timestamps of the input files. Specifying  a  positive  offset\nmeans  that  the  corresponding  streams  are  delayed  by the time duration specified in\noffset.\n"
                },
                {
                    "name": "-itsscale _",
                    "content": "Rescale input timestamps. scale should be a floating point number.\n"
                },
                {
                    "name": "-timestamp _",
                    "content": "Set the recording timestamp in the container.\n\ndate must be a date specification, see the Date section in the ffmpeg-utils(1) manual.\n"
                },
                {
                    "name": "-metadata[:metadata_specifier] _",
                    "content": "Set a metadata key/value pair.\n\nAn optional metadataspecifier may be given to  set  metadata  on  streams,  chapters  or\nprograms. See \"-mapmetadata\" documentation for details.\n\nThis  option  overrides  metadata set with \"-mapmetadata\". It is also possible to delete\nmetadata by using an empty value.\n\nFor example, for setting the title in the output file:\n\nffmpeg -i in.avi -metadata title=\"my title\" out.flv\n\nTo set the language of the first audio stream:\n\nffmpeg -i INPUT -metadata:s:a:0 language=eng OUTPUT\n"
                },
                {
                    "name": "-disposition[:stream_specifier] _",
                    "content": "Sets the disposition for a stream.\n\nBy default, the disposition is copied from the input stream,  unless  the  output  stream\nthis  option applies to is fed by a complex filtergraph - in that case the disposition is\nunset by default.\n\nvalue is a sequence of items separated by '+' or '-'. The first item may also be prefixed\nwith '+' or '-', in which case this option modifies the  default  value.  Otherwise  (the\nfirst  item  is not prefixed) this options overrides the default value. A '+' prefix adds\nthe given disposition, '-' removes it. It is also possible to clear  the  disposition  by\nsetting it to 0.\n\nIf no \"-disposition\" options were specified for an output file, ffmpeg will automatically\nset  the  'default' disposition on the first stream of each type, when there are multiple\nstreams of this type in the output file and no stream of that type is already  marked  as\ndefault.\n\nThe \"-dispositions\" option lists the known dispositions.\n\nFor example, to make the second audio stream the default stream:\n\nffmpeg -i in.mkv -c copy -disposition:a:1 default out.mkv\n\nTo  make the second subtitle stream the default stream and remove the default disposition\nfrom the first subtitle stream:\n\nffmpeg -i in.mkv -c copy -disposition:s:0 0 -disposition:s:1 default out.mkv\n\nTo add an embedded cover/thumbnail:\n\nffmpeg -i in.mp4 -i IMAGE -map 0 -map 1 -c copy -c:v:1 png -disposition:v:1 attachedpic out.mp4\n\nNot all muxers support embedded thumbnails, and those who do, only support a few formats,\nlike JPEG or PNG.\n"
                },
                {
                    "name": "-program [title=_",
                    "content": "Creates a program with the specified title, programnum and adds the specified  stream(s)\nto it.\n"
                },
                {
                    "name": "-target _",
                    "content": "Specify  target file type (\"vcd\", \"svcd\", \"dvd\", \"dv\", \"dv50\"). type may be prefixed with\n\"pal-\", \"ntsc-\" or \"film-\" to use the corresponding  standard.  All  the  format  options\n(bitrate, codecs, buffer sizes) are then set automatically. You can just type:\n\nffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg\n\nNevertheless  you can specify additional options as long as you know they do not conflict\nwith the standard, as in:\n\nffmpeg -i myfile.avi -target vcd -bf 2 /tmp/vcd.mpg\n\nThe parameters set for each target are as follows.\n\nVCD\n\n<pal>:\n-f vcd -muxrate 1411200 -muxpreload 0.44 -packetsize 2324\n-s 352x288 -r 25\n-codec:v mpeg1video -g 15 -b:v 1150k -maxrate:v 1150k -minrate:v 1150k -bufsize:v 327680\n-ar 44100 -ac 2\n-codec:a mp2 -b:a 224k\n\n<ntsc>:\n-f vcd -muxrate 1411200 -muxpreload 0.44 -packetsize 2324\n-s 352x240 -r 30000/1001\n-codec:v mpeg1video -g 18 -b:v 1150k -maxrate:v 1150k -minrate:v 1150k -bufsize:v 327680\n-ar 44100 -ac 2\n-codec:a mp2 -b:a 224k\n\n<film>:\n-f vcd -muxrate 1411200 -muxpreload 0.44 -packetsize 2324\n-s 352x240 -r 24000/1001\n-codec:v mpeg1video -g 18 -b:v 1150k -maxrate:v 1150k -minrate:v 1150k -bufsize:v 327680\n-ar 44100 -ac 2\n-codec:a mp2 -b:a 224k\n\nSVCD\n\n<pal>:\n-f svcd -packetsize 2324\n-s 480x576 -pixfmt yuv420p -r 25\n-codec:v mpeg2video -g 15 -b:v 2040k -maxrate:v 2516k -minrate:v 0 -bufsize:v 1835008 -scanoffset 1\n-ar 44100\n-codec:a mp2 -b:a 224k\n\n<ntsc>:\n-f svcd -packetsize 2324\n-s 480x480 -pixfmt yuv420p -r 30000/1001\n-codec:v mpeg2video -g 18 -b:v 2040k -maxrate:v 2516k -minrate:v 0 -bufsize:v 1835008 -scanoffset 1\n-ar 44100\n-codec:a mp2 -b:a 224k\n\n<film>:\n-f svcd -packetsize 2324\n-s 480x480 -pixfmt yuv420p -r 24000/1001\n-codec:v mpeg2video -g 18 -b:v 2040k -maxrate:v 2516k -minrate:v 0 -bufsize:v 1835008 -scanoffset 1\n-ar 44100\n-codec:a mp2 -b:a 224k\n\nDVD\n\n<pal>:\n-f dvd -muxrate 10080k -packetsize 2048\n-s 720x576 -pixfmt yuv420p -r 25\n-codec:v mpeg2video -g 15 -b:v 6000k -maxrate:v 9000k -minrate:v 0 -bufsize:v 1835008\n-ar 48000\n-codec:a ac3 -b:a 448k\n\n<ntsc>:\n-f dvd -muxrate 10080k -packetsize 2048\n-s 720x480 -pixfmt yuv420p -r 30000/1001\n-codec:v mpeg2video -g 18 -b:v 6000k -maxrate:v 9000k -minrate:v 0 -bufsize:v 1835008\n-ar 48000\n-codec:a ac3 -b:a 448k\n\n<film>:\n-f dvd -muxrate 10080k -packetsize 2048\n-s 720x480 -pixfmt yuv420p -r 24000/1001\n-codec:v mpeg2video -g 18 -b:v 6000k -maxrate:v 9000k -minrate:v 0 -bufsize:v 1835008\n-ar 48000\n-codec:a ac3 -b:a 448k\n\nDV\n\n<pal>:\n-f dv\n-s 720x576 -pixfmt yuv420p -r 25\n-ar 48000 -ac 2\n\n<ntsc>:\n-f dv\n-s 720x480 -pixfmt yuv411p -r 30000/1001\n-ar 48000 -ac 2\n\n<film>:\n-f dv\n-s 720x480 -pixfmt yuv411p -r 24000/1001\n-ar 48000 -ac 2\n\nThe \"dv50\" target is identical to the \"dv\" target except that the  pixel  format  set  is\n\"yuv422p\" for all three standards.\n\nAny  user-set  value for a parameter above will override the target preset value. In that\ncase, the output may not comply with the target standard.\n"
                },
                {
                    "name": "-dn (_",
                    "content": "As an input option, blocks all data streams of  a  file  from  being  filtered  or  being\nautomatically selected or mapped for any output. See \"-discard\" option to disable streams\nindividually.\n\nAs  an  output option, disables data recording i.e. automatic selection or mapping of any\ndata stream. For full manual control see the \"-map\" option.\n"
                },
                {
                    "name": "-dframes _",
                    "content": "Set the number of data frames to output. This is an obsolete alias for \"-frames:d\", which\nyou should use instead.\n"
                },
                {
                    "name": "-frames[:_",
                    "content": "Stop writing to the stream after framecount frames.\n"
                },
                {
                    "name": "-q[:_",
                    "content": ""
                },
                {
                    "name": "-qscale[:_",
                    "content": "Use fixed quality scale (VBR). The meaning of q/qscale is codec-dependent.  If qscale  is\nused  without  a  streamspecifier  then  it applies only to the video stream, this is to\nmaintain compatibility with previous behavior and as specifying the same  codec  specific\nvalue  to  2  different  codecs that is audio and video generally is not what is intended\nwhen no streamspecifier is used.\n"
                },
                {
                    "name": "-filter[:_",
                    "content": "Create the filtergraph specified by filtergraph and use it to filter the stream.\n\nfiltergraph is a description of the filtergraph to apply to the stream, and must  have  a\nsingle  input and a single output of the same type of the stream. In the filtergraph, the\ninput is associated to the label \"in\", and the output to the label \"out\". See the ffmpeg-\nfilters manual for more information about the filtergraph syntax.\n\nSee the -filtercomplex option if you want to create filtergraphs  with  multiple  inputs\nand/or outputs.\n"
                },
                {
                    "name": "-filter_script[:_",
                    "content": "This  option  is similar to -filter, the only difference is that its argument is the name\nof the file from which a filtergraph description is to be read.\n"
                },
                {
                    "name": "-reinit_filter[:_",
                    "content": "This boolean option determines if the filtergraph(s) to which this  stream  is  fed  gets\nreinitialized  when  input  frame parameters change mid-stream. This option is enabled by\ndefault as most video and all audio  filters  cannot  handle  deviation  in  input  frame\nproperties.   Upon  reinitialization,  existing filter state is lost, like e.g. the frame\ncount  \"n\"  reference  available  in  some  filters.  Any  frames  buffered  at  time  of\nreinitialization  are lost.  The properties where a change triggers reinitialization are,\nfor video, frame resolution or pixel format;  for  audio,  sample  format,  sample  rate,\nchannel count or channel layout.\n"
                },
                {
                    "name": "-filter_threads _",
                    "content": "Defines  how  many  threads  are  used  to  process a filter pipeline. Each pipeline will\nproduce a thread pool with this many threads  available  for  parallel  processing.   The\ndefault is the number of available CPUs.\n"
                },
                {
                    "name": "-pre[:_",
                    "content": "Specify the preset for matching stream(s).\n"
                },
                {
                    "name": "-stats (_",
                    "content": "Print  encoding  progress/statistics.  It  is on by default, to explicitly disable it you\nneed to specify \"-nostats\".\n"
                },
                {
                    "name": "-stats_period _",
                    "content": "Set period at which encoding progress/statistics are updated. Default is 0.5 seconds.\n"
                },
                {
                    "name": "-progress _",
                    "content": "Send program-friendly progress information to url.\n\nProgress information is written periodically and at the end of the encoding  process.  It\nis  made of \"key=value\" lines. key consists of only alphanumeric characters. The last key\nof a sequence of progress information is always \"progress\".\n\nThe update period is set using \"-statsperiod\".\n"
                },
                {
                    "name": "-stdin",
                    "content": "Enable interaction on standard input. On by default unless standard input is used  as  an\ninput. To explicitly disable interaction you need to specify \"-nostdin\".\n\nDisabling  interaction  on  standard  input  is  useful, for example, if ffmpeg is in the\nbackground process group. Roughly the same result can be  achieved  with  \"ffmpeg  ...  <\n/dev/null\" but it requires a shell.\n"
                },
                {
                    "name": "-debug_ts (_",
                    "content": "Print  timestamp  information.  It  is  off  by default. This option is mostly useful for\ntesting and debugging purposes, and the output format may  change  from  one  version  to\nanother, so it should not be employed by portable scripts.\n\nSee also the option \"-fdebug ts\".\n"
                },
                {
                    "name": "-attach _",
                    "content": "Add  an  attachment  to the output file. This is supported by a few formats like Matroska\nfor e.g. fonts used in rendering subtitles. Attachments are  implemented  as  a  specific\ntype  of stream, so this option will add a new stream to the file. It is then possible to\nuse per-stream options on this stream in the usual way. Attachment streams  created  with\nthis  option  will be created after all the other streams (i.e. those created with \"-map\"\nor automatic mappings).\n\nNote that for Matroska you also have to set the mimetype metadata tag:\n\nffmpeg -i INPUT -attach DejaVuSans.ttf -metadata:s:2 mimetype=application/x-truetype-font out.mkv\n\n(assuming that the attachment stream will be third in the output file).\n"
                },
                {
                    "name": "-dump_attachment[:_",
                    "content": "Extract the matching attachment stream into a file named filename. If filename is  empty,\nthen the value of the \"filename\" metadata tag will be used.\n\nE.g. to extract the first attachment to a file named 'out.ttf':\n\nffmpeg -dumpattachment:t:0 out.ttf -i INPUT\n\nTo extract all attachments to files determined by the \"filename\" tag:\n\nffmpeg -dumpattachment:t \"\" -i INPUT\n\nTechnical  note  --  attachments  are  implemented as codec extradata, so this option can\nactually be used to extract extradata from any stream, not just attachments.\n"
                },
                {
                    "name": "Video Options",
                    "content": ""
                },
                {
                    "name": "-vframes _",
                    "content": "Set the number of video frames to output. This is  an  obsolete  alias  for  \"-frames:v\",\nwhich you should use instead.\n"
                },
                {
                    "name": "-r[:_",
                    "content": "Set frame rate (Hz value, fraction or abbreviation).\n\nAs  an  input  option,  ignore  any  timestamps  stored  in the file and instead generate\ntimestamps assuming constant frame rate fps.  This is not  the  same  as  the  -framerate\noption  used  for some input formats like image2 or v4l2 (it used to be the same in older\nversions of FFmpeg).  If in doubt use -framerate instead of the input option -r.\n\nAs an output option:\n\nvideo encoding\nDuplicate or drop frames right before encoding them to achieve constant output  frame\nrate fps.\n\nvideo streamcopy\nIndicate  to  the  muxer  that  fps  is  the stream frame rate. No data is dropped or\nduplicated in this case. This may produce invalid files if fps  does  not  match  the\nactual  stream  frame  rate as determined by packet timestamps.  See also the \"setts\"\nbitstream filter.\n"
                },
                {
                    "name": "-fpsmax[:_",
                    "content": "Set maximum frame rate (Hz value, fraction or abbreviation).\n\nClamps output frame rate when output framerate is auto-set and is higher than this value.\nUseful in batch processing or when input framerate is wrongly detected as very high.   It\ncannot be set together with \"-r\". It is ignored during streamcopy.\n"
                },
                {
                    "name": "-s[:_",
                    "content": "Set frame size.\n\nAs  an  input option, this is a shortcut for the videosize private option, recognized by\nsome demuxers for which  the  frame  size  is  either  not  stored  in  the  file  or  is\nconfigurable -- e.g. raw video or video grabbers.\n\nAs  an  output  option,  this  inserts  the  \"scale\"  video  filter  to  the  end  of the\ncorresponding filtergraph. Please use the \"scale\" filter directly to  insert  it  at  the\nbeginning or some other place.\n\nThe format is wxh (default - same as source).\n"
                },
                {
                    "name": "-aspect[:_",
                    "content": "Set the video display aspect ratio specified by aspect.\n\naspect  can be a floating point number string, or a string of the form num:den, where num\nand den are the numerator and denominator of the aspect ratio. For example \"4:3\", \"16:9\",\n\"1.3333\", and \"1.7777\" are valid argument values.\n\nIf used together with -vcodec copy, it will affect the aspect ratio stored  at  container\nlevel, but not the aspect ratio stored in encoded frames, if it exists.\n"
                },
                {
                    "name": "-display_rotation[:_",
                    "content": "Set video rotation metadata.\n\nrotation is a decimal number specifying the amount in degree by which the video should be\nrotated counter-clockwise before being displayed.\n\nThis option overrides the rotation/display transform metadata stored in the file, if any.\nWhen the video is being transcoded (rather than copied) and \"-autorotate\" is enabled, the\nvideo  will  be  rotated  at the filtering stage. Otherwise, the metadata will be written\ninto the output file if the muxer supports it.\n\nIf the \"-displayhflip\" and/or \"-displayvflip\" options are given, they are applied after\nthe rotation specified by this option.\n"
                },
                {
                    "name": "-display_hflip[:_",
                    "content": "Set whether on display the image should be horizontally flipped.\n\nSee the \"-displayrotation\" option for more details.\n"
                },
                {
                    "name": "-display_vflip[:_",
                    "content": "Set whether on display the image should be vertically flipped.\n\nSee the \"-displayrotation\" option for more details.\n"
                },
                {
                    "name": "-vn (_",
                    "content": "As an input option, blocks all video streams of a  file  from  being  filtered  or  being\nautomatically selected or mapped for any output. See \"-discard\" option to disable streams\nindividually.\n\nAs  an output option, disables video recording i.e. automatic selection or mapping of any\nvideo stream. For full manual control see the \"-map\" option.\n"
                },
                {
                    "name": "-vcodec _",
                    "content": "Set the video codec. This is an alias for \"-codec:v\".\n"
                },
                {
                    "name": "-pass[:_",
                    "content": "Select the pass number (1 or 2). It is used to do two-pass video encoding. The statistics\nof the video are recorded in the first  pass  into  a  log  file  (see  also  the  option\n-passlogfile),  and in the second pass that log file is used to generate the video at the\nexact requested bitrate.  On pass 1, you may just deactivate  audio  and  set  output  to\nnull, examples for Windows and Unix:\n\nffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y NUL\nffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y /dev/null\n"
                },
                {
                    "name": "-passlogfile[:_",
                    "content": "Set  two-pass  log  file  name  prefix  to  prefix,  the  default  file  name  prefix  is\n``ffmpeg2pass''. The complete file name  will  be  PREFIX-N.log,  where  N  is  a  number\nspecific to the output stream\n"
                },
                {
                    "name": "-vf _",
                    "content": "Create the filtergraph specified by filtergraph and use it to filter the stream.\n\nThis is an alias for \"-filter:v\", see the -filter option.\n"
                },
                {
                    "name": "-autorotate",
                    "content": "Automatically  rotate  the  video  according  to  file  metadata. Enabled by default, use\n-noautorotate to disable it.\n"
                },
                {
                    "name": "-autoscale",
                    "content": "Automatically scale the video according to the resolution of  first  frame.   Enabled  by\ndefault, use -noautoscale to disable it. When autoscale is disabled, all output frames of\nfilter  graph  might  not  be  in  the  same  resolution  and  may be inadequate for some\nencoder/muxer. Therefore, it is not recommended to disable it unless you really know what\nyou are doing.  Disable autoscale at your own risk.\n"
                },
                {
                    "name": "Advanced Video options",
                    "content": ""
                },
                {
                    "name": "-pix_fmt[:_",
                    "content": "Set pixel format. Use \"-pixfmts\" to show  all  the  supported  pixel  formats.   If  the\nselected  pixel  format  can  not be selected, ffmpeg will print a warning and select the\nbest pixel format supported by the encoder.  If pixfmt is prefixed by a \"+\", ffmpeg will\nexit with an error if the requested pixel format  can  not  be  selected,  and  automatic\nconversions inside filtergraphs are disabled.  If pixfmt is a single \"+\", ffmpeg selects\nthe  same  pixel  format  as  the  input  (or graph output) and automatic conversions are\ndisabled.\n"
                },
                {
                    "name": "-sws_flags _",
                    "content": "Set default flags for the libswscale library.  These  flags  are  used  by  automatically\ninserted  \"scale\"  filters and those within simple filtergraphs, if not overridden within\nthe filtergraph definition.\n\nSee the ffmpeg-scaler manual for a list of scaler options.\n"
                },
                {
                    "name": "-rc_override[:_",
                    "content": "Rate control override for specific intervals, formatted as \"int,int,int\"  list  separated\nwith  slashes.  Two  first  values  are  the beginning and end frame numbers, last one is\nquantizer to use if positive, or quality factor if negative.\n"
                },
                {
                    "name": "-psnr",
                    "content": "Calculate PSNR of compressed frames. This option is deprecated, pass the PSNR flag to the\nencoder instead, using \"-flags +psnr\".\n"
                },
                {
                    "name": "-vstats",
                    "content": "Dump video coding statistics to vstatsHHMMSS.log. See the vstats file format section for\nthe format description.\n"
                },
                {
                    "name": "-vstats_file _",
                    "content": "Dump video coding statistics to file. See the vstats file format section for  the  format\ndescription.\n"
                },
                {
                    "name": "-vstats_version _",
                    "content": "Specify  which  version  of  the  vstats format to use. Default is 2. See the vstats file\nformat section for the format description.\n"
                },
                {
                    "name": "-vtag _",
                    "content": "Force video tag/fourcc. This is an alias for \"-tag:v\".\n"
                },
                {
                    "name": "-vbsf _",
                    "content": "Deprecated see -bsf\n"
                },
                {
                    "name": "-force_key_frames[:_",
                    "content": ""
                },
                {
                    "name": "-force_key_frames[:_",
                    "content": ""
                },
                {
                    "name": "-force_key_frames[:_",
                    "content": "forcekeyframes can take arguments of the following form:\n\ntime[,time...]\nIf the argument consists of timestamps, ffmpeg will round the specified times to  the\nnearest  output  timestamp  as  per the encoder time base and force a keyframe at the\nfirst frame having timestamp equal or greater than the computed timestamp. Note  that\nif  the  encoder  time base is too coarse, then the keyframes may be forced on frames\nwith timestamps lower than the specified time.  The default encoder time base is  the\ninverse of the output framerate but may be set otherwise via \"-enctimebase\".\n\nIf  one  of  the  times  is  \"\"chapters\"[delta]\", it is expanded into the time of the\nbeginning of all chapters in the file, shifted by  delta,  expressed  as  a  time  in\nseconds.   This  option  can  be  useful  to ensure that a seek point is present at a\nchapter mark or any other designated place in the output file.\n\nFor example, to insert a key frame at 5 minutes, plus key frames  0.1  second  before\nthe beginning of every chapter:\n\n-forcekeyframes 0:05:00,chapters-0.1\n\nexpr:expr\nIf  the  argument  is  prefixed  with \"expr:\", the string expr is interpreted like an\nexpression and is evaluated for each frame.  A  key  frame  is  forced  in  case  the\nevaluation is non-zero.\n\nThe expression in expr can contain the following constants:\n\nn   the number of current processed frame, starting from 0\n\nnforced\nthe number of forced frames\n\nprevforcedn\nthe  number of the previous forced frame, it is \"NAN\" when no keyframe was forced\nyet\n\nprevforcedt\nthe time of the previous forced frame, it is \"NAN\" when no  keyframe  was  forced\nyet\n\nt   the time of the current processed frame\n\nFor example to force a key frame every 5 seconds, you can specify:\n\n-forcekeyframes expr:gte(t,nforced*5)\n\nTo  force  a key frame 5 seconds after the time of the last forced one, starting from\nsecond 13:\n\n-forcekeyframes expr:if(isnan(prevforcedt),gte(t,13),gte(t,prevforcedt+5))\n\nsource\nIf the argument is \"source\", ffmpeg will force a key frame if the current frame being\nencoded is marked as a key frame in its  source.   In  cases  where  this  particular\nsource  frame  has  to  be  dropped, enforce the next available frame to become a key\nframe instead.\n\nNote that forcing too many keyframes is very harmful  for  the  lookahead  algorithms  of\ncertain encoders: using fixed-GOP options or similar would be more efficient.\n"
                },
                {
                    "name": "-copyinkf[:_",
                    "content": "When doing stream copy, copy also non-key frames found at the beginning.\n"
                },
                {
                    "name": "-init_hw_device _",
                    "content": "Initialise  a  new  hardware  device  of  type  type  called name, using the given device\nparameters.  If no name is specified it will receive a default name of the form \"type%d\".\n\nThe meaning of device and the following arguments depends on the device type:\n\ncuda\ndevice is the number of the CUDA device.\n\nThe following options are recognized:\n\nprimaryctx\nIf set to 1, uses the primary device context instead of creating a new one.\n\nExamples:\n\n-inithwdevice cuda:1\nChoose the second device on the system.\n\n-inithwdevice cuda:0,primaryctx=1\nChoose the first device and use the primary device context.\n\ndxva2\ndevice is the number of the Direct3D 9 display adapter.\n\nd3d11va\ndevice is the number of the Direct3D 11 display adapter.\n\nvaapi\ndevice is either an X11 display name, a DRM render node or a DirectX  adapter  index.\nIf not specified, it will attempt to open the default X11 display ($DISPLAY) and then\nthe  first  DRM  render node (/dev/dri/renderD128), or the default DirectX adapter on\nWindows.\n\nvdpau\ndevice is an X11 display name.  If not specified, it will attempt to open the default\nX11 display ($DISPLAY).\n\nqsv device selects a value in MFXIMPL*. Allowed values are:\n\nauto\nsw\nhw\nautoany\nhwany\nhw2\nhw3\nhw4\n\nIf not specified, autoany is used.  (Note that it  may  be  easier  to  achieve  the\ndesired  result  for  QSV  by  creating  the platform-appropriate subdevice (dxva2 or\nd3d11va or vaapi) and then deriving a QSV device from that.)\n\nAlternatively, childdevicetype helps to choose platform-appropriate subdevice type.\nOn Windows d3d11va is used as default subdevice type.\n\nExamples:\n\n-inithwdevice qsv:hw,childdevicetype=d3d11va\nChoose  the  GPU  subdevice  with  type  d3d11va  and  create  QSV  device   with\nMFXIMPLHARDWARE.\n\n-inithwdevice qsv:hw,childdevicetype=dxva2\nChoose   the   GPU   subdevice  with  type  dxva2  and  create  QSV  device  with\nMFXIMPLHARDWARE.\n\nopencl\ndevice selects the platform and device as platformindex.deviceindex.\n\nThe set of devices can also be filtered  using  the  key-value  pairs  to  find  only\ndevices matching particular platform or device strings.\n\nThe strings usable as filters are:\n\nplatformprofile\nplatformversion\nplatformname\nplatformvendor\nplatformextensions\ndevicename\ndevicevendor\ndriverversion\ndeviceversion\ndeviceprofile\ndeviceextensions\ndevicetype\n\nThe indices and filters must together uniquely select a device.\n\nExamples:\n\n-inithwdevice opencl:0.1\nChoose the second device on the first platform.\n\n-inithwdevice opencl:,devicename=Foo9000\nChoose the device with a name containing the string Foo9000.\n\n-inithwdevice opencl:1,devicetype=gpu,deviceextensions=clkhrfp16\nChoose  the  GPU  device  on  the  second  platform  supporting  the  clkhrfp16\nextension.\n\nvulkan\nIf device is an integer, it selects the device by its  index  in  a  system-dependent\nlist  of  devices.  If device is any other string, it selects the first device with a\nname containing that string as a substring.\n\nThe following options are recognized:\n\ndebug\nIf set to 1, enables the validation layer, if installed.\n\nlinearimages\nIf set to 1, images allocated  by  the  hwcontext  will  be  linear  and  locally\nmappable.\n\ninstanceextensions\nA plus separated list of additional instance extensions to enable.\n\ndeviceextensions\nA plus separated list of additional device extensions to enable.\n\nExamples:\n\n-inithwdevice vulkan:1\nChoose the second device on the system.\n\n-inithwdevice vulkan:RADV\nChoose the first device with a name containing the string RADV.\n\n-inithwdevice\nvulkan:0,instanceextensions=VKKHRwaylandsurface+VKKHRxcbsurface\nChoose the first device and enable the Wayland and XCB instance extensions.\n"
                },
                {
                    "name": "-init_hw_device _",
                    "content": "Initialise  a new hardware device of type type called name, deriving it from the existing\ndevice with the name source.\n"
                },
                {
                    "name": "-init_hw_device list",
                    "content": "List all hardware device types supported in this build of ffmpeg.\n"
                },
                {
                    "name": "-filter_hw_device _",
                    "content": "Pass the hardware device called name to all filters in any filter  graph.   This  can  be\nused  to  set the device to upload to with the \"hwupload\" filter, or the device to map to\nwith the \"hwmap\" filter.  Other filters may also make use of  this  parameter  when  they\nrequire  a  hardware device.  Note that this is typically only required when the input is\nnot already in hardware frames - when it is, filters will derive the device they  require\nfrom the context of the frames they receive as input.\n\nThis is a global setting, so all filters will receive the same device.\n"
                },
                {
                    "name": "-hwaccel[:_",
                    "content": "Use hardware acceleration to decode the matching stream(s). The allowed values of hwaccel\nare:\n\nnone\nDo not use any hardware acceleration (the default).\n\nauto\nAutomatically select the hardware acceleration method.\n\nvdpau\nUse VDPAU (Video Decode and Presentation API for Unix) hardware acceleration.\n\ndxva2\nUse DXVA2 (DirectX Video Acceleration) hardware acceleration.\n\nd3d11va\nUse D3D11VA (DirectX Video Acceleration) hardware acceleration.\n\nvaapi\nUse VAAPI (Video Acceleration API) hardware acceleration.\n\nqsv Use the Intel QuickSync Video acceleration for video transcoding.\n\nUnlike  most  other values, this option does not enable accelerated decoding (that is\nused automatically whenever a qsv decoder is selected), but accelerated  transcoding,\nwithout copying the frames into the system memory.\n\nFor it to work, both the decoder and the encoder must support QSV acceleration and no\nfilters must be used.\n\nThis  option  has  no effect if the selected hwaccel is not available or not supported by\nthe chosen decoder.\n\nNote that most acceleration methods are intended for playback and will not be faster than\nsoftware decoding on modern CPUs. Additionally, ffmpeg will  usually  need  to  copy  the\ndecoded  frames  from  the  GPU  memory  into  the  system  memory,  resulting in further\nperformance loss. This option is thus mainly useful for testing.\n"
                },
                {
                    "name": "-hwaccel_device[:_",
                    "content": "Select a device to use for hardware acceleration.\n\nThis option only makes sense when the -hwaccel option is also specified.  It  can  either\nrefer  to an existing device created with -inithwdevice by name, or it can create a new\ndevice as if -inithwdevice type:hwacceldevice were called immediately before.\n"
                },
                {
                    "name": "-hwaccels",
                    "content": "List all hardware acceleration components  enabled  in  this  build  of  ffmpeg.   Actual\nruntime availability depends on the hardware and its suitable driver being installed.\n"
                },
                {
                    "name": "-fix_sub_duration_heartbeat[:_",
                    "content": "Set  a  specific  output video stream as the heartbeat stream according to which to split\nand push through currently in-progress subtitle upon receipt of a random access packet.\n\nThis lowers the latency of subtitles for which the end packet or the  following  subtitle\nhas  not  yet  been received. As a drawback, this will most likely lead to duplication of\nsubtitle events in order to cover the full duration, so when dealing with use cases where\nlatency of when the subtitle event is passed on to output is  not  relevant  this  option\nshould not be utilized.\n\nRequires  -fixsubduration  to be set for the relevant input subtitle stream for this to\nhave any effect, as well as for the input subtitle stream having to be directly mapped to\nthe same output in which the heartbeat stream resides.\n"
                },
                {
                    "name": "Audio Options",
                    "content": ""
                },
                {
                    "name": "-aframes _",
                    "content": "Set the number of audio frames to output. This is  an  obsolete  alias  for  \"-frames:a\",\nwhich you should use instead.\n"
                },
                {
                    "name": "-ar[:_",
                    "content": "Set  the  audio  sampling  frequency.  For  output  streams  it  is set by default to the\nfrequency of the corresponding input stream. For input streams  this  option  only  makes\nsense  for  audio  grabbing  devices  and raw demuxers and is mapped to the corresponding\ndemuxer options.\n"
                },
                {
                    "name": "-aq _",
                    "content": "Set the audio quality (codec-specific, VBR). This is an alias for -q:a.\n"
                },
                {
                    "name": "-ac[:_",
                    "content": "Set the number of audio channels. For output streams it is set by default to  the  number\nof  input  audio  channels.  For  input  streams  this  option only makes sense for audio\ngrabbing devices and raw demuxers and is mapped to the corresponding demuxer options.\n"
                },
                {
                    "name": "-an (_",
                    "content": "As an input option, blocks all audio streams of a  file  from  being  filtered  or  being\nautomatically selected or mapped for any output. See \"-discard\" option to disable streams\nindividually.\n\nAs  an output option, disables audio recording i.e. automatic selection or mapping of any\naudio stream. For full manual control see the \"-map\" option.\n"
                },
                {
                    "name": "-acodec _",
                    "content": "Set the audio codec. This is an alias for \"-codec:a\".\n"
                },
                {
                    "name": "-sample_fmt[:_",
                    "content": "Set the audio sample format. Use  \"-samplefmts\"  to  get  a  list  of  supported  sample\nformats.\n"
                },
                {
                    "name": "-af _",
                    "content": "Create the filtergraph specified by filtergraph and use it to filter the stream.\n\nThis is an alias for \"-filter:a\", see the -filter option.\n"
                },
                {
                    "name": "Advanced Audio options",
                    "content": ""
                },
                {
                    "name": "-atag _",
                    "content": "Force audio tag/fourcc. This is an alias for \"-tag:a\".\n"
                },
                {
                    "name": "-absf _",
                    "content": "Deprecated, see -bsf\n"
                },
                {
                    "name": "-guess_layout_max _",
                    "content": "If some input channel layout is not known, try to guess only if it corresponds to at most\nthe  specified  number of channels. For example, 2 tells to ffmpeg to recognize 1 channel\nas mono and 2 channels as stereo but not 6 channels as 5.1. The default is to always  try\nto guess. Use 0 to disable all guessing.\n"
                },
                {
                    "name": "Subtitle options",
                    "content": ""
                },
                {
                    "name": "-scodec _",
                    "content": "Set the subtitle codec. This is an alias for \"-codec:s\".\n"
                },
                {
                    "name": "-sn (_",
                    "content": "As  an  input  option, blocks all subtitle streams of a file from being filtered or being\nautomatically selected or mapped for any output. See \"-discard\" option to disable streams\nindividually.\n\nAs an output option, disables subtitle recording i.e. automatic selection or  mapping  of\nany subtitle stream. For full manual control see the \"-map\" option.\n"
                },
                {
                    "name": "-sbsf _",
                    "content": "Deprecated, see -bsf\n"
                },
                {
                    "name": "Advanced Subtitle options",
                    "content": ""
                },
                {
                    "name": "-fix_sub_duration",
                    "content": "Fix  subtitles  durations. For each subtitle, wait for the next packet in the same stream\nand adjust the duration of the first to  avoid  overlap.  This  is  necessary  with  some\nsubtitles  codecs,  especially DVB subtitles, because the duration in the original packet\nis only a rough estimate and the end is actually  marked  by  an  empty  subtitle  frame.\nFailing  to  use this option when necessary can result in exaggerated durations or muxing\nfailures due to non-monotonic timestamps.\n\nNote that this option will delay the output of all data until the next subtitle packet is\ndecoded: it may increase memory consumption and latency a lot.\n"
                },
                {
                    "name": "-canvas_size _",
                    "content": "Set the size of the canvas used to render subtitles.\n"
                },
                {
                    "name": "Advanced options",
                    "content": ""
                },
                {
                    "name": "-map [-]_",
                    "content": "Create one or more streams in the output file. This option has two forms  for  specifying\nthe data source(s): the first selects one or more streams from some input file (specified\nwith  \"-i\"),  the  second  takes  an output from some complex filtergraph (specified with\n\"-filtercomplex\" or \"-filtercomplexscript\").\n\nIn the first form, an output stream is created for every stream from the input file  with\nthe  index inputfileid. If streamspecifier is given, only those streams that match the\nspecifier are used (see the Stream specifiers section for the streamspecifier syntax).\n\nA \"-\" character before the stream identifier creates a \"negative\" mapping.   It  disables\nmatching streams from already created mappings.\n\nA  trailing  \"?\"  after  the  stream  index will allow the map to be optional: if the map\nmatches no streams the map will be ignored instead of failing. Note the  map  will  still\nfail  if an invalid input file index is used; such as if the map refers to a non-existent\ninput.\n\nAn alternative [linklabel] form will map outputs from  complex  filter  graphs  (see  the\n-filtercomplex  option)  to  the  output  file.   linklabel must correspond to a defined\noutput link label in the graph.\n\nThis option may be specified multiple times, each adding more streams to the output file.\nAny given input stream may also be mapped any number of times as a source  for  different\noutput  streams,  e.g.  in  order  to  use different encoding options and/or filters. The\nstreams are created in the output in the same order in which the \"-map\" options are given\non the commandline.\n\nUsing this option disables the default mappings for this output file.\n\nExamples:\n\nmap everything\nTo map ALL streams from the first input file to output\n\nffmpeg -i INPUT -map 0 output\n\nselect specific stream\nIf you have two audio streams in the first input file, these streams  are  identified\nby  0:0  and  0:1.  You  can use \"-map\" to select which streams to place in an output\nfile. For example:\n\nffmpeg -i INPUT -map 0:1 out.wav\n\nwill map the second input stream in INPUT to the (single) output stream in out.wav.\n\ncreate multiple streams\nTo select the stream with index 2 from input file a.mov (specified by the  identifier\n0:2), and stream with index 6 from input b.mov (specified by the identifier 1:6), and\ncopy them to the output file out.mov:\n\nffmpeg -i a.mov -i b.mov -c copy -map 0:2 -map 1:6 out.mov\n\ncreate multiple streams 2\nTo select all video and the third audio stream from an input file:\n\nffmpeg -i INPUT -map 0:v -map 0:a:2 OUTPUT\n\nnegative map\nTo map all the streams except the second audio, use negative mappings\n\nffmpeg -i INPUT -map 0 -map -0:a:1 OUTPUT\n\noptional map\nTo  map the video and audio streams from the first input, and using the trailing \"?\",\nignore the audio mapping if no audio streams exist in the first input:\n\nffmpeg -i INPUT -map 0:v -map 0:a? OUTPUT\n\nmap by language\nTo pick the English audio stream:\n\nffmpeg -i INPUT -map 0:m:language:eng OUTPUT\n"
                },
                {
                    "name": "-ignore_unknown",
                    "content": "Ignore input streams with unknown type instead of failing  if  copying  such  streams  is\nattempted.\n"
                },
                {
                    "name": "-copy_unknown",
                    "content": "Allow  input  streams  with  unknown type to be copied instead of failing if copying such\nstreams is attempted.\n"
                },
                {
                    "name": "-map_channel",
                    "content": "[inputfileid.streamspecifier.channelid|-1][?][:outputfileid.streamspecifier]\nThis option is deprecated and will be removed. It can be replaced by the pan  filter.  In\nsome  cases  it may be easier to use some combination of the channelsplit, channelmap, or\namerge filters.\n\nMap an audio channel from a given input to an output. If  outputfileid.streamspecifier\nis not set, the audio channel will be mapped on all the audio streams.\n\nUsing \"-1\" instead of inputfileid.streamspecifier.channelid will map a muted channel.\n\nA  trailing  \"?\" will allow the mapchannel to be optional: if the mapchannel matches no\nchannel the mapchannel will be ignored instead of failing.\n\nFor example, assuming INPUT is a stereo audio file, you can switch the two audio channels\nwith the following command:\n\nffmpeg -i INPUT -mapchannel 0.0.1 -mapchannel 0.0.0 OUTPUT\n\nIf you want to mute the first channel and keep the second:\n\nffmpeg -i INPUT -mapchannel -1 -mapchannel 0.0.1 OUTPUT\n\nThe order of the \"-mapchannel\" option specifies the order of the channels in the  output\nstream.  The output channel layout is guessed from the number of channels mapped (mono if\none \"-mapchannel\", stereo if two, etc.). Using \"-ac\" in  combination  of  \"-mapchannel\"\nmakes  the  channel  gain  levels to be updated if input and output channel layouts don't\nmatch (for instance two \"-mapchannel\" options and \"-ac 6\").\n\nYou can also extract each channel of an input to specific outputs; the following  command\nextracts  two  channels  of  the  INPUT audio stream (file 0, stream 0) to the respective\nOUTPUTCH0 and OUTPUTCH1 outputs:\n\nffmpeg -i INPUT -mapchannel 0.0.0 OUTPUTCH0 -mapchannel 0.0.1 OUTPUTCH1\n\nThe following example splits the channels of a stereo input into  two  separate  streams,\nwhich are put into the same output file:\n\nffmpeg -i stereo.wav -map 0:0 -map 0:0 -mapchannel 0.0.0:0.0 -mapchannel 0.0.1:0.1 -y out.ogg\n\nNote  that  currently  each  output  stream can only contain channels from a single input\nstream; you can't for example use \"-mapchannel\" to pick multiple  input  audio  channels\ncontained  in  different streams (from the same or different files) and merge them into a\nsingle output stream. It is therefore not currently possible, for example,  to  turn  two\nseparate mono streams into a single stereo stream. However splitting a stereo stream into\ntwo single channel mono streams is possible.\n\nIf you need this feature, a possible workaround is to use the amerge filter. For example,\nif  you  need to merge a media (here input.mkv) with 2 mono audio streams into one single\nstereo channel audio stream (and keep the  video  stream),  you  can  use  the  following\ncommand:\n\nffmpeg -i input.mkv -filtercomplex \"[0:1] [0:2] amerge\" -c:a pcms16le -c:v copy output.mkv\n\nTo  map  the  first  two audio channels from the first input, and using the trailing \"?\",\nignore the audio channel mapping if the first input is mono instead of stereo:\n\nffmpeg -i INPUT -mapchannel 0.0.0 -mapchannel 0.0.1? OUTPUT\n"
                },
                {
                    "name": "-map_metadata[:_",
                    "content": "Set metadata information of the next output file from infile. Note that  those  are  file\nindices  (zero-based),  not filenames.  Optional metadataspecin/out parameters specify,\nwhich metadata to copy.  A metadata specifier can have the following forms:\n\ng   global metadata, i.e. metadata that applies to the whole file\n\ns[:streamspec]\nper-stream metadata. streamspec is a stream specifier as  described  in  the  Stream\nspecifiers  chapter.  In  an  input  metadata specifier, the first matching stream is\ncopied from. In an output metadata specifier, all matching streams are copied to.\n\nc:chapterindex\nper-chapter metadata. chapterindex is the zero-based chapter index.\n\np:programindex\nper-program metadata. programindex is the zero-based program index.\n\nIf metadata specifier is omitted, it defaults to global.\n\nBy default, global metadata is copied from the first  input  file,  per-stream  and  per-\nchapter  metadata  is  copied  along  with  streams/chapters.  These default mappings are\ndisabled by creating any mapping of the relevant type. A negative file index can be  used\nto create a dummy mapping that just disables automatic copying.\n\nFor  example  to copy metadata from the first stream of the input file to global metadata\nof the output file:\n\nffmpeg -i in.ogg -mapmetadata 0:s:0 out.mp3\n\nTo do the reverse, i.e. copy global metadata to all audio streams:\n\nffmpeg -i in.mkv -mapmetadata:s:a 0:g out.mkv\n\nNote that simple 0 would work as well in this example, since global metadata  is  assumed\nby default.\n"
                },
                {
                    "name": "-map_chapters _",
                    "content": "Copy  chapters from input file with index inputfileindex to the next output file. If no\nchapter mapping is specified, then chapters are copied from the first input file with  at\nleast one chapter. Use a negative file index to disable any chapter copying.\n"
                },
                {
                    "name": "-benchmark (_",
                    "content": "Show  benchmarking information at the end of an encode.  Shows real, system and user time\nused and maximum memory consumption.  Maximum memory consumption is not supported on  all\nsystems, it will usually display as 0 if not supported.\n"
                },
                {
                    "name": "-benchmark_all (_",
                    "content": "Show  benchmarking  information during the encode.  Shows real, system and user time used\nin various steps (audio/video encode/decode).\n"
                },
                {
                    "name": "-timelimit _",
                    "content": "Exit after ffmpeg has been running for duration seconds in CPU user time.\n"
                },
                {
                    "name": "-dump (_",
                    "content": "Dump each input packet to stderr.\n"
                },
                {
                    "name": "-hex (_",
                    "content": "When dumping packets, also dump the payload.\n"
                },
                {
                    "name": "-readrate _",
                    "content": "Limit input read speed.\n\nIts value is a floating-point positive number which represents the  maximum  duration  of\nmedia,  in  seconds,  that  should  be ingested in one second of wallclock time.  Default\nvalue is zero and represents no imposed  limitation  on  speed  of  ingestion.   Value  1\nrepresents real-time speed and is equivalent to \"-re\".\n\nMainly  used  to simulate a capture device or live input stream (e.g. when reading from a\nfile).  Should not be used with a low value when input is an  actual  capture  device  or\nlive stream as it may cause packet loss.\n\nIt is useful for when flow speed of output packets is important, such as live streaming.\n"
                },
                {
                    "name": "-re (_",
                    "content": "Read input at native frame rate. This is equivalent to setting \"-readrate 1\".\n"
                },
                {
                    "name": "-readrate_initial_burst _",
                    "content": "Set an initial read burst time, in seconds, after which -re/-readrate will be enforced.\n"
                },
                {
                    "name": "-vsync _",
                    "content": ""
                },
                {
                    "name": "-fps_mode[:_",
                    "content": "Set  video sync method / framerate mode. vsync is applied to all output video streams but\ncan be overridden for a stream by setting fpsmode.  vsync  is  deprecated  and  will  be\nremoved in the future.\n\nFor compatibility reasons some of the values for vsync can be specified as numbers (shown\nin parentheses in the following table).\n\npassthrough (0)\nEach frame is passed with its timestamp from the demuxer to the muxer.\n\ncfr (1)\nFrames will be duplicated and dropped to achieve exactly the requested constant frame\nrate.\n\nvfr (2)\nFrames  are  passed through with their timestamp or dropped so as to prevent 2 frames\nfrom having the same timestamp.\n\ndrop\nAs  passthrough  but  destroys  all  timestamps,  making  the  muxer  generate  fresh\ntimestamps based on frame-rate.\n\nauto (-1)\nChooses  between  cfr  and  vfr  depending on muxer capabilities. This is the default\nmethod.\n\nNote that the timestamps may be further modified by the muxer, after this.  For  example,\nin the case that the format option avoidnegativets is enabled.\n\nWith  -map you can select from which stream the timestamps should be taken. You can leave\neither video or audio unchanged and sync the remaining stream(s) to the unchanged one.\n"
                },
                {
                    "name": "-frame_drop_threshold _",
                    "content": "Frame drop threshold, which specifies how much behind video frames can be before they are\ndropped. In frame rate units, so 1.0 is one frame.  The default  is  -1.1.  One  possible\nusecase  is  to  avoid  framedrops  in case of noisy timestamps or to increase frame drop\nprecision in case of exact timestamps.\n"
                },
                {
                    "name": "-apad _",
                    "content": "Pad the output audio stream(s). This is the same as applying \"-af apad\".  Argument  is  a\nstring  of  filter  parameters  composed the same as with the \"apad\" filter.  \"-shortest\"\nmust be set for this output for the option to take effect.\n"
                },
                {
                    "name": "-copyts",
                    "content": "Do not process input timestamps, but keep their values without trying to  sanitize  them.\nIn particular, do not remove the initial start time offset value.\n\nNote  that,  depending  on the vsync option or on specific muxer processing (e.g. in case\nthe format option avoidnegativets is enabled) the output timestamps may  mismatch  with\nthe input timestamps even when this option is selected.\n"
                },
                {
                    "name": "-start_at_zero",
                    "content": "When used with copyts, shift input timestamps so they start at zero.\n\nThis  means  that  using  e.g.  \"-ss 50\" will make output timestamps start at 50 seconds,\nregardless of what timestamp the input file started at.\n"
                },
                {
                    "name": "-copytb _",
                    "content": "Specify how to set the encoder timebase when stream copying.  mode is an integer  numeric\nvalue, and can assume one of the following values:\n\n1   Use the demuxer timebase.\n\nThe  time  base is copied to the output encoder from the corresponding input demuxer.\nThis is sometimes required to avoid  non  monotonically  increasing  timestamps  when\ncopying video streams with variable frame rate.\n\n0   Use the decoder timebase.\n\nThe time base is copied to the output encoder from the corresponding input decoder.\n\n-1  Try to make the choice automatically, in order to generate a sane output.\n\nDefault value is -1.\n"
                },
                {
                    "name": "-enc_time_base[:_",
                    "content": "Set the encoder timebase. timebase can assume one of the following values:\n\n0   Assign a default value according to the media type.\n\nFor video - use 1/framerate, for audio - use 1/samplerate.\n\ndemux\nUse the timebase from the demuxer.\n\nfilter\nUse the timebase from the filtergraph.\n\na positive number\nUse the provided number as the timebase.\n\nThis  field  can  be provided as a ratio of two integers (e.g. 1:24, 1:48000) or as a\ndecimal number (e.g. 0.04166, 2.0833e-5)\n\nDefault value is 0.\n"
                },
                {
                    "name": "-bitexact (_",
                    "content": "Enable bitexact mode for (de)muxer and (de/en)coder\n"
                },
                {
                    "name": "-shortest (_",
                    "content": "Finish encoding when the shortest output stream ends.\n\nNote that this option may require buffering frames, which introduces extra  latency.  The\nmaximum  amount  of  this  latency  may  be  controlled with the \"-shortestbufduration\"\noption.\n"
                },
                {
                    "name": "-shortest_buf_duration _",
                    "content": "The \"-shortest\" option may require buffering potentially large amounts of  data  when  at\nleast  one  of  the  streams  is  \"sparse\"  (i.e. has large gaps between frames – this is\ntypically the case for subtitles).\n\nThis option controls the maximum duration of buffered frames in seconds.   Larger  values\nmay  allow  the  \"-shortest\" option to produce more accurate results, but increase memory\nuse and latency.\n\nThe default value is 10 seconds.\n"
                },
                {
                    "name": "-dts_delta_threshold _",
                    "content": "Timestamp discontinuity delta threshold, expressed as a decimal number of seconds.\n\nThe timestamp discontinuity correction enabled by this option is only  applied  to  input\nformats  accepting  timestamp  discontinuity  (for  which  the  \"AVFMTDISCONT\"  flag is\nenabled), e.g. MPEG-TS  and  HLS,  and  is  automatically  disabled  when  employing  the\n\"-copyts\" option (unless wrapping is detected).\n\nIf  a timestamp discontinuity is detected whose absolute value is greater than threshold,\nffmpeg will remove the discontinuity by decreasing/increasing the current DTS and PTS  by\nthe corresponding delta value.\n\nThe default value is 10.\n"
                },
                {
                    "name": "-dts_error_threshold _",
                    "content": "Timestamp error delta threshold, expressed as a decimal number of seconds.\n\nThe  timestamp  correction  enabled  by  this option is only applied to input formats not\naccepting timestamp discontinuity (for which the \"AVFMTDISCONT\" flag is not enabled).\n\nIf a timestamp discontinuity is detected whose absolute value is greater than  threshold,\nffmpeg will drop the PTS/DTS timestamp value.\n\nThe  default  value  is  \"3600*30\"  (30  hours),  which  is  arbitrarily picked and quite\nconservative.\n"
                },
                {
                    "name": "-muxdelay _",
                    "content": "Set the maximum demux-decode delay.\n"
                },
                {
                    "name": "-muxpreload _",
                    "content": "Set the initial demux-decode delay.\n"
                },
                {
                    "name": "-streamid _",
                    "content": "Assign a new stream-id value to an output stream. This option should be  specified  prior\nto  the  output  filename  to  which it applies.  For the situation where multiple output\nfiles exist, a streamid may be reassigned to a different value.\n\nFor example, to set the stream 0 PID to 33 and the stream 1  PID  to  36  for  an  output\nmpegts file:\n\nffmpeg -i inurl -streamid 0:33 -streamid 1:36 out.ts\n"
                },
                {
                    "name": "-bsf[:_",
                    "content": "Set  bitstream  filters for matching streams. bitstreamfilters is a comma-separated list\nof bitstream filters. Use the \"-bsfs\" option to get the list of bitstream filters.\n\nffmpeg -i h264.mp4 -c:v copy -bsf:v h264mp4toannexb -an out.h264\n\n\nffmpeg -i file.mov -an -vn -bsf:s mov2textsub -c:s copy -f rawvideo sub.txt\n"
                },
                {
                    "name": "-tag[:_",
                    "content": "Force a tag/fourcc for matching streams.\n"
                },
                {
                    "name": "-timecode _",
                    "content": "Specify Timecode for writing. SEP is ':' for non drop timecode and ';' (or '.') for drop.\n\nffmpeg -i input.mpg -timecode 01:02:03.04 -r 30000/1001 -s ntsc output.mpg\n"
                },
                {
                    "name": "-filter_complex _",
                    "content": "Define a complex filtergraph, i.e. one with arbitrary number of  inputs  and/or  outputs.\nFor  simple  graphs  --  those  with one input and one output of the same type -- see the\n-filter options. filtergraph is a description of the filtergraph,  as  described  in  the\n``Filtergraph syntax'' section of the ffmpeg-filters manual.\n\nInput  link  labels must refer to input streams using the \"[fileindex:streamspecifier]\"\nsyntax (i.e. the same as -map uses). If streamspecifier matches  multiple  streams,  the\nfirst  one  will  be used. An unlabeled input will be connected to the first unused input\nstream of the matching type.\n\nOutput link labels are referred to with -map. Unlabeled outputs are added  to  the  first\noutput file.\n\nNote  that with this option it is possible to use only lavfi sources without normal input\nfiles.\n\nFor example, to overlay an image over video\n\nffmpeg -i video.mkv -i image.png -filtercomplex '[0:v][1:v]overlay[out]' -map\n'[out]' out.mkv\n\nHere \"[0:v]\" refers to the first video stream in the first input file, which is linked to\nthe first (main) input of the overlay filter. Similarly the first  video  stream  in  the\nsecond input is linked to the second (overlay) input of overlay.\n\nAssuming  there is only one video stream in each input file, we can omit input labels, so\nthe above is equivalent to\n\nffmpeg -i video.mkv -i image.png -filtercomplex 'overlay[out]' -map\n'[out]' out.mkv\n\nFurthermore we can omit the output label and the single output from the filter graph will\nbe added to the output file automatically, so we can simply write\n\nffmpeg -i video.mkv -i image.png -filtercomplex 'overlay' out.mkv\n\nAs a special exception, you can use a  bitmap  subtitle  stream  as  input:  it  will  be\nconverted into a video with the same size as the largest video in the file, or 720x576 if\nno video is present. Note that this is an experimental and temporary solution. It will be\nremoved once libavfilter has proper support for subtitles.\n\nFor  example, to hardcode subtitles on top of a DVB-T recording stored in MPEG-TS format,\ndelaying the subtitles by 1 second:\n\nffmpeg -i input.ts -filtercomplex \\\n'[#0x2ef] setpts=PTS+1/TB [sub] ; [#0x2d0] [sub] overlay' \\\n-sn -map '#0x2dc' output.mkv\n\n(0x2d0, 0x2dc and 0x2ef are the  MPEG-TS  PIDs  of  respectively  the  video,  audio  and\nsubtitles streams; 0:0, 0:3 and 0:7 would have worked too)\n\nTo generate 5 seconds of pure red video using lavfi \"color\" source:\n\nffmpeg -filtercomplex 'color=c=red' -t 5 out.mkv\n"
                },
                {
                    "name": "-filter_complex_threads _",
                    "content": "Defines  how  many  threads  are  used  to  process  a  filtercomplex graph.  Similar to\nfilterthreads but used for \"-filtercomplex\" graphs only.  The default is the number  of\navailable CPUs.\n"
                },
                {
                    "name": "-lavfi _",
                    "content": "Define  a  complex  filtergraph, i.e. one with arbitrary number of inputs and/or outputs.\nEquivalent to -filtercomplex.\n"
                },
                {
                    "name": "-filter_complex_script _",
                    "content": "This option is similar to -filtercomplex, the only difference is that  its  argument  is\nthe name of the file from which a complex filtergraph description is to be read.\n"
                },
                {
                    "name": "-accurate_seek (_",
                    "content": "This  option  enables or disables accurate seeking in input files with the -ss option. It\nis enabled by default, so seeking is accurate when transcoding. Use  -noaccurateseek  to\ndisable  it,  which  may  be  useful  e.g.  when copying some streams and transcoding the\nothers.\n"
                },
                {
                    "name": "-seek_timestamp (_",
                    "content": "This option enables or disables seeking by timestamp in input files with the -ss  option.\nIt  is  disabled  by default. If enabled, the argument to the -ss option is considered an\nactual timestamp, and is not offset by the start time of the file. This matters only  for\nfiles which do not start from timestamp 0, such as transport streams.\n"
                },
                {
                    "name": "-thread_queue_size _",
                    "content": "For  input,  this  option sets the maximum number of queued packets when reading from the\nfile or device. With low latency / high rate live streams, packets may  be  discarded  if\nthey  are  not  read  in  a  timely  manner; setting this value can force ffmpeg to use a\nseparate input thread and read packets as soon as they arrive.  By  default  ffmpeg  only\ndoes this if multiple inputs are specified.\n\nFor  output,  this  option  specified the maximum number of packets that may be queued to\neach muxing thread.\n"
                },
                {
                    "name": "-sdp_file _",
                    "content": "Print sdp information for an output stream to file.  This allows dumping sdp  information\nwhen  at  least  one  output  isn't  an  rtp stream. (Requires at least one of the output\nformats to be rtp).\n"
                },
                {
                    "name": "-discard (_",
                    "content": "Allows discarding specific streams or frames from streams.  Any input stream can be fully\ndiscarded, using value \"all\" whereas selective discarding of frames from a stream  occurs\nat the demuxer and is not supported by all demuxers.\n\nnone\nDiscard no frame.\n\ndefault\nDefault, which discards no frames.\n\nnoref\nDiscard all non-reference frames.\n\nbidir\nDiscard all bidirectional frames.\n\nnokey\nDiscard all frames excepts keyframes.\n\nall Discard all frames.\n"
                },
                {
                    "name": "-abort_on _",
                    "content": "Stop and abort on various conditions. The following flags are available:\n\nemptyoutput\nNo packets were passed to the muxer, the output is empty.\n\nemptyoutputstream\nNo packets were passed to the muxer in some of the output streams.\n"
                },
                {
                    "name": "-max_error_rate (_",
                    "content": "Set  fraction of decoding frame failures across all inputs which when crossed ffmpeg will\nreturn exit code 69. Crossing this threshold does not terminate processing.  Range  is  a\nfloating-point number between 0 to 1. Default is 2/3.\n"
                },
                {
                    "name": "-xerror (_",
                    "content": "Stop and exit on error\n"
                },
                {
                    "name": "-max_muxing_queue_size _",
                    "content": "When  transcoding  audio  and/or  video  streams,  ffmpeg will not begin writing into the\noutput until it has one packet for each such stream. While waiting for  that  to  happen,\npackets  for  other  streams  are  buffered. This option sets the size of this buffer, in\npackets, for the matching output stream.\n\nThe default value of this option should be high enough for most uses, so only touch  this\noption if you are sure that you need it.\n"
                },
                {
                    "name": "-muxing_queue_data_threshold _",
                    "content": "This  is a minimum threshold until which the muxing queue size is not taken into account.\nDefaults to 50 megabytes per stream, and is based on the overall size of  packets  passed\nto the muxer.\n"
                },
                {
                    "name": "-auto_conversion_filters (_",
                    "content": "Enable  automatically inserting format conversion filters in all filter graphs, including\nthose defined by -vf, -af, -filtercomplex  and  -lavfi.  If  filter  format  negotiation\nrequires  a  conversion,  the  initialization  of the filters will fail.  Conversions can\nstill be performed by inserting the relevant conversion filter (scale, aresample) in  the\ngraph.    On   by   default,   to   explicitly   disable   it   you   need   to   specify\n\"-noautoconversionfilters\".\n"
                },
                {
                    "name": "-bits_per_raw_sample[:_",
                    "content": "Declare the number of bits per raw sample in the given output stream to  be  value.  Note\nthat  this  option sets the information provided to the encoder/muxer, it does not change\nthe stream to conform to this  value.  Setting  values  that  do  not  match  the  stream\nproperties may result in encoding failures or invalid output files.\n"
                },
                {
                    "name": "-stats_enc_pre[:_",
                    "content": ""
                },
                {
                    "name": "-stats_enc_post[:_",
                    "content": ""
                },
                {
                    "name": "-stats_mux_pre[:_",
                    "content": "Write  per-frame  encoding  information about the matching streams into the file given by\npath.\n\n-statsencpre writes information about raw video or audio frames right before  they  are\nsent for encoding, while -statsencpost writes information about encoded packets as they\nare  received  from the encoder.  -statsmuxpre writes information about packets just as\nthey are about to be sent to the muxer. Every frame or packet produces one  line  in  the\nspecified   file.  The  format  of  this  line  is  controlled  by  -statsencprefmt  /\n-statsencpostfmt / -statsmuxprefmt.\n\nWhen stats for multiple streams are written into a single file, the  lines  corresponding\nto  different  streams will be interleaved. The precise order of this interleaving is not\nspecified and not guaranteed to  remain  stable  between  different  invocations  of  the\nprogram, even with the same options.\n"
                },
                {
                    "name": "-stats_enc_pre_fmt[:_",
                    "content": ""
                },
                {
                    "name": "-stats_enc_post_fmt[:_",
                    "content": ""
                },
                {
                    "name": "-stats_mux_pre_fmt[:_",
                    "content": "Specify  the  format  for  the  lines  written  with  -statsencpre  / -statsencpost /\n-statsmuxpre.\n\nformatspec is a string that may contain directives of the  form  {fmt}.  formatspec  is\nbackslash-escaped  ---  use  \\{,  \\}, and \\\\ to write a literal {, }, or \\, respectively,\ninto the output.\n\nThe directives given with fmt may be one of the following:\n\nfidx\nIndex of the output file.\n\nsidx\nIndex of the output stream in the file.\n\nn   Frame number. Pre-encoding: number of frames sent  to  the  encoder  so  far.   Post-\nencoding:  number  of  packets  received  from the encoder so far.  Muxing: number of\npackets submitted to the muxer for this stream so far.\n\nni  Input frame number. Index of  the  input  frame  (i.e.  output  by  a  decoder)  that\ncorresponds to this output frame or packet. -1 if unavailable.\n\ntb  Timebase  in which this frame/packet's timestamps are expressed, as a rational number\nnum/den. Note that encoder and muxer may use different timebases.\n\ntbi Timebase for ptsi, as a rational number num/den. Available when  ptsi  is  available,\n0/1 otherwise.\n\npts Presentation timestamp of the frame or packet, as an integer. Should be multiplied by\nthe timebase to compute presentation time.\n\nptsi\nPresentation  timestamp  of  the  input  frame  (see  ni),  as  an integer. Should be\nmultiplied  by  tbi  to  compute  presentation  time.  Printed  as  (2^63   -   1   =\n9223372036854775807) when not available.\n\nt   Presentation  time  of  the  frame  or  packet,  as  a  decimal  number. Equal to pts\nmultiplied by tb.\n\nti  Presentation time of the input frame (see ni), as a decimal  number.  Equal  to  ptsi\nmultiplied by tbi. Printed as inf when not available.\n\ndts (packet)\nDecoding timestamp of the packet, as an integer. Should be multiplied by the timebase\nto compute presentation time.\n\ndt (packet)\nDecoding time of the frame or packet, as a decimal number. Equal to dts multiplied by\ntb.\n\nsn (frame,audio)\nNumber of audio samples sent to the encoder so far.\n\nsamp (frame,audio)\nNumber of audio samples in the frame.\n\nsize (packet)\nSize of the encoded packet in bytes.\n\nbr (packet)\nCurrent bitrate in bits per second. Post-encoding only.\n\nabr (packet)\nAverage  bitrate  for the whole stream so far, in bits per second, -1 if it cannot be\ndetermined at this point. Post-encoding only.\n\nDirectives  tagged  with  packet  may  only  be   used   with   -statsencpostfmt   and\n-statsmuxprefmt.\n\nDirectives tagged with frame may only be used with -statsencprefmt.\n\nDirectives tagged with audio may only be used with audio streams.\n\nThe default format strings are:\n\npre-encoding\n{fidx} {sidx} {n} {t}\n\npost-encoding\n{fidx} {sidx} {n} {t}\n\nIn the future, new items may be added to the end of the default formatting strings. Users\nwho depend on the format staying exactly the same, should prescribe it manually.\n\nNote  that  stats  for  different  streams  written into the same file may have different\nformats.\n"
                },
                {
                    "name": "Preset files",
                    "content": "A preset file contains a sequence of option=value pairs, one  for  each  line,  specifying  a\nsequence  of  options  which  would be awkward to specify on the command line. Lines starting\nwith the hash ('#') character are ignored and are used to provide comments. Check the presets\ndirectory in the FFmpeg source tree for examples.\n\nThere are two types of preset files: ffpreset and avpreset files.\n\nffpreset files\n\nffpreset files are specified with the \"vpre\", \"apre\", \"spre\", and \"fpre\" options. The  \"fpre\"\noption takes the filename of the preset instead of a preset name as input and can be used for\nany  kind  of  codec.  For the \"vpre\", \"apre\", and \"spre\" options, the options specified in a\npreset file are applied to the currently selected codec  of  the  same  type  as  the  preset\noption.\n\nThe  argument  passed  to the \"vpre\", \"apre\", and \"spre\" preset options identifies the preset\nfile to use according to the following rules:\n\nFirst ffmpeg searches for a file named arg.ffpreset in the  directories  $FFMPEGDATADIR  (if\nset),  and  $HOME/.ffmpeg,  and  in  the  datadir  defined  at  configuration  time  (usually\nPREFIX/share/ffmpeg) or in a ffpresets folder along the executable on win32, in  that  order.\nFor   example,   if   the   argument   is   \"libvpx-1080p\",  it  will  search  for  the  file\nlibvpx-1080p.ffpreset.\n\nIf no such file is found, then ffmpeg will search for a file named codecname-arg.ffpreset in\nthe above-mentioned directories, where codecname is the name  of  the  codec  to  which  the\npreset file options will be applied. For example, if you select the video codec with \"-vcodec\nlibvpx\" and use \"-vpre 1080p\", then it will search for the file libvpx-1080p.ffpreset.\n\navpreset files\n\navpreset  files are specified with the \"pre\" option. They work similar to ffpreset files, but\nthey only allow encoder- specific options. Therefore,  an  option=value  pair  specifying  an\nencoder cannot be used.\n\nWhen  the  \"pre\" option is specified, ffmpeg will look for files with the suffix .avpreset in\nthe directories $AVCONVDATADIR (if set), and $HOME/.avconv, and in the  datadir  defined  at\nconfiguration time (usually PREFIX/share/ffmpeg), in that order.\n\nFirst  ffmpeg  searches  for  a  file  named  codecname-arg.avpreset  in the above-mentioned\ndirectories, where codecname is the name of the codec to which the preset file options  will\nbe  applied.  For  example, if you select the video codec with \"-vcodec libvpx\" and use \"-pre\n1080p\", then it will search for the file libvpx-1080p.avpreset.\n\nIf no such file is found, then ffmpeg will search for a file named arg.avpreset in  the  same\ndirectories.\n"
                },
                {
                    "name": "vstats file format",
                    "content": "The  \"-vstats\"  and  \"-vstatsfile\" options enable generation of a file containing statistics\nabout the generated video outputs.\n\nThe \"-vstatsversion\" option controls the format version of the generated file.\n\nWith version 1 the format is:\n\nframe= <FRAME> q= <FRAMEQUALITY> PSNR= <PSNR> fsize= <FRAMESIZE> ssize= <STREAMSIZE>kB time= <TIMESTAMP> br= <BITRATE>kbits/s avgbr= <AVERAGEBITRATE>kbits/s\n\nWith version 2 the format is:\n\nout= <OUTFILEINDEX> st= <OUTFILESTREAMINDEX> frame= <FRAMENUMBER> q= <FRAMEQUALITY>f PSNR= <PSNR> fsize= <FRAMESIZE> ssize= <STREAMSIZE>kB time= <TIMESTAMP> br= <BITRATE>kbits/s avgbr= <AVERAGEBITRATE>kbits/s\n\nThe value corresponding to each key is described below:\n"
                },
                {
                    "name": "avg_br",
                    "content": "average bitrate expressed in Kbits/s\n\nbr  bitrate expressed in Kbits/s\n"
                },
                {
                    "name": "frame",
                    "content": "number of encoded frame\n\nout out file index\n\nPSNR\nPeak Signal to Noise Ratio\n\nq   quality of the frame\n"
                },
                {
                    "name": "f_size",
                    "content": "encoded packet size expressed as number of bytes\n"
                },
                {
                    "name": "s_size",
                    "content": "stream size expressed in KiB\n\nst  out file stream index\n"
                },
                {
                    "name": "time",
                    "content": "time of the packet\n"
                },
                {
                    "name": "type",
                    "content": "picture type\n\nSee also the -statsenc options for an alternative way to show encoding statistics.\n"
                }
            ]
        },
        "EXAMPLES": {
            "content": "",
            "subsections": [
                {
                    "name": "Video and Audio grabbing",
                    "content": "If you specify the input format and device then ffmpeg can grab video and audio directly.\n\nffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 /tmp/out.mpg\n\nOr with an ALSA audio source (mono input, card id 1) instead of OSS:\n\nffmpeg -f alsa -ac 1 -i hw:1 -f video4linux2 -i /dev/video0 /tmp/out.mpg\n\nNote that you must activate the right video source and channel before launching  ffmpeg  with\nany  TV  viewer such as <http://linux.bytesex.org/xawtv/> by Gerd Knorr. You also have to set\nthe audio recording levels correctly with a standard mixer.\n"
                },
                {
                    "name": "X11 grabbing",
                    "content": "Grab the X11 display with ffmpeg via\n\nffmpeg -f x11grab -videosize cif -framerate 25 -i :0.0 /tmp/out.mpg\n\n0.0 is display.screen number of your X11 server, same as the DISPLAY environment variable.\n\nffmpeg -f x11grab -videosize cif -framerate 25 -i :0.0+10,20 /tmp/out.mpg\n\n0.0 is display.screen number of your X11 server, same as the DISPLAY environment variable. 10\nis the x-offset and 20 the y-offset for the grabbing.\n"
                },
                {
                    "name": "Video and Audio file format conversion",
                    "content": "Any supported file format and protocol can serve as input to ffmpeg:\n\nExamples:\n\n•   You can use YUV files as input:\n\nffmpeg -i /tmp/test%d.Y /tmp/out.mpg\n\nIt will use the files:\n\n/tmp/test0.Y, /tmp/test0.U, /tmp/test0.V,\n/tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc...\n\nThe Y files use twice the resolution of the U and V files. They are  raw  files,  without\nheader.  They can be generated by all decent video decoders. You must specify the size of\nthe image with the -s option if ffmpeg cannot guess it.\n\n•   You can input from a raw YUV420P file:\n\nffmpeg -i /tmp/test.yuv /tmp/out.avi\n\ntest.yuv is a file containing raw YUV planar data. Each frame is composed of the Y  plane\nfollowed by the U and V planes at half vertical and horizontal resolution.\n\n•   You can output to a raw YUV420P file:\n\nffmpeg -i mydivx.avi hugefile.yuv\n\n•   You can set several input files and output files:\n\nffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg\n\nConverts the audio file a.wav and the raw YUV video file a.yuv to MPEG file a.mpg.\n\n•   You can also do audio and video conversions at the same time:\n\nffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2\n\nConverts a.wav to MPEG audio at 22050 Hz sample rate.\n\n•   You can encode to several formats at the same time and define a mapping from input stream\nto output streams:\n\nffmpeg -i /tmp/a.wav -map 0:a -b:a 64k /tmp/a.mp2 -map 0:a -b:a 128k /tmp/b.mp2\n\nConverts  a.wav  to  a.mp2  at  64  kbits  and  to  b.mp2 at 128 kbits. '-map file:index'\nspecifies which input stream is used  for  each  output  stream,  in  the  order  of  the\ndefinition of output streams.\n\n•   You can transcode decrypted VOBs:\n\nffmpeg -i snatch1.vob -f avi -c:v mpeg4 -b:v 800k -g 300 -bf 2 -c:a libmp3lame -b:a 128k snatch.avi\n\nThis  is  a  typical DVD ripping example; the input is a VOB file, the output an AVI file\nwith MPEG-4 video and MP3 audio. Note that in this command we use B-frames so the  MPEG-4\nstream  is  DivX5  compatible,  and  GOP size is 300 which means one intra frame every 10\nseconds for 29.97fps input video. Furthermore, the audio stream  is  MP3-encoded  so  you\nneed  to  enable LAME support by passing \"--enable-libmp3lame\" to configure.  The mapping\nis particularly useful for DVD transcoding to get the desired audio language.\n\nNOTE: To see the supported input formats, use \"ffmpeg -demuxers\".\n\n•   You can extract images from a video, or create a video from many images:\n\nFor extracting images from a video:\n\nffmpeg -i foo.avi -r 1 -s WxH -f image2 foo-%03d.jpeg\n\nThis will extract one video frame per second from the video and will output them in files\nnamed foo-001.jpeg, foo-002.jpeg, etc. Images will be rescaled to fit the new WxH values.\n\nIf you want to extract just a limited number of frames, you can use the above command  in\ncombination  with  the  \"-frames:v\"  or  \"-t\" option, or in combination with -ss to start\nextracting from a certain point in time.\n\nFor creating a video from many images:\n\nffmpeg -f image2 -framerate 12 -i foo-%03d.jpeg -s WxH foo.avi\n\nThe syntax \"foo-%03d.jpeg\" specifies to use a decimal number  composed  of  three  digits\npadded with zeroes to express the sequence number. It is the same syntax supported by the\nC printf function, but only formats accepting a normal integer are suitable.\n\nWhen importing an image sequence, -i also supports expanding shell-like wildcard patterns\n(globbing) internally, by selecting the image2-specific \"-patterntype glob\" option.\n\nFor example, for creating a video from filenames matching the glob pattern \"foo-*.jpeg\":\n\nffmpeg -f image2 -patterntype glob -framerate 12 -i 'foo-*.jpeg' -s WxH foo.avi\n\n•   You can put many streams of the same type in the output:\n\nffmpeg -i test1.avi -i test2.avi -map 1:1 -map 1:0 -map 0:1 -map 0:0 -c copy -y test12.nut\n\nThe  resulting  output file test12.nut will contain the first four streams from the input\nfiles in reverse order.\n\n•   To force CBR video output:\n\nffmpeg -i myfile.avi -b 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v\n\n•   The four options lmin, lmax, mblmin and mblmax use 'lambda' units, but you  may  use  the\nQP2LAMBDA constant to easily convert from 'q' units:\n\nffmpeg -i src.ext -lmax 21*QP2LAMBDA dst.ext\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "ffmpeg-all(1), ffplay(1), ffprobe(1), ffmpeg-utils(1), ffmpeg-scaler(1), ffmpeg-resampler(1),\nffmpeg-codecs(1),    ffmpeg-bitstream-filters(1),    ffmpeg-formats(1),    ffmpeg-devices(1),\nffmpeg-protocols(1), ffmpeg-filters(1)\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "The FFmpeg developers.\n\nFor   details   about   the   authorship,   see   the   Git   history    of    the    project\n(https://git.ffmpeg.org/ffmpeg),  e.g.  by  typing  the  command git log in the FFmpeg source\ndirectory, or browsing the online repository at <https://git.ffmpeg.org/ffmpeg>.\n\nMaintainers for the specific components are listed in the file MAINTAINERS in the source code\ntree.\n\nFFMPEG(1)",
            "subsections": []
        }
    },
    "summary": "ffmpeg - ffmpeg media converter",
    "flags": [
        {
            "flag": "-L",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-?",
            "long": "--help",
            "arg": null,
            "description": "Show help. An optional parameter may be specified to print help about a specific item. If no argument is specified, only basic (non advanced) tool options are shown. Possible values of arg are: long Print advanced tool options in addition to the basic tool options. full Print complete list of options, including shared and private options for encoders, decoders, demuxers, muxers, filters, etc. decoder=decodername Print detailed information about the decoder named decodername. Use the -decoders option to get a list of all decoders. encoder=encodername Print detailed information about the encoder named encodername. Use the -encoders option to get a list of all encoders. demuxer=demuxername Print detailed information about the demuxer named demuxername. Use the -formats option to get a list of all demuxers and muxers. muxer=muxername Print detailed information about the muxer named muxername. Use the -formats option to get a list of all muxers and demuxers. filter=filtername Print detailed information about the filter named filtername. Use the -filters option to get a list of all filters. bsf=bitstreamfiltername Print detailed information about the bitstream filter named bitstreamfiltername. Use the -bsfs option to get a list of all bitstream filters. protocol=protocolname Print detailed information about the protocol named protocolname. Use the -protocols option to get a list of all protocols."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Show version."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Show the build configuration, one option per line."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Show available formats (including devices)."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Show available demuxers."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Show available muxers."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Show available devices."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Show all codecs known to libavcodec. Note that the term 'codec' is used throughout this documentation as a shortcut for what is more correctly called a media bitstream format."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Show available decoders."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Show all available encoders."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Show available bitstream filters."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Show available protocols."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Show available libavfilter filters."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Show available pixel formats."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Show available sample formats."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Show channel names and standard channel layouts."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Show stream dispositions."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Show recognized color names."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Show autodetected sources of the input device. Some devices may provide system-dependent source names that cannot be autodetected. The returned list cannot be assumed to be always complete. ffmpeg -sources pulse,server=192.168.0.4"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Show autodetected sinks of the output device. Some devices may provide system-dependent sink names that cannot be autodetected. The returned list cannot be assumed to be always complete. ffmpeg -sinks pulse,server=192.168.0.4"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set logging level and flags used by the library. The optional flags prefix can consist of the following values: repeat Indicates that repeated log output should not be compressed to the first line and the \"Last message repeated n times\" line will be omitted. level Indicates that log output should add a \"[level]\" prefix to each message line. This can be used as an alternative to log coloring, e.g. when dumping the log to file. Flags can also be used alone by adding a '+'/'-' prefix to set/reset a single flag without affecting other flags or changing loglevel. When setting both flags and loglevel, a '+' separator is expected between the last flags value and before loglevel. loglevel is a string or a number containing one of the following values: quiet, -8 Show nothing at all; be silent. panic, 0 Only show fatal errors which could lead the process to crash, such as an assertion failure. This is not currently used for anything. fatal, 8 Only show fatal errors. These are errors after which the process absolutely cannot continue. error, 16 Show all errors, including ones which can be recovered from. warning, 24 Show all warnings and errors. Any message related to possibly incorrect or unexpected events will be shown. info, 32 Show informative messages during processing. This is in addition to warnings and errors. This is the default value. verbose, 40 Same as \"info\", except more verbose. debug, 48 Show everything, including debugging information. trace, 56 For example to enable repeated log output, add the \"level\" prefix, and set loglevel to \"verbose\": ffmpeg -loglevel repeat+level+verbose -i input output Another example that enables repeated log output without affecting current state of \"level\" prefix flag or loglevel: ffmpeg [...] -loglevel +repeat By default the program logs to stderr. If coloring is supported by the terminal, colors are used to mark errors and warnings. Log coloring can be disabled setting the environment variable AVLOGFORCENOCOLOR, or can be forced setting the environment variable AVLOGFORCECOLOR."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Dump full command line and log output to a file named \"program-YYYYMMDD-HHMMSS.log\" in the current directory. This file can be useful for bug reports. It also implies \"-loglevel debug\". Setting the environment variable FFREPORT to any value has the same effect. If the value is a ':'-separated key=value sequence, these options will affect the report; option values must be escaped if they contain special characters or the options delimiter ':' (see the ``Quoting and escaping'' section in the ffmpeg-utils manual). The following options are recognized: file set the file name to use for the report; %p is expanded to the name of the program, %t is expanded to a timestamp, \"%%\" is expanded to a plain \"%\" level set the log verbosity level using a numerical value (see \"-loglevel\"). For example, to output a report to a file named ffreport.log using a log level of 32 (alias for log level \"info\"): FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output Errors in parsing the environment variable are not fatal, and will not appear in the report."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Suppress printing banner. All FFmpeg tools will normally show a copyright notice, build options and library versions. This option can be used to suppress printing this information."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Allows setting and clearing cpu flags. This option is intended for testing. Do not use it unless you know what you're doing. ffmpeg -cpuflags -sse+mmx ... ffmpeg -cpuflags mmx ... ffmpeg -cpuflags 0 ... Possible flags for this option are: x86 mmx mmxext sse sse2 sse2slow sse3 sse3slow ssse3 atom sse4.1 sse4.2 avx avx2 xop fma3 fma4 3dnow 3dnowext bmi1 bmi2 cmov ARM armv5te armv6 armv6t2 vfp vfpv3 neon setend AArch64 armv8 vfp neon PowerPC altivec Specific Processors pentium2 pentium3 pentium4 k6 k62 athlon athlonxp k8"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Override detection of CPU count. This option is intended for testing. Do not use it unless you know what you're doing. ffmpeg -cpucount 2"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set the maximum size limit for allocating a block on the heap by ffmpeg's family of malloc functions. Exercise extreme caution when using this option. Don't use if you do not understand the full consequence of doing so. Default is INTMAX."
        },
        {
            "flag": "-f",
            "long": null,
            "arg": null,
            "description": "Force input or output file format. The format is normally auto detected for input files and guessed from the file extension for output files, so this option is not needed in most cases."
        },
        {
            "flag": "-i",
            "long": null,
            "arg": null,
            "description": "input file url"
        },
        {
            "flag": "-y",
            "long": null,
            "arg": null,
            "description": "Overwrite output files without asking."
        },
        {
            "flag": "-n",
            "long": null,
            "arg": null,
            "description": "Do not overwrite output files, and exit immediately if a specified output file already exists."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set number of times input stream shall be looped. Loop 0 means no loop, loop -1 means infinite loop."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Allow forcing a decoder of a different media type than the one detected or designated by the demuxer. Useful for decoding media data muxed as data streams."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Select an encoder (when used before an output file) or a decoder (when used before an input file) for one or more streams. codec is the name of a decoder/encoder or a special value \"copy\" (output only) to indicate that the stream is not to be re-encoded. For example ffmpeg -i INPUT -map 0 -c:v libx264 -c:a copy OUTPUT encodes all video streams with libx264 and copies all audio streams. For each stream, the last matching \"c\" option is applied, so ffmpeg -i INPUT -map 0 -c copy -c:v:1 libx264 -c:a:137 libvorbis OUTPUT will copy all the streams except the second video, which will be encoded with libx264, and the 138th audio, which will be encoded with libvorbis."
        },
        {
            "flag": "-t",
            "long": null,
            "arg": null,
            "description": "When used as an input option (before \"-i\"), limit the duration of data read from the input file. When used as an output option (before an output url), stop writing the output after its duration reaches duration. duration must be a time duration specification, see the Time duration section in the ffmpeg-utils(1) manual. -to and -t are mutually exclusive and -t has priority."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Stop writing the output or reading the input at position. position must be a time duration specification, see the Time duration section in the ffmpeg-utils(1) manual. -to and -t are mutually exclusive and -t has priority."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set the file size limit, expressed in bytes. No further chunk of bytes is written after the limit is exceeded. The size of the output file is slightly more than the requested file size."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "When used as an input option (before \"-i\"), seeks in this input file to position. Note that in most formats it is not possible to seek exactly, so ffmpeg will seek to the closest seek point before position. When transcoding and -accurateseek is enabled (the default), this extra segment between the seek point and position will be decoded and discarded. When doing stream copy or when -noaccurateseek is used, it will be preserved. When used as an output option (before an output url), decodes but discards input until the timestamps reach position. position must be a time duration specification, see the Time duration section in the ffmpeg-utils(1) manual."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Like the \"-ss\" option but relative to the \"end of file\". That is negative values are earlier in the file, 0 is at EOF."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Assign an input as a sync source. This will take the difference between the start times of the target and reference inputs and offset the timestamps of the target file by that difference. The source timestamps of the two inputs should derive from the same clock source for expected results. If \"copyts\" is set then \"startatzero\" must also be set. If either of the inputs has no starting timestamp then no sync adjustment is made. Acceptable values are those that refer to a valid ffmpeg input index. If the sync reference is the target index itself or -1, then no adjustment is made to target timestamps. A sync reference may not itself be synced to any other input. Default value is -1."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set the input time offset. offset must be a time duration specification, see the Time duration section in the ffmpeg-utils(1) manual. The offset is added to the timestamps of the input files. Specifying a positive offset means that the corresponding streams are delayed by the time duration specified in offset."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Rescale input timestamps. scale should be a floating point number."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set the recording timestamp in the container. date must be a date specification, see the Date section in the ffmpeg-utils(1) manual."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set a metadata key/value pair. An optional metadataspecifier may be given to set metadata on streams, chapters or programs. See \"-mapmetadata\" documentation for details. This option overrides metadata set with \"-mapmetadata\". It is also possible to delete metadata by using an empty value. For example, for setting the title in the output file: ffmpeg -i in.avi -metadata title=\"my title\" out.flv To set the language of the first audio stream: ffmpeg -i INPUT -metadata:s:a:0 language=eng OUTPUT"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Sets the disposition for a stream. By default, the disposition is copied from the input stream, unless the output stream this option applies to is fed by a complex filtergraph - in that case the disposition is unset by default. value is a sequence of items separated by '+' or '-'. The first item may also be prefixed with '+' or '-', in which case this option modifies the default value. Otherwise (the first item is not prefixed) this options overrides the default value. A '+' prefix adds the given disposition, '-' removes it. It is also possible to clear the disposition by setting it to 0. If no \"-disposition\" options were specified for an output file, ffmpeg will automatically set the 'default' disposition on the first stream of each type, when there are multiple streams of this type in the output file and no stream of that type is already marked as default. The \"-dispositions\" option lists the known dispositions. For example, to make the second audio stream the default stream: ffmpeg -i in.mkv -c copy -disposition:a:1 default out.mkv To make the second subtitle stream the default stream and remove the default disposition from the first subtitle stream: ffmpeg -i in.mkv -c copy -disposition:s:0 0 -disposition:s:1 default out.mkv To add an embedded cover/thumbnail: ffmpeg -i in.mp4 -i IMAGE -map 0 -map 1 -c copy -c:v:1 png -disposition:v:1 attachedpic out.mp4 Not all muxers support embedded thumbnails, and those who do, only support a few formats, like JPEG or PNG."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Creates a program with the specified title, programnum and adds the specified stream(s) to it."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Specify target file type (\"vcd\", \"svcd\", \"dvd\", \"dv\", \"dv50\"). type may be prefixed with \"pal-\", \"ntsc-\" or \"film-\" to use the corresponding standard. All the format options (bitrate, codecs, buffer sizes) are then set automatically. You can just type: ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg Nevertheless you can specify additional options as long as you know they do not conflict with the standard, as in: ffmpeg -i myfile.avi -target vcd -bf 2 /tmp/vcd.mpg The parameters set for each target are as follows. VCD <pal>: -f vcd -muxrate 1411200 -muxpreload 0.44 -packetsize 2324 -s 352x288 -r 25 -codec:v mpeg1video -g 15 -b:v 1150k -maxrate:v 1150k -minrate:v 1150k -bufsize:v 327680 -ar 44100 -ac 2 -codec:a mp2 -b:a 224k <ntsc>: -f vcd -muxrate 1411200 -muxpreload 0.44 -packetsize 2324 -s 352x240 -r 30000/1001 -codec:v mpeg1video -g 18 -b:v 1150k -maxrate:v 1150k -minrate:v 1150k -bufsize:v 327680 -ar 44100 -ac 2 -codec:a mp2 -b:a 224k <film>: -f vcd -muxrate 1411200 -muxpreload 0.44 -packetsize 2324 -s 352x240 -r 24000/1001 -codec:v mpeg1video -g 18 -b:v 1150k -maxrate:v 1150k -minrate:v 1150k -bufsize:v 327680 -ar 44100 -ac 2 -codec:a mp2 -b:a 224k SVCD <pal>: -f svcd -packetsize 2324 -s 480x576 -pixfmt yuv420p -r 25 -codec:v mpeg2video -g 15 -b:v 2040k -maxrate:v 2516k -minrate:v 0 -bufsize:v 1835008 -scanoffset 1 -ar 44100 -codec:a mp2 -b:a 224k <ntsc>: -f svcd -packetsize 2324 -s 480x480 -pixfmt yuv420p -r 30000/1001 -codec:v mpeg2video -g 18 -b:v 2040k -maxrate:v 2516k -minrate:v 0 -bufsize:v 1835008 -scanoffset 1 -ar 44100 -codec:a mp2 -b:a 224k <film>: -f svcd -packetsize 2324 -s 480x480 -pixfmt yuv420p -r 24000/1001 -codec:v mpeg2video -g 18 -b:v 2040k -maxrate:v 2516k -minrate:v 0 -bufsize:v 1835008 -scanoffset 1 -ar 44100 -codec:a mp2 -b:a 224k DVD <pal>: -f dvd -muxrate 10080k -packetsize 2048 -s 720x576 -pixfmt yuv420p -r 25 -codec:v mpeg2video -g 15 -b:v 6000k -maxrate:v 9000k -minrate:v 0 -bufsize:v 1835008 -ar 48000 -codec:a ac3 -b:a 448k <ntsc>: -f dvd -muxrate 10080k -packetsize 2048 -s 720x480 -pixfmt yuv420p -r 30000/1001 -codec:v mpeg2video -g 18 -b:v 6000k -maxrate:v 9000k -minrate:v 0 -bufsize:v 1835008 -ar 48000 -codec:a ac3 -b:a 448k <film>: -f dvd -muxrate 10080k -packetsize 2048 -s 720x480 -pixfmt yuv420p -r 24000/1001 -codec:v mpeg2video -g 18 -b:v 6000k -maxrate:v 9000k -minrate:v 0 -bufsize:v 1835008 -ar 48000 -codec:a ac3 -b:a 448k DV <pal>: -f dv -s 720x576 -pixfmt yuv420p -r 25 -ar 48000 -ac 2 <ntsc>: -f dv -s 720x480 -pixfmt yuv411p -r 30000/1001 -ar 48000 -ac 2 <film>: -f dv -s 720x480 -pixfmt yuv411p -r 24000/1001 -ar 48000 -ac 2 The \"dv50\" target is identical to the \"dv\" target except that the pixel format set is \"yuv422p\" for all three standards. Any user-set value for a parameter above will override the target preset value. In that case, the output may not comply with the target standard."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "As an input option, blocks all data streams of a file from being filtered or being automatically selected or mapped for any output. See \"-discard\" option to disable streams individually. As an output option, disables data recording i.e. automatic selection or mapping of any data stream. For full manual control see the \"-map\" option."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set the number of data frames to output. This is an obsolete alias for \"-frames:d\", which you should use instead."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Stop writing to the stream after framecount frames."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Use fixed quality scale (VBR). The meaning of q/qscale is codec-dependent. If qscale is used without a streamspecifier then it applies only to the video stream, this is to maintain compatibility with previous behavior and as specifying the same codec specific value to 2 different codecs that is audio and video generally is not what is intended when no streamspecifier is used."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Create the filtergraph specified by filtergraph and use it to filter the stream. filtergraph is a description of the filtergraph to apply to the stream, and must have a single input and a single output of the same type of the stream. In the filtergraph, the input is associated to the label \"in\", and the output to the label \"out\". See the ffmpeg- filters manual for more information about the filtergraph syntax. See the -filtercomplex option if you want to create filtergraphs with multiple inputs and/or outputs."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "This option is similar to -filter, the only difference is that its argument is the name of the file from which a filtergraph description is to be read."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "This boolean option determines if the filtergraph(s) to which this stream is fed gets reinitialized when input frame parameters change mid-stream. This option is enabled by default as most video and all audio filters cannot handle deviation in input frame properties. Upon reinitialization, existing filter state is lost, like e.g. the frame count \"n\" reference available in some filters. Any frames buffered at time of reinitialization are lost. The properties where a change triggers reinitialization are, for video, frame resolution or pixel format; for audio, sample format, sample rate, channel count or channel layout."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Defines how many threads are used to process a filter pipeline. Each pipeline will produce a thread pool with this many threads available for parallel processing. The default is the number of available CPUs."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Specify the preset for matching stream(s)."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Print encoding progress/statistics. It is on by default, to explicitly disable it you need to specify \"-nostats\"."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set period at which encoding progress/statistics are updated. Default is 0.5 seconds."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Send program-friendly progress information to url. Progress information is written periodically and at the end of the encoding process. It is made of \"key=value\" lines. key consists of only alphanumeric characters. The last key of a sequence of progress information is always \"progress\". The update period is set using \"-statsperiod\"."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Enable interaction on standard input. On by default unless standard input is used as an input. To explicitly disable interaction you need to specify \"-nostdin\". Disabling interaction on standard input is useful, for example, if ffmpeg is in the background process group. Roughly the same result can be achieved with \"ffmpeg ... < /dev/null\" but it requires a shell."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Print timestamp information. It is off by default. This option is mostly useful for testing and debugging purposes, and the output format may change from one version to another, so it should not be employed by portable scripts. See also the option \"-fdebug ts\"."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Add an attachment to the output file. This is supported by a few formats like Matroska for e.g. fonts used in rendering subtitles. Attachments are implemented as a specific type of stream, so this option will add a new stream to the file. It is then possible to use per-stream options on this stream in the usual way. Attachment streams created with this option will be created after all the other streams (i.e. those created with \"-map\" or automatic mappings). Note that for Matroska you also have to set the mimetype metadata tag: ffmpeg -i INPUT -attach DejaVuSans.ttf -metadata:s:2 mimetype=application/x-truetype-font out.mkv (assuming that the attachment stream will be third in the output file)."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Extract the matching attachment stream into a file named filename. If filename is empty, then the value of the \"filename\" metadata tag will be used. E.g. to extract the first attachment to a file named 'out.ttf': ffmpeg -dumpattachment:t:0 out.ttf -i INPUT To extract all attachments to files determined by the \"filename\" tag: ffmpeg -dumpattachment:t \"\" -i INPUT Technical note -- attachments are implemented as codec extradata, so this option can actually be used to extract extradata from any stream, not just attachments."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set the number of video frames to output. This is an obsolete alias for \"-frames:v\", which you should use instead."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set frame rate (Hz value, fraction or abbreviation). As an input option, ignore any timestamps stored in the file and instead generate timestamps assuming constant frame rate fps. This is not the same as the -framerate option used for some input formats like image2 or v4l2 (it used to be the same in older versions of FFmpeg). If in doubt use -framerate instead of the input option -r. As an output option: video encoding Duplicate or drop frames right before encoding them to achieve constant output frame rate fps. video streamcopy Indicate to the muxer that fps is the stream frame rate. No data is dropped or duplicated in this case. This may produce invalid files if fps does not match the actual stream frame rate as determined by packet timestamps. See also the \"setts\" bitstream filter."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set maximum frame rate (Hz value, fraction or abbreviation). Clamps output frame rate when output framerate is auto-set and is higher than this value. Useful in batch processing or when input framerate is wrongly detected as very high. It cannot be set together with \"-r\". It is ignored during streamcopy."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set frame size. As an input option, this is a shortcut for the videosize private option, recognized by some demuxers for which the frame size is either not stored in the file or is configurable -- e.g. raw video or video grabbers. As an output option, this inserts the \"scale\" video filter to the end of the corresponding filtergraph. Please use the \"scale\" filter directly to insert it at the beginning or some other place. The format is wxh (default - same as source)."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set the video display aspect ratio specified by aspect. aspect can be a floating point number string, or a string of the form num:den, where num and den are the numerator and denominator of the aspect ratio. For example \"4:3\", \"16:9\", \"1.3333\", and \"1.7777\" are valid argument values. If used together with -vcodec copy, it will affect the aspect ratio stored at container level, but not the aspect ratio stored in encoded frames, if it exists."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set video rotation metadata. rotation is a decimal number specifying the amount in degree by which the video should be rotated counter-clockwise before being displayed. This option overrides the rotation/display transform metadata stored in the file, if any. When the video is being transcoded (rather than copied) and \"-autorotate\" is enabled, the video will be rotated at the filtering stage. Otherwise, the metadata will be written into the output file if the muxer supports it. If the \"-displayhflip\" and/or \"-displayvflip\" options are given, they are applied after the rotation specified by this option."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set whether on display the image should be horizontally flipped. See the \"-displayrotation\" option for more details."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set whether on display the image should be vertically flipped. See the \"-displayrotation\" option for more details."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "As an input option, blocks all video streams of a file from being filtered or being automatically selected or mapped for any output. See \"-discard\" option to disable streams individually. As an output option, disables video recording i.e. automatic selection or mapping of any video stream. For full manual control see the \"-map\" option."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set the video codec. This is an alias for \"-codec:v\"."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Select the pass number (1 or 2). It is used to do two-pass video encoding. The statistics of the video are recorded in the first pass into a log file (see also the option -passlogfile), and in the second pass that log file is used to generate the video at the exact requested bitrate. On pass 1, you may just deactivate audio and set output to null, examples for Windows and Unix: ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y NUL ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y /dev/null"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set two-pass log file name prefix to prefix, the default file name prefix is ``ffmpeg2pass''. The complete file name will be PREFIX-N.log, where N is a number specific to the output stream"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Create the filtergraph specified by filtergraph and use it to filter the stream. This is an alias for \"-filter:v\", see the -filter option."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Automatically rotate the video according to file metadata. Enabled by default, use -noautorotate to disable it."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Automatically scale the video according to the resolution of first frame. Enabled by default, use -noautoscale to disable it. When autoscale is disabled, all output frames of filter graph might not be in the same resolution and may be inadequate for some encoder/muxer. Therefore, it is not recommended to disable it unless you really know what you are doing. Disable autoscale at your own risk."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set pixel format. Use \"-pixfmts\" to show all the supported pixel formats. If the selected pixel format can not be selected, ffmpeg will print a warning and select the best pixel format supported by the encoder. If pixfmt is prefixed by a \"+\", ffmpeg will exit with an error if the requested pixel format can not be selected, and automatic conversions inside filtergraphs are disabled. If pixfmt is a single \"+\", ffmpeg selects the same pixel format as the input (or graph output) and automatic conversions are disabled."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set default flags for the libswscale library. These flags are used by automatically inserted \"scale\" filters and those within simple filtergraphs, if not overridden within the filtergraph definition. See the ffmpeg-scaler manual for a list of scaler options."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Rate control override for specific intervals, formatted as \"int,int,int\" list separated with slashes. Two first values are the beginning and end frame numbers, last one is quantizer to use if positive, or quality factor if negative."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Calculate PSNR of compressed frames. This option is deprecated, pass the PSNR flag to the encoder instead, using \"-flags +psnr\"."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Dump video coding statistics to vstatsHHMMSS.log. See the vstats file format section for the format description."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Dump video coding statistics to file. See the vstats file format section for the format description."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Specify which version of the vstats format to use. Default is 2. See the vstats file format section for the format description."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Force video tag/fourcc. This is an alias for \"-tag:v\"."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Deprecated see -bsf"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "forcekeyframes can take arguments of the following form: time[,time...] If the argument consists of timestamps, ffmpeg will round the specified times to the nearest output timestamp as per the encoder time base and force a keyframe at the first frame having timestamp equal or greater than the computed timestamp. Note that if the encoder time base is too coarse, then the keyframes may be forced on frames with timestamps lower than the specified time. The default encoder time base is the inverse of the output framerate but may be set otherwise via \"-enctimebase\". If one of the times is \"\"chapters\"[delta]\", it is expanded into the time of the beginning of all chapters in the file, shifted by delta, expressed as a time in seconds. This option can be useful to ensure that a seek point is present at a chapter mark or any other designated place in the output file. For example, to insert a key frame at 5 minutes, plus key frames 0.1 second before the beginning of every chapter: -forcekeyframes 0:05:00,chapters-0.1 expr:expr If the argument is prefixed with \"expr:\", the string expr is interpreted like an expression and is evaluated for each frame. A key frame is forced in case the evaluation is non-zero. The expression in expr can contain the following constants: n the number of current processed frame, starting from 0 nforced the number of forced frames prevforcedn the number of the previous forced frame, it is \"NAN\" when no keyframe was forced yet prevforcedt the time of the previous forced frame, it is \"NAN\" when no keyframe was forced yet t the time of the current processed frame For example to force a key frame every 5 seconds, you can specify: -forcekeyframes expr:gte(t,nforced*5) To force a key frame 5 seconds after the time of the last forced one, starting from second 13: -forcekeyframes expr:if(isnan(prevforcedt),gte(t,13),gte(t,prevforcedt+5)) source If the argument is \"source\", ffmpeg will force a key frame if the current frame being encoded is marked as a key frame in its source. In cases where this particular source frame has to be dropped, enforce the next available frame to become a key frame instead. Note that forcing too many keyframes is very harmful for the lookahead algorithms of certain encoders: using fixed-GOP options or similar would be more efficient."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "When doing stream copy, copy also non-key frames found at the beginning."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Initialise a new hardware device of type type called name, using the given device parameters. If no name is specified it will receive a default name of the form \"type%d\". The meaning of device and the following arguments depends on the device type: cuda device is the number of the CUDA device. The following options are recognized: primaryctx If set to 1, uses the primary device context instead of creating a new one. Examples: -inithwdevice cuda:1 Choose the second device on the system. -inithwdevice cuda:0,primaryctx=1 Choose the first device and use the primary device context. dxva2 device is the number of the Direct3D 9 display adapter. d3d11va device is the number of the Direct3D 11 display adapter. vaapi device is either an X11 display name, a DRM render node or a DirectX adapter index. If not specified, it will attempt to open the default X11 display ($DISPLAY) and then the first DRM render node (/dev/dri/renderD128), or the default DirectX adapter on Windows. vdpau device is an X11 display name. If not specified, it will attempt to open the default X11 display ($DISPLAY). qsv device selects a value in MFXIMPL*. Allowed values are: auto sw hw autoany hwany hw2 hw3 hw4 If not specified, autoany is used. (Note that it may be easier to achieve the desired result for QSV by creating the platform-appropriate subdevice (dxva2 or d3d11va or vaapi) and then deriving a QSV device from that.) Alternatively, childdevicetype helps to choose platform-appropriate subdevice type. On Windows d3d11va is used as default subdevice type. Examples: -inithwdevice qsv:hw,childdevicetype=d3d11va Choose the GPU subdevice with type d3d11va and create QSV device with MFXIMPLHARDWARE. -inithwdevice qsv:hw,childdevicetype=dxva2 Choose the GPU subdevice with type dxva2 and create QSV device with MFXIMPLHARDWARE. opencl device selects the platform and device as platformindex.deviceindex. The set of devices can also be filtered using the key-value pairs to find only devices matching particular platform or device strings. The strings usable as filters are: platformprofile platformversion platformname platformvendor platformextensions devicename devicevendor driverversion deviceversion deviceprofile deviceextensions devicetype The indices and filters must together uniquely select a device. Examples: -inithwdevice opencl:0.1 Choose the second device on the first platform. -inithwdevice opencl:,devicename=Foo9000 Choose the device with a name containing the string Foo9000. -inithwdevice opencl:1,devicetype=gpu,deviceextensions=clkhrfp16 Choose the GPU device on the second platform supporting the clkhrfp16 extension. vulkan If device is an integer, it selects the device by its index in a system-dependent list of devices. If device is any other string, it selects the first device with a name containing that string as a substring. The following options are recognized: debug If set to 1, enables the validation layer, if installed. linearimages If set to 1, images allocated by the hwcontext will be linear and locally mappable. instanceextensions A plus separated list of additional instance extensions to enable. deviceextensions A plus separated list of additional device extensions to enable. Examples: -inithwdevice vulkan:1 Choose the second device on the system. -inithwdevice vulkan:RADV Choose the first device with a name containing the string RADV. -inithwdevice vulkan:0,instanceextensions=VKKHRwaylandsurface+VKKHRxcbsurface Choose the first device and enable the Wayland and XCB instance extensions."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Initialise a new hardware device of type type called name, deriving it from the existing device with the name source."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "List all hardware device types supported in this build of ffmpeg."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Pass the hardware device called name to all filters in any filter graph. This can be used to set the device to upload to with the \"hwupload\" filter, or the device to map to with the \"hwmap\" filter. Other filters may also make use of this parameter when they require a hardware device. Note that this is typically only required when the input is not already in hardware frames - when it is, filters will derive the device they require from the context of the frames they receive as input. This is a global setting, so all filters will receive the same device."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Use hardware acceleration to decode the matching stream(s). The allowed values of hwaccel are: none Do not use any hardware acceleration (the default). auto Automatically select the hardware acceleration method. vdpau Use VDPAU (Video Decode and Presentation API for Unix) hardware acceleration. dxva2 Use DXVA2 (DirectX Video Acceleration) hardware acceleration. d3d11va Use D3D11VA (DirectX Video Acceleration) hardware acceleration. vaapi Use VAAPI (Video Acceleration API) hardware acceleration. qsv Use the Intel QuickSync Video acceleration for video transcoding. Unlike most other values, this option does not enable accelerated decoding (that is used automatically whenever a qsv decoder is selected), but accelerated transcoding, without copying the frames into the system memory. For it to work, both the decoder and the encoder must support QSV acceleration and no filters must be used. This option has no effect if the selected hwaccel is not available or not supported by the chosen decoder. Note that most acceleration methods are intended for playback and will not be faster than software decoding on modern CPUs. Additionally, ffmpeg will usually need to copy the decoded frames from the GPU memory into the system memory, resulting in further performance loss. This option is thus mainly useful for testing."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Select a device to use for hardware acceleration. This option only makes sense when the -hwaccel option is also specified. It can either refer to an existing device created with -inithwdevice by name, or it can create a new device as if -inithwdevice type:hwacceldevice were called immediately before."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "List all hardware acceleration components enabled in this build of ffmpeg. Actual runtime availability depends on the hardware and its suitable driver being installed."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set a specific output video stream as the heartbeat stream according to which to split and push through currently in-progress subtitle upon receipt of a random access packet. This lowers the latency of subtitles for which the end packet or the following subtitle has not yet been received. As a drawback, this will most likely lead to duplication of subtitle events in order to cover the full duration, so when dealing with use cases where latency of when the subtitle event is passed on to output is not relevant this option should not be utilized. Requires -fixsubduration to be set for the relevant input subtitle stream for this to have any effect, as well as for the input subtitle stream having to be directly mapped to the same output in which the heartbeat stream resides."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set the number of audio frames to output. This is an obsolete alias for \"-frames:a\", which you should use instead."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set the audio sampling frequency. For output streams it is set by default to the frequency of the corresponding input stream. For input streams this option only makes sense for audio grabbing devices and raw demuxers and is mapped to the corresponding demuxer options."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set the audio quality (codec-specific, VBR). This is an alias for -q:a."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set the number of audio channels. For output streams it is set by default to the number of input audio channels. For input streams this option only makes sense for audio grabbing devices and raw demuxers and is mapped to the corresponding demuxer options."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "As an input option, blocks all audio streams of a file from being filtered or being automatically selected or mapped for any output. See \"-discard\" option to disable streams individually. As an output option, disables audio recording i.e. automatic selection or mapping of any audio stream. For full manual control see the \"-map\" option."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set the audio codec. This is an alias for \"-codec:a\"."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set the audio sample format. Use \"-samplefmts\" to get a list of supported sample formats."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Create the filtergraph specified by filtergraph and use it to filter the stream. This is an alias for \"-filter:a\", see the -filter option."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Force audio tag/fourcc. This is an alias for \"-tag:a\"."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Deprecated, see -bsf"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "If some input channel layout is not known, try to guess only if it corresponds to at most the specified number of channels. For example, 2 tells to ffmpeg to recognize 1 channel as mono and 2 channels as stereo but not 6 channels as 5.1. The default is to always try to guess. Use 0 to disable all guessing."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set the subtitle codec. This is an alias for \"-codec:s\"."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "As an input option, blocks all subtitle streams of a file from being filtered or being automatically selected or mapped for any output. See \"-discard\" option to disable streams individually. As an output option, disables subtitle recording i.e. automatic selection or mapping of any subtitle stream. For full manual control see the \"-map\" option."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Deprecated, see -bsf"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Fix subtitles durations. For each subtitle, wait for the next packet in the same stream and adjust the duration of the first to avoid overlap. This is necessary with some subtitles codecs, especially DVB subtitles, because the duration in the original packet is only a rough estimate and the end is actually marked by an empty subtitle frame. Failing to use this option when necessary can result in exaggerated durations or muxing failures due to non-monotonic timestamps. Note that this option will delay the output of all data until the next subtitle packet is decoded: it may increase memory consumption and latency a lot."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set the size of the canvas used to render subtitles."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Create one or more streams in the output file. This option has two forms for specifying the data source(s): the first selects one or more streams from some input file (specified with \"-i\"), the second takes an output from some complex filtergraph (specified with \"-filtercomplex\" or \"-filtercomplexscript\"). In the first form, an output stream is created for every stream from the input file with the index inputfileid. If streamspecifier is given, only those streams that match the specifier are used (see the Stream specifiers section for the streamspecifier syntax). A \"-\" character before the stream identifier creates a \"negative\" mapping. It disables matching streams from already created mappings. A trailing \"?\" after the stream index will allow the map to be optional: if the map matches no streams the map will be ignored instead of failing. Note the map will still fail if an invalid input file index is used; such as if the map refers to a non-existent input. An alternative [linklabel] form will map outputs from complex filter graphs (see the -filtercomplex option) to the output file. linklabel must correspond to a defined output link label in the graph. This option may be specified multiple times, each adding more streams to the output file. Any given input stream may also be mapped any number of times as a source for different output streams, e.g. in order to use different encoding options and/or filters. The streams are created in the output in the same order in which the \"-map\" options are given on the commandline. Using this option disables the default mappings for this output file. Examples: map everything To map ALL streams from the first input file to output ffmpeg -i INPUT -map 0 output select specific stream If you have two audio streams in the first input file, these streams are identified by 0:0 and 0:1. You can use \"-map\" to select which streams to place in an output file. For example: ffmpeg -i INPUT -map 0:1 out.wav will map the second input stream in INPUT to the (single) output stream in out.wav. create multiple streams To select the stream with index 2 from input file a.mov (specified by the identifier 0:2), and stream with index 6 from input b.mov (specified by the identifier 1:6), and copy them to the output file out.mov: ffmpeg -i a.mov -i b.mov -c copy -map 0:2 -map 1:6 out.mov create multiple streams 2 To select all video and the third audio stream from an input file: ffmpeg -i INPUT -map 0:v -map 0:a:2 OUTPUT negative map To map all the streams except the second audio, use negative mappings ffmpeg -i INPUT -map 0 -map -0:a:1 OUTPUT optional map To map the video and audio streams from the first input, and using the trailing \"?\", ignore the audio mapping if no audio streams exist in the first input: ffmpeg -i INPUT -map 0:v -map 0:a? OUTPUT map by language To pick the English audio stream: ffmpeg -i INPUT -map 0:m:language:eng OUTPUT"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Ignore input streams with unknown type instead of failing if copying such streams is attempted."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Allow input streams with unknown type to be copied instead of failing if copying such streams is attempted."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "[inputfileid.streamspecifier.channelid|-1][?][:outputfileid.streamspecifier] This option is deprecated and will be removed. It can be replaced by the pan filter. In some cases it may be easier to use some combination of the channelsplit, channelmap, or amerge filters. Map an audio channel from a given input to an output. If outputfileid.streamspecifier is not set, the audio channel will be mapped on all the audio streams. Using \"-1\" instead of inputfileid.streamspecifier.channelid will map a muted channel. A trailing \"?\" will allow the mapchannel to be optional: if the mapchannel matches no channel the mapchannel will be ignored instead of failing. For example, assuming INPUT is a stereo audio file, you can switch the two audio channels with the following command: ffmpeg -i INPUT -mapchannel 0.0.1 -mapchannel 0.0.0 OUTPUT If you want to mute the first channel and keep the second: ffmpeg -i INPUT -mapchannel -1 -mapchannel 0.0.1 OUTPUT The order of the \"-mapchannel\" option specifies the order of the channels in the output stream. The output channel layout is guessed from the number of channels mapped (mono if one \"-mapchannel\", stereo if two, etc.). Using \"-ac\" in combination of \"-mapchannel\" makes the channel gain levels to be updated if input and output channel layouts don't match (for instance two \"-mapchannel\" options and \"-ac 6\"). You can also extract each channel of an input to specific outputs; the following command extracts two channels of the INPUT audio stream (file 0, stream 0) to the respective OUTPUTCH0 and OUTPUTCH1 outputs: ffmpeg -i INPUT -mapchannel 0.0.0 OUTPUTCH0 -mapchannel 0.0.1 OUTPUTCH1 The following example splits the channels of a stereo input into two separate streams, which are put into the same output file: ffmpeg -i stereo.wav -map 0:0 -map 0:0 -mapchannel 0.0.0:0.0 -mapchannel 0.0.1:0.1 -y out.ogg Note that currently each output stream can only contain channels from a single input stream; you can't for example use \"-mapchannel\" to pick multiple input audio channels contained in different streams (from the same or different files) and merge them into a single output stream. It is therefore not currently possible, for example, to turn two separate mono streams into a single stereo stream. However splitting a stereo stream into two single channel mono streams is possible. If you need this feature, a possible workaround is to use the amerge filter. For example, if you need to merge a media (here input.mkv) with 2 mono audio streams into one single stereo channel audio stream (and keep the video stream), you can use the following command: ffmpeg -i input.mkv -filtercomplex \"[0:1] [0:2] amerge\" -c:a pcms16le -c:v copy output.mkv To map the first two audio channels from the first input, and using the trailing \"?\", ignore the audio channel mapping if the first input is mono instead of stereo: ffmpeg -i INPUT -mapchannel 0.0.0 -mapchannel 0.0.1? OUTPUT"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set metadata information of the next output file from infile. Note that those are file indices (zero-based), not filenames. Optional metadataspecin/out parameters specify, which metadata to copy. A metadata specifier can have the following forms: g global metadata, i.e. metadata that applies to the whole file s[:streamspec] per-stream metadata. streamspec is a stream specifier as described in the Stream specifiers chapter. In an input metadata specifier, the first matching stream is copied from. In an output metadata specifier, all matching streams are copied to. c:chapterindex per-chapter metadata. chapterindex is the zero-based chapter index. p:programindex per-program metadata. programindex is the zero-based program index. If metadata specifier is omitted, it defaults to global. By default, global metadata is copied from the first input file, per-stream and per- chapter metadata is copied along with streams/chapters. These default mappings are disabled by creating any mapping of the relevant type. A negative file index can be used to create a dummy mapping that just disables automatic copying. For example to copy metadata from the first stream of the input file to global metadata of the output file: ffmpeg -i in.ogg -mapmetadata 0:s:0 out.mp3 To do the reverse, i.e. copy global metadata to all audio streams: ffmpeg -i in.mkv -mapmetadata:s:a 0:g out.mkv Note that simple 0 would work as well in this example, since global metadata is assumed by default."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Copy chapters from input file with index inputfileindex to the next output file. If no chapter mapping is specified, then chapters are copied from the first input file with at least one chapter. Use a negative file index to disable any chapter copying."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Show benchmarking information at the end of an encode. Shows real, system and user time used and maximum memory consumption. Maximum memory consumption is not supported on all systems, it will usually display as 0 if not supported."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Show benchmarking information during the encode. Shows real, system and user time used in various steps (audio/video encode/decode)."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Exit after ffmpeg has been running for duration seconds in CPU user time."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Dump each input packet to stderr."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "When dumping packets, also dump the payload."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Limit input read speed. Its value is a floating-point positive number which represents the maximum duration of media, in seconds, that should be ingested in one second of wallclock time. Default value is zero and represents no imposed limitation on speed of ingestion. Value 1 represents real-time speed and is equivalent to \"-re\". Mainly used to simulate a capture device or live input stream (e.g. when reading from a file). Should not be used with a low value when input is an actual capture device or live stream as it may cause packet loss. It is useful for when flow speed of output packets is important, such as live streaming."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Read input at native frame rate. This is equivalent to setting \"-readrate 1\"."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set an initial read burst time, in seconds, after which -re/-readrate will be enforced."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set video sync method / framerate mode. vsync is applied to all output video streams but can be overridden for a stream by setting fpsmode. vsync is deprecated and will be removed in the future. For compatibility reasons some of the values for vsync can be specified as numbers (shown in parentheses in the following table). passthrough (0) Each frame is passed with its timestamp from the demuxer to the muxer. cfr (1) Frames will be duplicated and dropped to achieve exactly the requested constant frame rate. vfr (2) Frames are passed through with their timestamp or dropped so as to prevent 2 frames from having the same timestamp. drop As passthrough but destroys all timestamps, making the muxer generate fresh timestamps based on frame-rate. auto (-1) Chooses between cfr and vfr depending on muxer capabilities. This is the default method. Note that the timestamps may be further modified by the muxer, after this. For example, in the case that the format option avoidnegativets is enabled. With -map you can select from which stream the timestamps should be taken. You can leave either video or audio unchanged and sync the remaining stream(s) to the unchanged one."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Frame drop threshold, which specifies how much behind video frames can be before they are dropped. In frame rate units, so 1.0 is one frame. The default is -1.1. One possible usecase is to avoid framedrops in case of noisy timestamps or to increase frame drop precision in case of exact timestamps."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Pad the output audio stream(s). This is the same as applying \"-af apad\". Argument is a string of filter parameters composed the same as with the \"apad\" filter. \"-shortest\" must be set for this output for the option to take effect."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Do not process input timestamps, but keep their values without trying to sanitize them. In particular, do not remove the initial start time offset value. Note that, depending on the vsync option or on specific muxer processing (e.g. in case the format option avoidnegativets is enabled) the output timestamps may mismatch with the input timestamps even when this option is selected."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "When used with copyts, shift input timestamps so they start at zero. This means that using e.g. \"-ss 50\" will make output timestamps start at 50 seconds, regardless of what timestamp the input file started at."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Specify how to set the encoder timebase when stream copying. mode is an integer numeric value, and can assume one of the following values: 1 Use the demuxer timebase. The time base is copied to the output encoder from the corresponding input demuxer. This is sometimes required to avoid non monotonically increasing timestamps when copying video streams with variable frame rate. 0 Use the decoder timebase. The time base is copied to the output encoder from the corresponding input decoder. -1 Try to make the choice automatically, in order to generate a sane output. Default value is -1."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set the encoder timebase. timebase can assume one of the following values: 0 Assign a default value according to the media type. For video - use 1/framerate, for audio - use 1/samplerate. demux Use the timebase from the demuxer. filter Use the timebase from the filtergraph. a positive number Use the provided number as the timebase. This field can be provided as a ratio of two integers (e.g. 1:24, 1:48000) or as a decimal number (e.g. 0.04166, 2.0833e-5) Default value is 0."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Enable bitexact mode for (de)muxer and (de/en)coder"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Finish encoding when the shortest output stream ends. Note that this option may require buffering frames, which introduces extra latency. The maximum amount of this latency may be controlled with the \"-shortestbufduration\" option."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "The \"-shortest\" option may require buffering potentially large amounts of data when at least one of the streams is \"sparse\" (i.e. has large gaps between frames – this is typically the case for subtitles). This option controls the maximum duration of buffered frames in seconds. Larger values may allow the \"-shortest\" option to produce more accurate results, but increase memory use and latency. The default value is 10 seconds."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Timestamp discontinuity delta threshold, expressed as a decimal number of seconds. The timestamp discontinuity correction enabled by this option is only applied to input formats accepting timestamp discontinuity (for which the \"AVFMTDISCONT\" flag is enabled), e.g. MPEG-TS and HLS, and is automatically disabled when employing the \"-copyts\" option (unless wrapping is detected). If a timestamp discontinuity is detected whose absolute value is greater than threshold, ffmpeg will remove the discontinuity by decreasing/increasing the current DTS and PTS by the corresponding delta value. The default value is 10."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Timestamp error delta threshold, expressed as a decimal number of seconds. The timestamp correction enabled by this option is only applied to input formats not accepting timestamp discontinuity (for which the \"AVFMTDISCONT\" flag is not enabled). If a timestamp discontinuity is detected whose absolute value is greater than threshold, ffmpeg will drop the PTS/DTS timestamp value. The default value is \"3600*30\" (30 hours), which is arbitrarily picked and quite conservative."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set the maximum demux-decode delay."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set the initial demux-decode delay."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Assign a new stream-id value to an output stream. This option should be specified prior to the output filename to which it applies. For the situation where multiple output files exist, a streamid may be reassigned to a different value. For example, to set the stream 0 PID to 33 and the stream 1 PID to 36 for an output mpegts file: ffmpeg -i inurl -streamid 0:33 -streamid 1:36 out.ts"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set bitstream filters for matching streams. bitstreamfilters is a comma-separated list of bitstream filters. Use the \"-bsfs\" option to get the list of bitstream filters. ffmpeg -i h264.mp4 -c:v copy -bsf:v h264mp4toannexb -an out.h264 ffmpeg -i file.mov -an -vn -bsf:s mov2textsub -c:s copy -f rawvideo sub.txt"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Force a tag/fourcc for matching streams."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Specify Timecode for writing. SEP is ':' for non drop timecode and ';' (or '.') for drop. ffmpeg -i input.mpg -timecode 01:02:03.04 -r 30000/1001 -s ntsc output.mpg"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Define a complex filtergraph, i.e. one with arbitrary number of inputs and/or outputs. For simple graphs -- those with one input and one output of the same type -- see the -filter options. filtergraph is a description of the filtergraph, as described in the ``Filtergraph syntax'' section of the ffmpeg-filters manual. Input link labels must refer to input streams using the \"[fileindex:streamspecifier]\" syntax (i.e. the same as -map uses). If streamspecifier matches multiple streams, the first one will be used. An unlabeled input will be connected to the first unused input stream of the matching type. Output link labels are referred to with -map. Unlabeled outputs are added to the first output file. Note that with this option it is possible to use only lavfi sources without normal input files. For example, to overlay an image over video ffmpeg -i video.mkv -i image.png -filtercomplex '[0:v][1:v]overlay[out]' -map '[out]' out.mkv Here \"[0:v]\" refers to the first video stream in the first input file, which is linked to the first (main) input of the overlay filter. Similarly the first video stream in the second input is linked to the second (overlay) input of overlay. Assuming there is only one video stream in each input file, we can omit input labels, so the above is equivalent to ffmpeg -i video.mkv -i image.png -filtercomplex 'overlay[out]' -map '[out]' out.mkv Furthermore we can omit the output label and the single output from the filter graph will be added to the output file automatically, so we can simply write ffmpeg -i video.mkv -i image.png -filtercomplex 'overlay' out.mkv As a special exception, you can use a bitmap subtitle stream as input: it will be converted into a video with the same size as the largest video in the file, or 720x576 if no video is present. Note that this is an experimental and temporary solution. It will be removed once libavfilter has proper support for subtitles. For example, to hardcode subtitles on top of a DVB-T recording stored in MPEG-TS format, delaying the subtitles by 1 second: ffmpeg -i input.ts -filtercomplex \\ '[#0x2ef] setpts=PTS+1/TB [sub] ; [#0x2d0] [sub] overlay' \\ -sn -map '#0x2dc' output.mkv (0x2d0, 0x2dc and 0x2ef are the MPEG-TS PIDs of respectively the video, audio and subtitles streams; 0:0, 0:3 and 0:7 would have worked too) To generate 5 seconds of pure red video using lavfi \"color\" source: ffmpeg -filtercomplex 'color=c=red' -t 5 out.mkv"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Defines how many threads are used to process a filtercomplex graph. Similar to filterthreads but used for \"-filtercomplex\" graphs only. The default is the number of available CPUs."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Define a complex filtergraph, i.e. one with arbitrary number of inputs and/or outputs. Equivalent to -filtercomplex."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "This option is similar to -filtercomplex, the only difference is that its argument is the name of the file from which a complex filtergraph description is to be read."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "This option enables or disables accurate seeking in input files with the -ss option. It is enabled by default, so seeking is accurate when transcoding. Use -noaccurateseek to disable it, which may be useful e.g. when copying some streams and transcoding the others."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "This option enables or disables seeking by timestamp in input files with the -ss option. It is disabled by default. If enabled, the argument to the -ss option is considered an actual timestamp, and is not offset by the start time of the file. This matters only for files which do not start from timestamp 0, such as transport streams."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "For input, this option sets the maximum number of queued packets when reading from the file or device. With low latency / high rate live streams, packets may be discarded if they are not read in a timely manner; setting this value can force ffmpeg to use a separate input thread and read packets as soon as they arrive. By default ffmpeg only does this if multiple inputs are specified. For output, this option specified the maximum number of packets that may be queued to each muxing thread."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Print sdp information for an output stream to file. This allows dumping sdp information when at least one output isn't an rtp stream. (Requires at least one of the output formats to be rtp)."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Allows discarding specific streams or frames from streams. Any input stream can be fully discarded, using value \"all\" whereas selective discarding of frames from a stream occurs at the demuxer and is not supported by all demuxers. none Discard no frame. default Default, which discards no frames. noref Discard all non-reference frames. bidir Discard all bidirectional frames. nokey Discard all frames excepts keyframes. all Discard all frames."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Stop and abort on various conditions. The following flags are available: emptyoutput No packets were passed to the muxer, the output is empty. emptyoutputstream No packets were passed to the muxer in some of the output streams."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set fraction of decoding frame failures across all inputs which when crossed ffmpeg will return exit code 69. Crossing this threshold does not terminate processing. Range is a floating-point number between 0 to 1. Default is 2/3."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Stop and exit on error"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "When transcoding audio and/or video streams, ffmpeg will not begin writing into the output until it has one packet for each such stream. While waiting for that to happen, packets for other streams are buffered. This option sets the size of this buffer, in packets, for the matching output stream. The default value of this option should be high enough for most uses, so only touch this option if you are sure that you need it."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "This is a minimum threshold until which the muxing queue size is not taken into account. Defaults to 50 megabytes per stream, and is based on the overall size of packets passed to the muxer."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Enable automatically inserting format conversion filters in all filter graphs, including those defined by -vf, -af, -filtercomplex and -lavfi. If filter format negotiation requires a conversion, the initialization of the filters will fail. Conversions can still be performed by inserting the relevant conversion filter (scale, aresample) in the graph. On by default, to explicitly disable it you need to specify \"-noautoconversionfilters\"."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Declare the number of bits per raw sample in the given output stream to be value. Note that this option sets the information provided to the encoder/muxer, it does not change the stream to conform to this value. Setting values that do not match the stream properties may result in encoding failures or invalid output files."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Write per-frame encoding information about the matching streams into the file given by path. -statsencpre writes information about raw video or audio frames right before they are sent for encoding, while -statsencpost writes information about encoded packets as they are received from the encoder. -statsmuxpre writes information about packets just as they are about to be sent to the muxer. Every frame or packet produces one line in the specified file. The format of this line is controlled by -statsencprefmt / -statsencpostfmt / -statsmuxprefmt. When stats for multiple streams are written into a single file, the lines corresponding to different streams will be interleaved. The precise order of this interleaving is not specified and not guaranteed to remain stable between different invocations of the program, even with the same options."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Specify the format for the lines written with -statsencpre / -statsencpost / -statsmuxpre. formatspec is a string that may contain directives of the form {fmt}. formatspec is backslash-escaped --- use \\{, \\}, and \\\\ to write a literal {, }, or \\, respectively, into the output. The directives given with fmt may be one of the following: fidx Index of the output file. sidx Index of the output stream in the file. n Frame number. Pre-encoding: number of frames sent to the encoder so far. Post- encoding: number of packets received from the encoder so far. Muxing: number of packets submitted to the muxer for this stream so far. ni Input frame number. Index of the input frame (i.e. output by a decoder) that corresponds to this output frame or packet. -1 if unavailable. tb Timebase in which this frame/packet's timestamps are expressed, as a rational number num/den. Note that encoder and muxer may use different timebases. tbi Timebase for ptsi, as a rational number num/den. Available when ptsi is available, 0/1 otherwise. pts Presentation timestamp of the frame or packet, as an integer. Should be multiplied by the timebase to compute presentation time. ptsi Presentation timestamp of the input frame (see ni), as an integer. Should be multiplied by tbi to compute presentation time. Printed as (2^63 - 1 = 9223372036854775807) when not available. t Presentation time of the frame or packet, as a decimal number. Equal to pts multiplied by tb. ti Presentation time of the input frame (see ni), as a decimal number. Equal to ptsi multiplied by tbi. Printed as inf when not available. dts (packet) Decoding timestamp of the packet, as an integer. Should be multiplied by the timebase to compute presentation time. dt (packet) Decoding time of the frame or packet, as a decimal number. Equal to dts multiplied by tb. sn (frame,audio) Number of audio samples sent to the encoder so far. samp (frame,audio) Number of audio samples in the frame. size (packet) Size of the encoded packet in bytes. br (packet) Current bitrate in bits per second. Post-encoding only. abr (packet) Average bitrate for the whole stream so far, in bits per second, -1 if it cannot be determined at this point. Post-encoding only. Directives tagged with packet may only be used with -statsencpostfmt and -statsmuxprefmt. Directives tagged with frame may only be used with -statsencprefmt. Directives tagged with audio may only be used with audio streams. The default format strings are: pre-encoding {fidx} {sidx} {n} {t} post-encoding {fidx} {sidx} {n} {t} In the future, new items may be added to the end of the default formatting strings. Users who depend on the format staying exactly the same, should prescribe it manually. Note that stats for different streams written into the same file may have different formats."
        }
    ],
    "examples": [
        "If you specify the input format and device then ffmpeg can grab video and audio directly.",
        "ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 /tmp/out.mpg",
        "Or with an ALSA audio source (mono input, card id 1) instead of OSS:",
        "ffmpeg -f alsa -ac 1 -i hw:1 -f video4linux2 -i /dev/video0 /tmp/out.mpg",
        "Note that you must activate the right video source and channel before launching  ffmpeg  with",
        "any  TV  viewer such as <http://linux.bytesex.org/xawtv/> by Gerd Knorr. You also have to set",
        "the audio recording levels correctly with a standard mixer.",
        "Grab the X11 display with ffmpeg via",
        "ffmpeg -f x11grab -videosize cif -framerate 25 -i :0.0 /tmp/out.mpg",
        "0.0 is display.screen number of your X11 server, same as the DISPLAY environment variable.",
        "ffmpeg -f x11grab -videosize cif -framerate 25 -i :0.0+10,20 /tmp/out.mpg",
        "0.0 is display.screen number of your X11 server, same as the DISPLAY environment variable. 10",
        "is the x-offset and 20 the y-offset for the grabbing.",
        "Any supported file format and protocol can serve as input to ffmpeg:",
        "Examples:",
        "•   You can use YUV files as input:",
        "ffmpeg -i /tmp/test%d.Y /tmp/out.mpg",
        "It will use the files:",
        "/tmp/test0.Y, /tmp/test0.U, /tmp/test0.V,",
        "/tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc...",
        "The Y files use twice the resolution of the U and V files. They are  raw  files,  without",
        "header.  They can be generated by all decent video decoders. You must specify the size of",
        "the image with the -s option if ffmpeg cannot guess it.",
        "•   You can input from a raw YUV420P file:",
        "ffmpeg -i /tmp/test.yuv /tmp/out.avi",
        "test.yuv is a file containing raw YUV planar data. Each frame is composed of the Y  plane",
        "followed by the U and V planes at half vertical and horizontal resolution.",
        "•   You can output to a raw YUV420P file:",
        "ffmpeg -i mydivx.avi hugefile.yuv",
        "•   You can set several input files and output files:",
        "ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg",
        "Converts the audio file a.wav and the raw YUV video file a.yuv to MPEG file a.mpg.",
        "•   You can also do audio and video conversions at the same time:",
        "ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2",
        "Converts a.wav to MPEG audio at 22050 Hz sample rate.",
        "•   You can encode to several formats at the same time and define a mapping from input stream",
        "to output streams:",
        "ffmpeg -i /tmp/a.wav -map 0:a -b:a 64k /tmp/a.mp2 -map 0:a -b:a 128k /tmp/b.mp2",
        "Converts  a.wav  to  a.mp2  at  64  kbits  and  to  b.mp2 at 128 kbits. '-map file:index'",
        "specifies which input stream is used  for  each  output  stream,  in  the  order  of  the",
        "definition of output streams.",
        "•   You can transcode decrypted VOBs:",
        "ffmpeg -i snatch1.vob -f avi -c:v mpeg4 -b:v 800k -g 300 -bf 2 -c:a libmp3lame -b:a 128k snatch.avi",
        "This  is  a  typical DVD ripping example; the input is a VOB file, the output an AVI file",
        "with MPEG-4 video and MP3 audio. Note that in this command we use B-frames so the  MPEG-4",
        "stream  is  DivX5  compatible,  and  GOP size is 300 which means one intra frame every 10",
        "seconds for 29.97fps input video. Furthermore, the audio stream  is  MP3-encoded  so  you",
        "need  to  enable LAME support by passing \"--enable-libmp3lame\" to configure.  The mapping",
        "is particularly useful for DVD transcoding to get the desired audio language.",
        "NOTE: To see the supported input formats, use \"ffmpeg -demuxers\".",
        "•   You can extract images from a video, or create a video from many images:",
        "For extracting images from a video:",
        "ffmpeg -i foo.avi -r 1 -s WxH -f image2 foo-%03d.jpeg",
        "This will extract one video frame per second from the video and will output them in files",
        "named foo-001.jpeg, foo-002.jpeg, etc. Images will be rescaled to fit the new WxH values.",
        "If you want to extract just a limited number of frames, you can use the above command  in",
        "combination  with  the  \"-frames:v\"  or  \"-t\" option, or in combination with -ss to start",
        "extracting from a certain point in time.",
        "For creating a video from many images:",
        "ffmpeg -f image2 -framerate 12 -i foo-%03d.jpeg -s WxH foo.avi",
        "The syntax \"foo-%03d.jpeg\" specifies to use a decimal number  composed  of  three  digits",
        "padded with zeroes to express the sequence number. It is the same syntax supported by the",
        "C printf function, but only formats accepting a normal integer are suitable.",
        "When importing an image sequence, -i also supports expanding shell-like wildcard patterns",
        "(globbing) internally, by selecting the image2-specific \"-patterntype glob\" option.",
        "For example, for creating a video from filenames matching the glob pattern \"foo-*.jpeg\":",
        "ffmpeg -f image2 -patterntype glob -framerate 12 -i 'foo-*.jpeg' -s WxH foo.avi",
        "•   You can put many streams of the same type in the output:",
        "ffmpeg -i test1.avi -i test2.avi -map 1:1 -map 1:0 -map 0:1 -map 0:0 -c copy -y test12.nut",
        "The  resulting  output file test12.nut will contain the first four streams from the input",
        "files in reverse order.",
        "•   To force CBR video output:",
        "ffmpeg -i myfile.avi -b 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v",
        "•   The four options lmin, lmax, mblmin and mblmax use 'lambda' units, but you  may  use  the",
        "QP2LAMBDA constant to easily convert from 'q' units:",
        "ffmpeg -i src.ext -lmax 21*QP2LAMBDA dst.ext"
    ],
    "see_also": [
        {
            "name": "ffmpeg-all",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ffmpeg-all/1/json"
        },
        {
            "name": "ffplay",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ffplay/1/json"
        },
        {
            "name": "ffprobe",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ffprobe/1/json"
        },
        {
            "name": "ffmpeg-utils",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ffmpeg-utils/1/json"
        },
        {
            "name": "ffmpeg-scaler",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ffmpeg-scaler/1/json"
        },
        {
            "name": "ffmpeg-resampler",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ffmpeg-resampler/1/json"
        },
        {
            "name": "ffmpeg-codecs",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ffmpeg-codecs/1/json"
        },
        {
            "name": "ffmpeg-bitstream-filters",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ffmpeg-bitstream-filters/1/json"
        },
        {
            "name": "ffmpeg-formats",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ffmpeg-formats/1/json"
        },
        {
            "name": "ffmpeg-devices",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ffmpeg-devices/1/json"
        },
        {
            "name": "ffmpeg-protocols",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ffmpeg-protocols/1/json"
        },
        {
            "name": "ffmpeg-filters",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ffmpeg-filters/1/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Video conversion tool.",
        "examples": [
            {
                "description": "Extract the sound from a video and save it as MP3",
                "command": "ffmpeg -i {{path/to/video.mp4}} -vn {{path/to/sound.mp3}}"
            },
            {
                "description": "Transcode a FLAC file to Red Book CD format (44100kHz, 16bit)",
                "command": "ffmpeg -i {{path/to/input_audio.flac}} -ar 44100 -sample_fmt s16 {{path/to/output_audio.wav}}"
            },
            {
                "description": "Save a video as GIF, scaling the height to 1000px and setting framerate to 15",
                "command": "ffmpeg -i {{path/to/video.mp4}} {{-vf|-filter:v}} 'scale=-1:1000' -r 15 {{path/to/output.gif}}"
            },
            {
                "description": "Combine numbered images (`frame_1.jpg`, `frame_2.jpg`, etc) into a video or GIF",
                "command": "ffmpeg -i {{path/to/frame_%d.jpg}} -f image2 {{video.mpg|video.gif}}"
            },
            {
                "description": "Trim a video from a given start time mm:ss to an end time mm2:ss2 (omit the -to flag to trim till the end)",
                "command": "ffmpeg -i {{path/to/input_video.mp4}} -ss {{mm:ss}} -to {{mm2:ss2}} {{-c|-codec}} copy {{path/to/output_video.mp4}}"
            },
            {
                "description": "Convert AVI video to MP4. AAC Audio @ 128kbit, h264 Video @ CRF 23",
                "command": "ffmpeg -i {{path/to/input_video}}.avi {{-c|-codec}}:a aac -b:a 128k {{-c|-codec}}:v libx264 -crf 23 {{path/to/output_video}}.mp4"
            },
            {
                "description": "Remux MKV video to MP4 without re-encoding audio or video streams",
                "command": "ffmpeg -i {{path/to/input_video}}.mkv {{-c|-codec}} copy {{path/to/output_video}}.mp4"
            },
            {
                "description": "Convert MP4 video to VP9 codec. For the best quality, use a CRF value (recommended range 15-35) and -b:v MUST be 0",
                "command": "ffmpeg -i {{path/to/input_video}}.mp4 {{-c|-codec}}:v libvpx-vp9 -crf {{30}} -b:v 0 {{-c|-codec}}:a libopus -vbr on -threads {{number_of_threads}} {{path/to/output_video}}.webm"
            }
        ]
    }
}