Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

  1. =encoding utf8
  2.  
  3. =head1 NAME
  4.  
  5. ffmpeg-formats - FFmpeg formats
  6.  
  7. =head1 DESCRIPTION
  8.  
  9.  
  10. This document describes the supported formats (muxers and demuxers)
  11. provided by the libavformat library.
  12.  
  13.  
  14.  
  15. =head1 FORMAT OPTIONS
  16.  
  17.  
  18. The libavformat library provides some generic global options, which
  19. can be set on all the muxers and demuxers. In addition each muxer or
  20. demuxer may support so-called private options, which are specific for
  21. that component.
  22.  
  23. Options may be set by specifying -I<option> I<value> in the
  24. FFmpeg tools, or by setting the value explicitly in the
  25. C<AVFormatContext> options or using the F<libavutil/opt.h> API
  26. for programmatic use.
  27.  
  28. The list of supported options follows:
  29.  
  30.  
  31. =over 4
  32.  
  33.  
  34. =item B<avioflags> I<flags> B<(>I<input/output>B<)>
  35.  
  36. Possible values:
  37.  
  38. =over 4
  39.  
  40.  
  41. =item B<direct>
  42.  
  43. Reduce buffering.
  44.  
  45. =back
  46.  
  47.  
  48.  
  49. =item B<probesize> I<integer> B<(>I<input>B<)>
  50.  
  51. Set probing size in bytes, i.e. the size of the data to analyze to get
  52. stream information. A higher value will enable detecting more
  53. information in case it is dispersed into the stream, but will increase
  54. latency. Must be an integer not lesser than 32. It is 5000000 by default.
  55.  
  56.  
  57. =item B<packetsize> I<integer> B<(>I<output>B<)>
  58.  
  59. Set packet size.
  60.  
  61.  
  62. =item B<fflags> I<flags> B<(>I<input/output>B<)>
  63.  
  64. Set format flags.
  65.  
  66. Possible values:
  67.  
  68. =over 4
  69.  
  70.  
  71. =item B<ignidx>
  72.  
  73. Ignore index.
  74.  
  75. =item B<fastseek>
  76.  
  77. Enable fast, but inaccurate seeks for some formats.
  78.  
  79. =item B<genpts>
  80.  
  81. Generate PTS.
  82.  
  83. =item B<nofillin>
  84.  
  85. Do not fill in missing values that can be exactly calculated.
  86.  
  87. =item B<noparse>
  88.  
  89. Disable AVParsers, this needs C<+nofillin> too.
  90.  
  91. =item B<igndts>
  92.  
  93. Ignore DTS.
  94.  
  95. =item B<discardcorrupt>
  96.  
  97. Discard corrupted frames.
  98.  
  99. =item B<sortdts>
  100.  
  101. Try to interleave output packets by DTS.
  102.  
  103. =item B<keepside>
  104.  
  105. Do not merge side data.
  106.  
  107. =item B<latm>
  108.  
  109. Enable RTP MP4A-LATM payload.
  110.  
  111. =item B<nobuffer>
  112.  
  113. Reduce the latency introduced by optional buffering
  114.  
  115. =item B<bitexact>
  116.  
  117. Only write platform-, build- and time-independent data.
  118. This ensures that file and data checksums are reproducible and match between
  119. platforms. Its primary use is for regression testing.
  120.  
  121. =back
  122.  
  123.  
  124.  
  125. =item B<seek2any> I<integer> B<(>I<input>B<)>
  126.  
  127. Allow seeking to non-keyframes on demuxer level when supported if set to 1.
  128. Default is 0.
  129.  
  130.  
  131. =item B<analyzeduration> I<integer> B<(>I<input>B<)>
  132.  
  133. Specify how many microseconds are analyzed to probe the input. A
  134. higher value will enable detecting more accurate information, but will
  135. increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
  136.  
  137.  
  138. =item B<cryptokey> I<hexadecimal string> B<(>I<input>B<)>
  139.  
  140. Set decryption key.
  141.  
  142.  
  143. =item B<indexmem> I<integer> B<(>I<input>B<)>
  144.  
  145. Set max memory used for timestamp index (per stream).
  146.  
  147.  
  148. =item B<rtbufsize> I<integer> B<(>I<input>B<)>
  149.  
  150. Set max memory used for buffering real-time frames.
  151.  
  152.  
  153. =item B<fdebug> I<flags> B<(>I<input/output>B<)>
  154.  
  155. Print specific debug info.
  156.  
  157. Possible values:
  158.  
  159. =over 4
  160.  
  161.  
  162. =item B<ts>
  163.  
  164.  
  165. =back
  166.  
  167.  
  168.  
  169. =item B<max_delay> I<integer> B<(>I<input/output>B<)>
  170.  
  171. Set maximum muxing or demuxing delay in microseconds.
  172.  
  173.  
  174. =item B<fpsprobesize> I<integer> B<(>I<input>B<)>
  175.  
  176. Set number of frames used to probe fps.
  177.  
  178.  
  179. =item B<audio_preload> I<integer> B<(>I<output>B<)>
  180.  
  181. Set microseconds by which audio packets should be interleaved earlier.
  182.  
  183.  
  184. =item B<chunk_duration> I<integer> B<(>I<output>B<)>
  185.  
  186. Set microseconds for each chunk.
  187.  
  188.  
  189. =item B<chunk_size> I<integer> B<(>I<output>B<)>
  190.  
  191. Set size in bytes for each chunk.
  192.  
  193.  
  194. =item B<err_detect, f_err_detect> I<flags> B<(>I<input>B<)>
  195.  
  196. Set error detection flags. C<f_err_detect> is deprecated and
  197. should be used only via the B<ffmpeg> tool.
  198.  
  199. Possible values:
  200.  
  201. =over 4
  202.  
  203.  
  204. =item B<crccheck>
  205.  
  206. Verify embedded CRCs.
  207.  
  208. =item B<bitstream>
  209.  
  210. Detect bitstream specification deviations.
  211.  
  212. =item B<buffer>
  213.  
  214. Detect improper bitstream length.
  215.  
  216. =item B<explode>
  217.  
  218. Abort decoding on minor error detection.
  219.  
  220. =item B<careful>
  221.  
  222. Consider things that violate the spec and have not been seen in the
  223. wild as errors.
  224.  
  225. =item B<compliant>
  226.  
  227. Consider all spec non compliancies as errors.
  228.  
  229. =item B<aggressive>
  230.  
  231. Consider things that a sane encoder should not do as an error.
  232.  
  233. =back
  234.  
  235.  
  236.  
  237. =item B<max_interleave_delta> I<integer> B<(>I<output>B<)>
  238.  
  239. Set maximum buffering duration for interleaving. The duration is
  240. expressed in microseconds, and defaults to 1000000 (1 second).
  241.  
  242. To ensure all the streams are interleaved correctly, libavformat will
  243. wait until it has at least one packet for each stream before actually
  244. writing any packets to the output file. When some streams are
  245. "sparse" (i.e. there are large gaps between successive packets), this
  246. can result in excessive buffering.
  247.  
  248. This field specifies the maximum difference between the timestamps of the
  249. first and the last packet in the muxing queue, above which libavformat
  250. will output a packet regardless of whether it has queued a packet for all
  251. the streams.
  252.  
  253. If set to 0, libavformat will continue buffering packets until it has
  254. a packet for each stream, regardless of the maximum timestamp
  255. difference between the buffered packets.
  256.  
  257.  
  258. =item B<use_wallclock_as_timestamps> I<integer> B<(>I<input>B<)>
  259.  
  260. Use wallclock as timestamps.
  261.  
  262.  
  263. =item B<avoid_negative_ts> I<integer> B<(>I<output>B<)>
  264.  
  265.  
  266. Possible values:
  267.  
  268. =over 4
  269.  
  270.  
  271. =item B<make_non_negative>
  272.  
  273. Shift timestamps to make them non-negative.
  274. Also note that this affects only leading negative timestamps, and not
  275. non-monotonic negative timestamps.
  276.  
  277. =item B<make_zero>
  278.  
  279. Shift timestamps so that the first timestamp is 0.
  280.  
  281. =item B<auto (default)>
  282.  
  283. Enables shifting when required by the target format.
  284.  
  285. =item B<disabled>
  286.  
  287. Disables shifting of timestamp.
  288.  
  289. =back
  290.  
  291.  
  292. When shifting is enabled, all output timestamps are shifted by the
  293. same amount. Audio, video, and subtitles desynching and relative
  294. timestamp differences are preserved compared to how they would have
  295. been without shifting.
  296.  
  297.  
  298. =item B<skip_initial_bytes> I<integer> B<(>I<input>B<)>
  299.  
  300. Set number of bytes to skip before reading header and frames if set to 1.
  301. Default is 0.
  302.  
  303.  
  304. =item B<correct_ts_overflow> I<integer> B<(>I<input>B<)>
  305.  
  306. Correct single timestamp overflows if set to 1. Default is 1.
  307.  
  308.  
  309. =item B<flush_packets> I<integer> B<(>I<output>B<)>
  310.  
  311. Flush the underlying I/O stream after each packet. Default 1 enables it, and
  312. has the effect of reducing the latency; 0 disables it and may slightly
  313. increase performance in some cases.
  314.  
  315.  
  316. =item B<output_ts_offset> I<offset> B<(>I<output>B<)>
  317.  
  318. Set the output time offset.
  319.  
  320. I<offset> must be a time duration specification,
  321. see B<the Time duration section in the ffmpeg-utils(1) manual>.
  322.  
  323. The offset is added by the muxer to the output timestamps.
  324.  
  325. Specifying a positive offset means that the corresponding streams are
  326. delayed bt the time duration specified in I<offset>. Default value
  327. is C<0> (meaning that no offset is applied).
  328.  
  329.  
  330. =item B<format_whitelist> I<list> B<(>I<input>B<)>
  331.  
  332. "," separated List of allowed demuxers. By default all are allowed.
  333.  
  334.  
  335. =item B<dump_separator> I<string> B<(>I<input>B<)>
  336.  
  337. Separator used to separate the fields printed on the command line about the
  338. Stream parameters.
  339. For example to separate the fields with newlines and indention:
  340.        
  341.         ffprobe -dump_separator "
  342.                                   "  -i ~/videos/matrixbench_mpeg2.mpg
  343.  
  344.  
  345. =back
  346.  
  347.  
  348.  
  349.  
  350.  
  351. =head2 Format stream specifiers
  352.  
  353.  
  354. Format stream specifiers allow selection of one or more streams that
  355. match specific properties.
  356.  
  357. Possible forms of stream specifiers are:
  358.  
  359. =over 4
  360.  
  361.  
  362. =item I<stream_index>
  363.  
  364. Matches the stream with this index.
  365.  
  366.  
  367. =item I<stream_type>B<[:>I<stream_index>B<]>
  368.  
  369. I<stream_type> is one of following: 'v' for video, 'a' for audio,
  370. 's' for subtitle, 'd' for data, and 't' for attachments. If
  371. I<stream_index> is given, then it matches the stream number
  372. I<stream_index> of this type. Otherwise, it matches all streams of
  373. this type.
  374.  
  375.  
  376. =item B<p:>I<program_id>B<[:>I<stream_index>B<]>
  377.  
  378. If I<stream_index> is given, then it matches the stream with number
  379. I<stream_index> in the program with the id
  380. I<program_id>. Otherwise, it matches all streams in the program.
  381.  
  382.  
  383. =item B<#>I<stream_id>
  384.  
  385. Matches the stream by a format-specific ID.
  386.  
  387. =back
  388.  
  389.  
  390. The exact semantics of stream specifiers is defined by the
  391. C<avformat_match_stream_specifier()> function declared in the
  392. F<libavformat/avformat.h> header.
  393.  
  394.  
  395. =head1 DEMUXERS
  396.  
  397.  
  398. Demuxers are configured elements in FFmpeg that can read the
  399. multimedia streams from a particular type of file.
  400.  
  401. When you configure your FFmpeg build, all the supported demuxers
  402. are enabled by default. You can list all available ones using the
  403. configure option C<--list-demuxers>.
  404.  
  405. You can disable all the demuxers using the configure option
  406. C<--disable-demuxers>, and selectively enable a single demuxer with
  407. the option C<--enable-demuxer=I<DEMUXER>>, or disable it
  408. with the option C<--disable-demuxer=I<DEMUXER>>.
  409.  
  410. The option C<-formats> of the ff* tools will display the list of
  411. enabled demuxers.
  412.  
  413. The description of some of the currently available demuxers follows.
  414.  
  415.  
  416. =head2 aa
  417.  
  418.  
  419. Audible Format 2, 3, and 4 demuxer.
  420.  
  421. This demuxer is used to demux Audible Format 2, 3, and 4 (.aa) files.
  422.  
  423.  
  424. =head2 applehttp
  425.  
  426.  
  427. Apple HTTP Live Streaming demuxer.
  428.  
  429. This demuxer presents all AVStreams from all variant streams.
  430. The id field is set to the bitrate variant index number. By setting
  431. the discard flags on AVStreams (by pressing 'a' or 'v' in ffplay),
  432. the caller can decide which variant streams to actually receive.
  433. The total bitrate of the variant that the stream belongs to is
  434. available in a metadata key named "variant_bitrate".
  435.  
  436.  
  437. =head2 apng
  438.  
  439.  
  440. Animated Portable Network Graphics demuxer.
  441.  
  442. This demuxer is used to demux APNG files.
  443. All headers, but the PNG signature, up to (but not including) the first
  444. fcTL chunk are transmitted as extradata.
  445. Frames are then split as being all the chunks between two fcTL ones, or
  446. between the last fcTL and IEND chunks.
  447.  
  448.  
  449. =over 4
  450.  
  451.  
  452. =item B<-ignore_loop> I<bool>
  453.  
  454. Ignore the loop variable in the file if set.
  455.  
  456. =item B<-max_fps> I<int>
  457.  
  458. Maximum framerate in frames per second (0 for no limit).
  459.  
  460. =item B<-default_fps> I<int>
  461.  
  462. Default framerate in frames per second when none is specified in the file
  463. (0 meaning as fast as possible).
  464.  
  465. =back
  466.  
  467.  
  468.  
  469. =head2 asf
  470.  
  471.  
  472. Advanced Systems Format demuxer.
  473.  
  474. This demuxer is used to demux ASF files and MMS network streams.
  475.  
  476.  
  477. =over 4
  478.  
  479.  
  480. =item B<-no_resync_search> I<bool>
  481.  
  482. Do not try to resynchronize by looking for a certain optional start code.
  483.  
  484. =back
  485.  
  486.  
  487.  
  488.  
  489. =head2 concat
  490.  
  491.  
  492. Virtual concatenation script demuxer.
  493.  
  494. This demuxer reads a list of files and other directives from a text file and
  495. demuxes them one after the other, as if all their packet had been muxed
  496. together.
  497.  
  498. The timestamps in the files are adjusted so that the first file starts at 0
  499. and each next file starts where the previous one finishes. Note that it is
  500. done globally and may cause gaps if all streams do not have exactly the same
  501. length.
  502.  
  503. All files must have the same streams (same codecs, same time base, etc.).
  504.  
  505. The duration of each file is used to adjust the timestamps of the next file:
  506. if the duration is incorrect (because it was computed using the bit-rate or
  507. because the file is truncated, for example), it can cause artifacts. The
  508. C<duration> directive can be used to override the duration stored in
  509. each file.
  510.  
  511.  
  512. =head3 Syntax
  513.  
  514.  
  515. The script is a text file in extended-ASCII, with one directive per line.
  516. Empty lines, leading spaces and lines starting with '#' are ignored. The
  517. following directive is recognized:
  518.  
  519.  
  520. =over 4
  521.  
  522.  
  523.  
  524. =item B<C<file I<path>>>
  525.  
  526. Path to a file to read; special characters and spaces must be escaped with
  527. backslash or single quotes.
  528.  
  529. All subsequent file-related directives apply to that file.
  530.  
  531.  
  532. =item B<C<ffconcat version 1.0>>
  533.  
  534. Identify the script type and version. It also sets the B<safe> option
  535. to 1 if it was to its default -1.
  536.  
  537. To make FFmpeg recognize the format automatically, this directive must
  538. appears exactly as is (no extra space or byte-order-mark) on the very first
  539. line of the script.
  540.  
  541.  
  542. =item B<C<duration I<dur>>>
  543.  
  544. Duration of the file. This information can be specified from the file;
  545. specifying it here may be more efficient or help if the information from the
  546. file is not available or accurate.
  547.  
  548. If the duration is set for all files, then it is possible to seek in the
  549. whole concatenated video.
  550.  
  551.  
  552. =item B<C<inpoint I<timestamp>>>
  553.  
  554. In point of the file. When the demuxer opens the file it instantly seeks to the
  555. specified timestamp. Seeking is done so that all streams can be presented
  556. successfully at In point.
  557.  
  558. This directive works best with intra frame codecs, because for non-intra frame
  559. ones you will usually get extra packets before the actual In point and the
  560. decoded content will most likely contain frames before In point too.
  561.  
  562. For each file, packets before the file In point will have timestamps less than
  563. the calculated start timestamp of the file (negative in case of the first
  564. file), and the duration of the files (if not specified by the C<duration>
  565. directive) will be reduced based on their specified In point.
  566.  
  567. Because of potential packets before the specified In point, packet timestamps
  568. may overlap between two concatenated files.
  569.  
  570.  
  571. =item B<C<outpoint I<timestamp>>>
  572.  
  573. Out point of the file. When the demuxer reaches the specified decoding
  574. timestamp in any of the streams, it handles it as an end of file condition and
  575. skips the current and all the remaining packets from all streams.
  576.  
  577. Out point is exclusive, which means that the demuxer will not output packets
  578. with a decoding timestamp greater or equal to Out point.
  579.  
  580. This directive works best with intra frame codecs and formats where all streams
  581. are tightly interleaved. For non-intra frame codecs you will usually get
  582. additional packets with presentation timestamp after Out point therefore the
  583. decoded content will most likely contain frames after Out point too. If your
  584. streams are not tightly interleaved you may not get all the packets from all
  585. streams before Out point and you may only will be able to decode the earliest
  586. stream until Out point.
  587.  
  588. The duration of the files (if not specified by the C<duration>
  589. directive) will be reduced based on their specified Out point.
  590.  
  591.  
  592. =item B<C<file_packet_metadata I<key=value>>>
  593.  
  594. Metadata of the packets of the file. The specified metadata will be set for
  595. each file packet. You can specify this directive multiple times to add multiple
  596. metadata entries.
  597.  
  598.  
  599. =item B<C<stream>>
  600.  
  601. Introduce a stream in the virtual file.
  602. All subsequent stream-related directives apply to the last introduced
  603. stream.
  604. Some streams properties must be set in order to allow identifying the
  605. matching streams in the subfiles.
  606. If no streams are defined in the script, the streams from the first file are
  607. copied.
  608.  
  609.  
  610. =item B<C<exact_stream_id I<id>>>
  611.  
  612. Set the id of the stream.
  613. If this directive is given, the string with the corresponding id in the
  614. subfiles will be used.
  615. This is especially useful for MPEG-PS (VOB) files, where the order of the
  616. streams is not reliable.
  617.  
  618.  
  619. =back
  620.  
  621.  
  622.  
  623. =head3 Options
  624.  
  625.  
  626. This demuxer accepts the following option:
  627.  
  628.  
  629. =over 4
  630.  
  631.  
  632.  
  633. =item B<safe>
  634.  
  635. If set to 1, reject unsafe file paths. A file path is considered safe if it
  636. does not contain a protocol specification and is relative and all components
  637. only contain characters from the portable character set (letters, digits,
  638. period, underscore and hyphen) and have no period at the beginning of a
  639. component.
  640.  
  641. If set to 0, any file name is accepted.
  642.  
  643. The default is -1, it is equivalent to 1 if the format was automatically
  644. probed and 0 otherwise.
  645.  
  646.  
  647. =item B<auto_convert>
  648.  
  649. If set to 1, try to perform automatic conversions on packet data to make the
  650. streams concatenable.
  651. The default is 1.
  652.  
  653. Currently, the only conversion is adding the h264_mp4toannexb bitstream
  654. filter to H.264 streams in MP4 format. This is necessary in particular if
  655. there are resolution changes.
  656.  
  657.  
  658. =back
  659.  
  660.  
  661.  
  662. =head2 flv
  663.  
  664.  
  665. Adobe Flash Video Format demuxer.
  666.  
  667. This demuxer is used to demux FLV files and RTMP network streams.
  668.  
  669.  
  670. =over 4
  671.  
  672.  
  673. =item B<-flv_metadata> I<bool>
  674.  
  675. Allocate the streams according to the onMetaData array content.
  676.  
  677. =back
  678.  
  679.  
  680.  
  681. =head2 libgme
  682.  
  683.  
  684. The Game Music Emu library is a collection of video game music file emulators.
  685.  
  686. See E<lt>B<http://code.google.com/p/game-music-emu/>E<gt> for more information.
  687.  
  688. Some files have multiple tracks. The demuxer will pick the first track by
  689. default. The B<track_index> option can be used to select a different
  690. track. Track indexes start at 0. The demuxer exports the number of tracks as
  691. I<tracks> meta data entry.
  692.  
  693. For very large files, the B<max_size> option may have to be adjusted.
  694.  
  695.  
  696. =head2 libquvi
  697.  
  698.  
  699. Play media from Internet services using the quvi project.
  700.  
  701. The demuxer accepts a B<format> option to request a specific quality. It
  702. is by default set to I<best>.
  703.  
  704. See E<lt>B<http://quvi.sourceforge.net/>E<gt> for more information.
  705.  
  706. FFmpeg needs to be built with C<--enable-libquvi> for this demuxer to be
  707. enabled.
  708.  
  709.  
  710. =head2 gif
  711.  
  712.  
  713. Animated GIF demuxer.
  714.  
  715. It accepts the following options:
  716.  
  717.  
  718. =over 4
  719.  
  720.  
  721. =item B<min_delay>
  722.  
  723. Set the minimum valid delay between frames in hundredths of seconds.
  724. Range is 0 to 6000. Default value is 2.
  725.  
  726.  
  727. =item B<max_gif_delay>
  728.  
  729. Set the maximum valid delay between frames in hundredth of seconds.
  730. Range is 0 to 65535. Default value is 65535 (nearly eleven minutes),
  731. the maximum value allowed by the specification.
  732.  
  733.  
  734. =item B<default_delay>
  735.  
  736. Set the default delay between frames in hundredths of seconds.
  737. Range is 0 to 6000. Default value is 10.
  738.  
  739.  
  740. =item B<ignore_loop>
  741.  
  742. GIF files can contain information to loop a certain number of times (or
  743. infinitely). If B<ignore_loop> is set to 1, then the loop setting
  744. from the input will be ignored and looping will not occur. If set to 0,
  745. then looping will occur and will cycle the number of times according to
  746. the GIF. Default value is 1.
  747.  
  748. =back
  749.  
  750.  
  751. For example, with the overlay filter, place an infinitely looping GIF
  752. over another video:
  753.        
  754.         ffmpeg -i input.mp4 -ignore_loop 0 -i input.gif -filter_complex overlay=shortest=1 out.mkv
  755.  
  756.  
  757. Note that in the above example the shortest option for overlay filter is
  758. used to end the output video at the length of the shortest input file,
  759. which in this case is F<input.mp4> as the GIF in this example loops
  760. infinitely.
  761.  
  762.  
  763. =head2 image2
  764.  
  765.  
  766. Image file demuxer.
  767.  
  768. This demuxer reads from a list of image files specified by a pattern.
  769. The syntax and meaning of the pattern is specified by the
  770. option I<pattern_type>.
  771.  
  772. The pattern may contain a suffix which is used to automatically
  773. determine the format of the images contained in the files.
  774.  
  775. The size, the pixel format, and the format of each image must be the
  776. same for all the files in the sequence.
  777.  
  778. This demuxer accepts the following options:
  779.  
  780. =over 4
  781.  
  782.  
  783. =item B<framerate>
  784.  
  785. Set the frame rate for the video stream. It defaults to 25.
  786.  
  787. =item B<loop>
  788.  
  789. If set to 1, loop over the input. Default value is 0.
  790.  
  791. =item B<pattern_type>
  792.  
  793. Select the pattern type used to interpret the provided filename.
  794.  
  795. I<pattern_type> accepts one of the following values.
  796.  
  797. =over 4
  798.  
  799.  
  800. =item B<none>
  801.  
  802. Disable pattern matching, therefore the video will only contain the specified
  803. image. You should use this option if you do not want to create sequences from
  804. multiple images and your filenames may contain special pattern characters.
  805.  
  806. =item B<sequence>
  807.  
  808. Select a sequence pattern type, used to specify a sequence of files
  809. indexed by sequential numbers.
  810.  
  811. A sequence pattern may contain the string "%d" or "%0I<N>d", which
  812. specifies the position of the characters representing a sequential
  813. number in each filename matched by the pattern. If the form
  814. "%d0I<N>d" is used, the string representing the number in each
  815. filename is 0-padded and I<N> is the total number of 0-padded
  816. digits representing the number. The literal character '%' can be
  817. specified in the pattern with the string "%%".
  818.  
  819. If the sequence pattern contains "%d" or "%0I<N>d", the first filename of
  820. the file list specified by the pattern must contain a number
  821. inclusively contained between I<start_number> and
  822. I<start_number>+I<start_number_range>-1, and all the following
  823. numbers must be sequential.
  824.  
  825. For example the pattern "img-%03d.bmp" will match a sequence of
  826. filenames of the form F<img-001.bmp>, F<img-002.bmp>, ...,
  827. F<img-010.bmp>, etc.; the pattern "i%%m%%g-%d.jpg" will match a
  828. sequence of filenames of the form F<i%m%g-1.jpg>,
  829. F<i%m%g-2.jpg>, ..., F<i%m%g-10.jpg>, etc.
  830.  
  831. Note that the pattern must not necessarily contain "%d" or
  832. "%0I<N>d", for example to convert a single image file
  833. F<img.jpeg> you can employ the command:
  834.        
  835.         ffmpeg -i img.jpeg img.png
  836.  
  837.  
  838.  
  839. =item B<glob>
  840.  
  841. Select a glob wildcard pattern type.
  842.  
  843. The pattern is interpreted like a C<glob()> pattern. This is only
  844. selectable if libavformat was compiled with globbing support.
  845.  
  846.  
  847. =item B<glob_sequence> I<(deprecated, will be removed)>
  848.  
  849. Select a mixed glob wildcard/sequence pattern.
  850.  
  851. If your version of libavformat was compiled with globbing support, and
  852. the provided pattern contains at least one glob meta character among
  853. C<%*?[]{}> that is preceded by an unescaped "%", the pattern is
  854. interpreted like a C<glob()> pattern, otherwise it is interpreted
  855. like a sequence pattern.
  856.  
  857. All glob special characters C<%*?[]{}> must be prefixed
  858. with "%". To escape a literal "%" you shall use "%%".
  859.  
  860. For example the pattern C<foo-%*.jpeg> will match all the
  861. filenames prefixed by "foo-" and terminating with ".jpeg", and
  862. C<foo-%?%?%?.jpeg> will match all the filenames prefixed with
  863. "foo-", followed by a sequence of three characters, and terminating
  864. with ".jpeg".
  865.  
  866. This pattern type is deprecated in favor of I<glob> and
  867. I<sequence>.
  868.  
  869. =back
  870.  
  871.  
  872. Default value is I<glob_sequence>.
  873.  
  874. =item B<pixel_format>
  875.  
  876. Set the pixel format of the images to read. If not specified the pixel
  877. format is guessed from the first image file in the sequence.
  878.  
  879. =item B<start_number>
  880.  
  881. Set the index of the file matched by the image file pattern to start
  882. to read from. Default value is 0.
  883.  
  884. =item B<start_number_range>
  885.  
  886. Set the index interval range to check when looking for the first image
  887. file in the sequence, starting from I<start_number>. Default value
  888. is 5.
  889.  
  890. =item B<ts_from_file>
  891.  
  892. If set to 1, will set frame timestamp to modification time of image file. Note
  893. that monotonity of timestamps is not provided: images go in the same order as
  894. without this option. Default value is 0.
  895. If set to 2, will set frame timestamp to the modification time of the image file in
  896. nanosecond precision.
  897.  
  898. =item B<video_size>
  899.  
  900. Set the video size of the images to read. If not specified the video
  901. size is guessed from the first image file in the sequence.
  902.  
  903. =back
  904.  
  905.  
  906.  
  907. =head3 Examples
  908.  
  909.  
  910.  
  911. =over 4
  912.  
  913.  
  914. =item *
  915.  
  916. Use B<ffmpeg> for creating a video from the images in the file
  917. sequence F<img-001.jpeg>, F<img-002.jpeg>, ..., assuming an
  918. input frame rate of 10 frames per second:
  919.        
  920.         ffmpeg -framerate 10 -i 'img-%03d.jpeg' out.mkv
  921.  
  922.  
  923.  
  924. =item *
  925.  
  926. As above, but start by reading from a file with index 100 in the sequence:
  927.        
  928.         ffmpeg -framerate 10 -start_number 100 -i 'img-%03d.jpeg' out.mkv
  929.  
  930.  
  931.  
  932. =item *
  933.  
  934. Read images matching the "*.png" glob pattern , that is all the files
  935. terminating with the ".png" suffix:
  936.        
  937.         ffmpeg -framerate 10 -pattern_type glob -i "*.png" out.mkv
  938.  
  939.  
  940. =back
  941.  
  942.  
  943.  
  944. =head2 mpegts
  945.  
  946.  
  947. MPEG-2 transport stream demuxer.
  948.  
  949. This demuxer accepts the following options:
  950.  
  951. =over 4
  952.  
  953.  
  954. =item B<resync_size>
  955.  
  956. Set size limit for looking up a new synchronization. Default value is
  957. 65536.
  958.  
  959.  
  960. =item B<fix_teletext_pts>
  961.  
  962. Override teletext packet PTS and DTS values with the timestamps calculated
  963. from the PCR of the first program which the teletext stream is part of and is
  964. not discarded. Default value is 1, set this option to 0 if you want your
  965. teletext packet PTS and DTS values untouched.
  966.  
  967.  
  968. =item B<ts_packetsize>
  969.  
  970. Output option carrying the raw packet size in bytes.
  971. Show the detected raw packet size, cannot be set by the user.
  972.  
  973.  
  974. =item B<scan_all_pmts>
  975.  
  976. Scan and combine all PMTs. The value is an integer with value from -1
  977. to 1 (-1 means automatic setting, 1 means enabled, 0 means
  978. disabled). Default value is -1.
  979.  
  980. =back
  981.  
  982.  
  983.  
  984. =head2 rawvideo
  985.  
  986.  
  987. Raw video demuxer.
  988.  
  989. This demuxer allows one to read raw video data. Since there is no header
  990. specifying the assumed video parameters, the user must specify them
  991. in order to be able to decode the data correctly.
  992.  
  993. This demuxer accepts the following options:
  994.  
  995. =over 4
  996.  
  997.  
  998.  
  999. =item B<framerate>
  1000.  
  1001. Set input video frame rate. Default value is 25.
  1002.  
  1003.  
  1004. =item B<pixel_format>
  1005.  
  1006. Set the input video pixel format. Default value is C<yuv420p>.
  1007.  
  1008.  
  1009. =item B<video_size>
  1010.  
  1011. Set the input video size. This value must be specified explicitly.
  1012.  
  1013. =back
  1014.  
  1015.  
  1016. For example to read a rawvideo file F<input.raw> with
  1017. B<ffplay>, assuming a pixel format of C<rgb24>, a video
  1018. size of C<320x240>, and a frame rate of 10 images per second, use
  1019. the command:
  1020.        
  1021.         ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
  1022.  
  1023.  
  1024.  
  1025. =head2 sbg
  1026.  
  1027.  
  1028. SBaGen script demuxer.
  1029.  
  1030. This demuxer reads the script language used by SBaGen
  1031. E<lt>B<http://uazu.net/sbagen/>E<gt> to generate binaural beats sessions. A SBG
  1032. script looks like that:
  1033.        
  1034.         -SE
  1035.         a: 300-2.5/3 440+4.5/0
  1036.         b: 300-2.5/0 440+4.5/3
  1037.         off: -
  1038.         NOW      == a
  1039.         +0:07:00 == b
  1040.         +0:14:00 == a
  1041.         +0:21:00 == b
  1042.         +0:30:00    off
  1043.  
  1044.  
  1045. A SBG script can mix absolute and relative timestamps. If the script uses
  1046. either only absolute timestamps (including the script start time) or only
  1047. relative ones, then its layout is fixed, and the conversion is
  1048. straightforward. On the other hand, if the script mixes both kind of
  1049. timestamps, then the I<NOW> reference for relative timestamps will be
  1050. taken from the current time of day at the time the script is read, and the
  1051. script layout will be frozen according to that reference. That means that if
  1052. the script is directly played, the actual times will match the absolute
  1053. timestamps up to the sound controller's clock accuracy, but if the user
  1054. somehow pauses the playback or seeks, all times will be shifted accordingly.
  1055.  
  1056.  
  1057. =head2 tedcaptions
  1058.  
  1059.  
  1060. JSON captions used for E<lt>B<http://www.ted.com/>E<gt>.
  1061.  
  1062. TED does not provide links to the captions, but they can be guessed from the
  1063. page. The file F<tools/bookmarklets.html> from the FFmpeg source tree
  1064. contains a bookmarklet to expose them.
  1065.  
  1066. This demuxer accepts the following option:
  1067.  
  1068. =over 4
  1069.  
  1070.  
  1071. =item B<start_time>
  1072.  
  1073. Set the start time of the TED talk, in milliseconds. The default is 15000
  1074. (15s). It is used to sync the captions with the downloadable videos, because
  1075. they include a 15s intro.
  1076.  
  1077. =back
  1078.  
  1079.  
  1080. Example: convert the captions to a format most players understand:
  1081.        
  1082.         ffmpeg -i http://www.ted.com/talks/subtitles/id/1/lang/en talk1-en.srt
  1083.  
  1084.  
  1085.  
  1086. =head1 MUXERS
  1087.  
  1088.  
  1089. Muxers are configured elements in FFmpeg which allow writing
  1090. multimedia streams to a particular type of file.
  1091.  
  1092. When you configure your FFmpeg build, all the supported muxers
  1093. are enabled by default. You can list all available muxers using the
  1094. configure option C<--list-muxers>.
  1095.  
  1096. You can disable all the muxers with the configure option
  1097. C<--disable-muxers> and selectively enable / disable single muxers
  1098. with the options C<--enable-muxer=I<MUXER>> /
  1099. C<--disable-muxer=I<MUXER>>.
  1100.  
  1101. The option C<-formats> of the ff* tools will display the list of
  1102. enabled muxers.
  1103.  
  1104. A description of some of the currently available muxers follows.
  1105.  
  1106.  
  1107.  
  1108. =head2 aiff
  1109.  
  1110.  
  1111. Audio Interchange File Format muxer.
  1112.  
  1113.  
  1114. =head3 Options
  1115.  
  1116.  
  1117. It accepts the following options:
  1118.  
  1119.  
  1120. =over 4
  1121.  
  1122.  
  1123. =item B<write_id3v2>
  1124.  
  1125. Enable ID3v2 tags writing when set to 1. Default is 0 (disabled).
  1126.  
  1127.  
  1128. =item B<id3v2_version>
  1129.  
  1130. Select ID3v2 version to write. Currently only version 3 and 4 (aka.
  1131. ID3v2.3 and ID3v2.4) are supported. The default is version 4.
  1132.  
  1133.  
  1134. =back
  1135.  
  1136.  
  1137.  
  1138.  
  1139. =head2 crc
  1140.  
  1141.  
  1142. CRC (Cyclic Redundancy Check) testing format.
  1143.  
  1144. This muxer computes and prints the Adler-32 CRC of all the input audio
  1145. and video frames. By default audio frames are converted to signed
  1146. 16-bit raw audio and video frames to raw video before computing the
  1147. CRC.
  1148.  
  1149. The output of the muxer consists of a single line of the form:
  1150. CRC=0xI<CRC>, where I<CRC> is a hexadecimal number 0-padded to
  1151. 8 digits containing the CRC for all the decoded input frames.
  1152.  
  1153. See also the B<framecrc> muxer.
  1154.  
  1155.  
  1156. =head3 Examples
  1157.  
  1158.  
  1159. For example to compute the CRC of the input, and store it in the file
  1160. F<out.crc>:
  1161.        
  1162.         ffmpeg -i INPUT -f crc out.crc
  1163.  
  1164.  
  1165. You can print the CRC to stdout with the command:
  1166.        
  1167.         ffmpeg -i INPUT -f crc -
  1168.  
  1169.  
  1170. You can select the output format of each frame with B<ffmpeg> by
  1171. specifying the audio and video codec and format. For example to
  1172. compute the CRC of the input audio converted to PCM unsigned 8-bit
  1173. and the input video converted to MPEG-2 video, use the command:
  1174.        
  1175.         ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f crc -
  1176.  
  1177.  
  1178.  
  1179.  
  1180. =head2 framecrc
  1181.  
  1182.  
  1183. Per-packet CRC (Cyclic Redundancy Check) testing format.
  1184.  
  1185. This muxer computes and prints the Adler-32 CRC for each audio
  1186. and video packet. By default audio frames are converted to signed
  1187. 16-bit raw audio and video frames to raw video before computing the
  1188. CRC.
  1189.  
  1190. The output of the muxer consists of a line for each audio and video
  1191. packet of the form:
  1192.        
  1193.         <stream_index>, <packet_dts>, <packet_pts>, <packet_duration>, <packet_size>, 0x<CRC>
  1194.  
  1195.  
  1196. I<CRC> is a hexadecimal number 0-padded to 8 digits containing the
  1197. CRC of the packet.
  1198.  
  1199.  
  1200. =head3 Examples
  1201.  
  1202.  
  1203. For example to compute the CRC of the audio and video frames in
  1204. F<INPUT>, converted to raw audio and video packets, and store it
  1205. in the file F<out.crc>:
  1206.        
  1207.         ffmpeg -i INPUT -f framecrc out.crc
  1208.  
  1209.  
  1210. To print the information to stdout, use the command:
  1211.        
  1212.         ffmpeg -i INPUT -f framecrc -
  1213.  
  1214.  
  1215. With B<ffmpeg>, you can select the output format to which the
  1216. audio and video frames are encoded before computing the CRC for each
  1217. packet by specifying the audio and video codec. For example, to
  1218. compute the CRC of each decoded input audio frame converted to PCM
  1219. unsigned 8-bit and of each decoded input video frame converted to
  1220. MPEG-2 video, use the command:
  1221.        
  1222.         ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f framecrc -
  1223.  
  1224.  
  1225. See also the B<crc> muxer.
  1226.  
  1227.  
  1228.  
  1229. =head2 framemd5
  1230.  
  1231.  
  1232. Per-packet MD5 testing format.
  1233.  
  1234. This muxer computes and prints the MD5 hash for each audio
  1235. and video packet. By default audio frames are converted to signed
  1236. 16-bit raw audio and video frames to raw video before computing the
  1237. hash.
  1238.  
  1239. The output of the muxer consists of a line for each audio and video
  1240. packet of the form:
  1241.        
  1242.         <stream_index>, <packet_dts>, <packet_pts>, <packet_duration>, <packet_size>, <MD5>
  1243.  
  1244.  
  1245. I<MD5> is a hexadecimal number representing the computed MD5 hash
  1246. for the packet.
  1247.  
  1248.  
  1249. =head3 Examples
  1250.  
  1251.  
  1252. For example to compute the MD5 of the audio and video frames in
  1253. F<INPUT>, converted to raw audio and video packets, and store it
  1254. in the file F<out.md5>:
  1255.        
  1256.         ffmpeg -i INPUT -f framemd5 out.md5
  1257.  
  1258.  
  1259. To print the information to stdout, use the command:
  1260.        
  1261.         ffmpeg -i INPUT -f framemd5 -
  1262.  
  1263.  
  1264. See also the B<md5> muxer.
  1265.  
  1266.  
  1267.  
  1268. =head2 gif
  1269.  
  1270.  
  1271. Animated GIF muxer.
  1272.  
  1273. It accepts the following options:
  1274.  
  1275.  
  1276. =over 4
  1277.  
  1278.  
  1279. =item B<loop>
  1280.  
  1281. Set the number of times to loop the output. Use C<-1> for no loop, C<0>
  1282. for looping indefinitely (default).
  1283.  
  1284.  
  1285. =item B<final_delay>
  1286.  
  1287. Force the delay (expressed in centiseconds) after the last frame. Each frame
  1288. ends with a delay until the next frame. The default is C<-1>, which is a
  1289. special value to tell the muxer to re-use the previous delay. In case of a
  1290. loop, you might want to customize this value to mark a pause for instance.
  1291.  
  1292. =back
  1293.  
  1294.  
  1295. For example, to encode a gif looping 10 times, with a 5 seconds delay between
  1296. the loops:
  1297.        
  1298.         ffmpeg -i INPUT -loop 10 -final_delay 500 out.gif
  1299.  
  1300.  
  1301. Note 1: if you wish to extract the frames in separate GIF files, you need to
  1302. force the B<image2> muxer:
  1303.        
  1304.         ffmpeg -i INPUT -c:v gif -f image2 "out%d.gif"
  1305.  
  1306.  
  1307. Note 2: the GIF format has a very small time base: the delay between two frames
  1308. can not be smaller than one centi second.
  1309.  
  1310.  
  1311.  
  1312. =head2 hls
  1313.  
  1314.  
  1315. Apple HTTP Live Streaming muxer that segments MPEG-TS according to
  1316. the HTTP Live Streaming (HLS) specification.
  1317.  
  1318. It creates a playlist file, and one or more segment files. The output filename
  1319. specifies the playlist filename.
  1320.  
  1321. By default, the muxer creates a file for each segment produced. These files
  1322. have the same name as the playlist, followed by a sequential number and a
  1323. .ts extension.
  1324.  
  1325. For example, to convert an input file with B<ffmpeg>:
  1326.        
  1327.         ffmpeg -i in.nut out.m3u8
  1328.  
  1329. This example will produce the playlist, F<out.m3u8>, and segment files:
  1330. F<out0.ts>, F<out1.ts>, F<out2.ts>, etc.
  1331.  
  1332. See also the B<segment> muxer, which provides a more generic and
  1333. flexible implementation of a segmenter, and can be used to perform HLS
  1334. segmentation.
  1335.  
  1336.  
  1337. =head3 Options
  1338.  
  1339.  
  1340. This muxer supports the following options:
  1341.  
  1342.  
  1343. =over 4
  1344.  
  1345.  
  1346. =item B<hls_time> I<seconds>
  1347.  
  1348. Set the segment length in seconds. Default value is 2.
  1349.  
  1350.  
  1351. =item B<hls_list_size> I<size>
  1352.  
  1353. Set the maximum number of playlist entries. If set to 0 the list file
  1354. will contain all the segments. Default value is 5.
  1355.  
  1356.  
  1357. =item B<hls_ts_options> I<options_list>
  1358.  
  1359. Set output format options using a :-separated list of key=value
  1360. parameters. Values containing C<:> special characters must be
  1361. escaped.
  1362.  
  1363.  
  1364. =item B<hls_wrap> I<wrap>
  1365.  
  1366. Set the number after which the segment filename number (the number
  1367. specified in each segment file) wraps. If set to 0 the number will be
  1368. never wrapped. Default value is 0.
  1369.  
  1370. This option is useful to avoid to fill the disk with many segment
  1371. files, and limits the maximum number of segment files written to disk
  1372. to I<wrap>.
  1373.  
  1374.  
  1375. =item B<start_number> I<number>
  1376.  
  1377. Start the playlist sequence number from I<number>. Default value is
  1378. 0.
  1379.  
  1380.  
  1381. =item B<hls_allow_cache> I<allowcache>
  1382.  
  1383. Explicitly set whether the client MAY (1) or MUST NOT (0) cache media segments.
  1384.  
  1385.  
  1386. =item B<hls_base_url> I<baseurl>
  1387.  
  1388. Append I<baseurl> to every entry in the playlist.
  1389. Useful to generate playlists with absolute paths.
  1390.  
  1391. Note that the playlist sequence number must be unique for each segment
  1392. and it is not to be confused with the segment filename sequence number
  1393. which can be cyclic, for example if the B<wrap> option is
  1394. specified.
  1395.  
  1396.  
  1397. =item B<hls_segment_filename> I<filename>
  1398.  
  1399. Set the segment filename. Unless hls_flags single_file is set I<filename>
  1400. is used as a string format with the segment number:
  1401.        
  1402.         ffmpeg in.nut -hls_segment_filename 'file%03d.ts' out.m3u8
  1403.  
  1404. This example will produce the playlist, F<out.m3u8>, and segment files:
  1405. F<file000.ts>, F<file001.ts>, F<file002.ts>, etc.
  1406.  
  1407.  
  1408. =item B<hls_key_info_file> I<key_info_file>
  1409.  
  1410. Use the information in I<key_info_file> for segment encryption. The first
  1411. line of I<key_info_file> specifies the key URI written to the playlist. The
  1412. key URL is used to access the encryption key during playback. The second line
  1413. specifies the path to the key file used to obtain the key during the encryption
  1414. process. The key file is read as a single packed array of 16 octets in binary
  1415. format. The optional third line specifies the initialization vector (IV) as a
  1416. hexadecimal string to be used instead of the segment sequence number (default)
  1417. for encryption. Changes to I<key_info_file> will result in segment
  1418. encryption with the new key/IV and an entry in the playlist for the new key
  1419. URI/IV.
  1420.  
  1421. Key info file format:
  1422.        
  1423.         <key URI>
  1424.         <key file path>
  1425.         <IV> (optional)
  1426.  
  1427.  
  1428. Example key URIs:
  1429.        
  1430.         http://server/file.key
  1431.         /path/to/file.key
  1432.         file.key
  1433.  
  1434.  
  1435. Example key file paths:
  1436.        
  1437.         file.key
  1438.         /path/to/file.key
  1439.  
  1440.  
  1441. Example IV:
  1442.        
  1443.         0123456789ABCDEF0123456789ABCDEF
  1444.  
  1445.  
  1446. Key info file example:
  1447.        
  1448.         http://server/file.key
  1449.         /path/to/file.key
  1450.         0123456789ABCDEF0123456789ABCDEF
  1451.  
  1452.  
  1453. Example shell script:
  1454.        
  1455.         #!/bin/sh
  1456.         BASE_URL=${1:-'.'}
  1457.         openssl rand 16 > file.key
  1458.         echo $BASE_URL/file.key > file.keyinfo
  1459.         echo file.key >> file.keyinfo
  1460.         echo $(openssl rand -hex 16) >> file.keyinfo
  1461.         ffmpeg -f lavfi -re -i testsrc -c:v h264 -hls_flags delete_segments \
  1462.           -hls_key_info_file file.keyinfo out.m3u8
  1463.  
  1464.  
  1465.  
  1466. =item B<hls_flags single_file>
  1467.  
  1468. If this flag is set, the muxer will store all segments in a single MPEG-TS
  1469. file, and will use byte ranges in the playlist. HLS playlists generated with
  1470. this way will have the version number 4.
  1471. For example:
  1472.        
  1473.         ffmpeg -i in.nut -hls_flags single_file out.m3u8
  1474.  
  1475. Will produce the playlist, F<out.m3u8>, and a single segment file,
  1476. F<out.ts>.
  1477.  
  1478.  
  1479. =item B<hls_flags delete_segments>
  1480.  
  1481. Segment files removed from the playlist are deleted after a period of time
  1482. equal to the duration of the segment plus the duration of the playlist.
  1483.  
  1484. =back
  1485.  
  1486.  
  1487.  
  1488.  
  1489. =head2 ico
  1490.  
  1491.  
  1492. ICO file muxer.
  1493.  
  1494. Microsoft's icon file format (ICO) has some strict limitations that should be noted:
  1495.  
  1496.  
  1497. =over 4
  1498.  
  1499.  
  1500. =item *
  1501.  
  1502. Size cannot exceed 256 pixels in any dimension
  1503.  
  1504.  
  1505. =item *
  1506.  
  1507. Only BMP and PNG images can be stored
  1508.  
  1509.  
  1510. =item *
  1511.  
  1512. If a BMP image is used, it must be one of the following pixel formats:
  1513.        
  1514.         BMP Bit Depth      FFmpeg Pixel Format
  1515.         1bit               pal8
  1516.         4bit               pal8
  1517.         8bit               pal8
  1518.         16bit              rgb555le
  1519.         24bit              bgr24
  1520.         32bit              bgra
  1521.  
  1522.  
  1523.  
  1524. =item *
  1525.  
  1526. If a BMP image is used, it must use the BITMAPINFOHEADER DIB header
  1527.  
  1528.  
  1529. =item *
  1530.  
  1531. If a PNG image is used, it must use the rgba pixel format
  1532.  
  1533. =back
  1534.  
  1535.  
  1536.  
  1537.  
  1538. =head2 image2
  1539.  
  1540.  
  1541. Image file muxer.
  1542.  
  1543. The image file muxer writes video frames to image files.
  1544.  
  1545. The output filenames are specified by a pattern, which can be used to
  1546. produce sequentially numbered series of files.
  1547. The pattern may contain the string "%d" or "%0I<N>d", this string
  1548. specifies the position of the characters representing a numbering in
  1549. the filenames. If the form "%0I<N>d" is used, the string
  1550. representing the number in each filename is 0-padded to I<N>
  1551. digits. The literal character '%' can be specified in the pattern with
  1552. the string "%%".
  1553.  
  1554. If the pattern contains "%d" or "%0I<N>d", the first filename of
  1555. the file list specified will contain the number 1, all the following
  1556. numbers will be sequential.
  1557.  
  1558. The pattern may contain a suffix which is used to automatically
  1559. determine the format of the image files to write.
  1560.  
  1561. For example the pattern "img-%03d.bmp" will specify a sequence of
  1562. filenames of the form F<img-001.bmp>, F<img-002.bmp>, ...,
  1563. F<img-010.bmp>, etc.
  1564. The pattern "img%%-%d.jpg" will specify a sequence of filenames of the
  1565. form F<img%-1.jpg>, F<img%-2.jpg>, ..., F<img%-10.jpg>,
  1566. etc.
  1567.  
  1568.  
  1569. =head3 Examples
  1570.  
  1571.  
  1572. The following example shows how to use B<ffmpeg> for creating a
  1573. sequence of files F<img-001.jpeg>, F<img-002.jpeg>, ...,
  1574. taking one image every second from the input video:
  1575.        
  1576.         ffmpeg -i in.avi -vsync 1 -r 1 -f image2 'img-%03d.jpeg'
  1577.  
  1578.  
  1579. Note that with B<ffmpeg>, if the format is not specified with the
  1580. C<-f> option and the output filename specifies an image file
  1581. format, the image2 muxer is automatically selected, so the previous
  1582. command can be written as:
  1583.        
  1584.         ffmpeg -i in.avi -vsync 1 -r 1 'img-%03d.jpeg'
  1585.  
  1586.  
  1587. Note also that the pattern must not necessarily contain "%d" or
  1588. "%0I<N>d", for example to create a single image file
  1589. F<img.jpeg> from the input video you can employ the command:
  1590.        
  1591.         ffmpeg -i in.avi -f image2 -frames:v 1 img.jpeg
  1592.  
  1593.  
  1594. The B<strftime> option allows you to expand the filename with
  1595. date and time information. Check the documentation of
  1596. the C<strftime()> function for the syntax.
  1597.  
  1598. For example to generate image files from the C<strftime()>
  1599. "%Y-%m-%d_%H-%M-%S" pattern, the following B<ffmpeg> command
  1600. can be used:
  1601.        
  1602.         ffmpeg -f v4l2 -r 1 -i /dev/video0 -f image2 -strftime 1 "%Y-%m-%d_%H-%M-%S.jpg"
  1603.  
  1604.  
  1605.  
  1606. =head3 Options
  1607.  
  1608.  
  1609.  
  1610. =over 4
  1611.  
  1612.  
  1613. =item B<start_number>
  1614.  
  1615. Start the sequence from the specified number. Default value is 0.
  1616.  
  1617.  
  1618. =item B<update>
  1619.  
  1620. If set to 1, the filename will always be interpreted as just a
  1621. filename, not a pattern, and the corresponding file will be continuously
  1622. overwritten with new images. Default value is 0.
  1623.  
  1624.  
  1625. =item B<strftime>
  1626.  
  1627. If set to 1, expand the filename with date and time information from
  1628. C<strftime()>. Default value is 0.
  1629.  
  1630. =back
  1631.  
  1632.  
  1633. The image muxer supports the .Y.U.V image file format. This format is
  1634. special in that that each image frame consists of three files, for
  1635. each of the YUV420P components. To read or write this image file format,
  1636. specify the name of the '.Y' file. The muxer will automatically open the
  1637. '.U' and '.V' files as required.
  1638.  
  1639.  
  1640. =head2 matroska
  1641.  
  1642.  
  1643. Matroska container muxer.
  1644.  
  1645. This muxer implements the matroska and webm container specs.
  1646.  
  1647.  
  1648. =head3 Metadata
  1649.  
  1650.  
  1651. The recognized metadata settings in this muxer are:
  1652.  
  1653.  
  1654. =over 4
  1655.  
  1656.  
  1657. =item B<title>
  1658.  
  1659. Set title name provided to a single track.
  1660.  
  1661.  
  1662. =item B<language>
  1663.  
  1664. Specify the language of the track in the Matroska languages form.
  1665.  
  1666. The language can be either the 3 letters bibliographic ISO-639-2 (ISO
  1667. 639-2/B) form (like "fre" for French), or a language code mixed with a
  1668. country code for specialities in languages (like "fre-ca" for Canadian
  1669. French).
  1670.  
  1671.  
  1672. =item B<stereo_mode>
  1673.  
  1674. Set stereo 3D video layout of two views in a single video track.
  1675.  
  1676. The following values are recognized:
  1677.  
  1678. =over 4
  1679.  
  1680.  
  1681. =item B<mono>
  1682.  
  1683. video is not stereo
  1684.  
  1685. =item B<left_right>
  1686.  
  1687. Both views are arranged side by side, Left-eye view is on the left
  1688.  
  1689. =item B<bottom_top>
  1690.  
  1691. Both views are arranged in top-bottom orientation, Left-eye view is at bottom
  1692.  
  1693. =item B<top_bottom>
  1694.  
  1695. Both views are arranged in top-bottom orientation, Left-eye view is on top
  1696.  
  1697. =item B<checkerboard_rl>
  1698.  
  1699. Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first
  1700.  
  1701. =item B<checkerboard_lr>
  1702.  
  1703. Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first
  1704.  
  1705. =item B<row_interleaved_rl>
  1706.  
  1707. Each view is constituted by a row based interleaving, Right-eye view is first row
  1708.  
  1709. =item B<row_interleaved_lr>
  1710.  
  1711. Each view is constituted by a row based interleaving, Left-eye view is first row
  1712.  
  1713. =item B<col_interleaved_rl>
  1714.  
  1715. Both views are arranged in a column based interleaving manner, Right-eye view is first column
  1716.  
  1717. =item B<col_interleaved_lr>
  1718.  
  1719. Both views are arranged in a column based interleaving manner, Left-eye view is first column
  1720.  
  1721. =item B<anaglyph_cyan_red>
  1722.  
  1723. All frames are in anaglyph format viewable through red-cyan filters
  1724.  
  1725. =item B<right_left>
  1726.  
  1727. Both views are arranged side by side, Right-eye view is on the left
  1728.  
  1729. =item B<anaglyph_green_magenta>
  1730.  
  1731. All frames are in anaglyph format viewable through green-magenta filters
  1732.  
  1733. =item B<block_lr>
  1734.  
  1735. Both eyes laced in one Block, Left-eye view is first
  1736.  
  1737. =item B<block_rl>
  1738.  
  1739. Both eyes laced in one Block, Right-eye view is first
  1740.  
  1741. =back
  1742.  
  1743.  
  1744. =back
  1745.  
  1746.  
  1747. For example a 3D WebM clip can be created using the following command line:
  1748.        
  1749.         ffmpeg -i sample_left_right_clip.mpg -an -c:v libvpx -metadata stereo_mode=left_right -y stereo_clip.webm
  1750.  
  1751.  
  1752.  
  1753. =head3 Options
  1754.  
  1755.  
  1756. This muxer supports the following options:
  1757.  
  1758.  
  1759. =over 4
  1760.  
  1761.  
  1762. =item B<reserve_index_space>
  1763.  
  1764. By default, this muxer writes the index for seeking (called cues in Matroska
  1765. terms) at the end of the file, because it cannot know in advance how much space
  1766. to leave for the index at the beginning of the file. However for some use cases
  1767. -- e.g.  streaming where seeking is possible but slow -- it is useful to put the
  1768. index at the beginning of the file.
  1769.  
  1770. If this option is set to a non-zero value, the muxer will reserve a given amount
  1771. of space in the file header and then try to write the cues there when the muxing
  1772. finishes. If the available space does not suffice, muxing will fail. A safe size
  1773. for most use cases should be about 50kB per hour of video.
  1774.  
  1775. Note that cues are only written if the output is seekable and this option will
  1776. have no effect if it is not.
  1777.  
  1778. =back
  1779.  
  1780.  
  1781.  
  1782.  
  1783. =head2 md5
  1784.  
  1785.  
  1786. MD5 testing format.
  1787.  
  1788. This muxer computes and prints the MD5 hash of all the input audio
  1789. and video frames. By default audio frames are converted to signed
  1790. 16-bit raw audio and video frames to raw video before computing the
  1791. hash.
  1792.  
  1793. The output of the muxer consists of a single line of the form:
  1794. MD5=I<MD5>, where I<MD5> is a hexadecimal number representing
  1795. the computed MD5 hash.
  1796.  
  1797. For example to compute the MD5 hash of the input converted to raw
  1798. audio and video, and store it in the file F<out.md5>:
  1799.        
  1800.         ffmpeg -i INPUT -f md5 out.md5
  1801.  
  1802.  
  1803. You can print the MD5 to stdout with the command:
  1804.        
  1805.         ffmpeg -i INPUT -f md5 -
  1806.  
  1807.  
  1808. See also the B<framemd5> muxer.
  1809.  
  1810.  
  1811. =head2 mov, mp4, ismv
  1812.  
  1813.  
  1814. MOV/MP4/ISMV (Smooth Streaming) muxer.
  1815.  
  1816. The mov/mp4/ismv muxer supports fragmentation. Normally, a MOV/MP4
  1817. file has all the metadata about all packets stored in one location
  1818. (written at the end of the file, it can be moved to the start for
  1819. better playback by adding I<faststart> to the I<movflags>, or
  1820. using the B<qt-faststart> tool). A fragmented
  1821. file consists of a number of fragments, where packets and metadata
  1822. about these packets are stored together. Writing a fragmented
  1823. file has the advantage that the file is decodable even if the
  1824. writing is interrupted (while a normal MOV/MP4 is undecodable if
  1825. it is not properly finished), and it requires less memory when writing
  1826. very long files (since writing normal MOV/MP4 files stores info about
  1827. every single packet in memory until the file is closed). The downside
  1828. is that it is less compatible with other applications.
  1829.  
  1830.  
  1831. =head3 Options
  1832.  
  1833.  
  1834. Fragmentation is enabled by setting one of the AVOptions that define
  1835. how to cut the file into fragments:
  1836.  
  1837.  
  1838. =over 4
  1839.  
  1840.  
  1841. =item B<-moov_size> I<bytes>
  1842.  
  1843. Reserves space for the moov atom at the beginning of the file instead of placing the
  1844. moov atom at the end. If the space reserved is insufficient, muxing will fail.
  1845.  
  1846. =item B<-movflags frag_keyframe>
  1847.  
  1848. Start a new fragment at each video keyframe.
  1849.  
  1850. =item B<-frag_duration> I<duration>
  1851.  
  1852. Create fragments that are I<duration> microseconds long.
  1853.  
  1854. =item B<-frag_size> I<size>
  1855.  
  1856. Create fragments that contain up to I<size> bytes of payload data.
  1857.  
  1858. =item B<-movflags frag_custom>
  1859.  
  1860. Allow the caller to manually choose when to cut fragments, by
  1861. calling C<av_write_frame(ctx, NULL)> to write a fragment with
  1862. the packets written so far. (This is only useful with other
  1863. applications integrating libavformat, not from B<ffmpeg>.)
  1864.  
  1865. =item B<-min_frag_duration> I<duration>
  1866.  
  1867. Don't create fragments that are shorter than I<duration> microseconds long.
  1868.  
  1869. =back
  1870.  
  1871.  
  1872. If more than one condition is specified, fragments are cut when
  1873. one of the specified conditions is fulfilled. The exception to this is
  1874. C<-min_frag_duration>, which has to be fulfilled for any of the other
  1875. conditions to apply.
  1876.  
  1877. Additionally, the way the output file is written can be adjusted
  1878. through a few other options:
  1879.  
  1880.  
  1881. =over 4
  1882.  
  1883.  
  1884. =item B<-movflags empty_moov>
  1885.  
  1886. Write an initial moov atom directly at the start of the file, without
  1887. describing any samples in it. Generally, an mdat/moov pair is written
  1888. at the start of the file, as a normal MOV/MP4 file, containing only
  1889. a short portion of the file. With this option set, there is no initial
  1890. mdat atom, and the moov atom only describes the tracks but has
  1891. a zero duration.
  1892.  
  1893. This option is implicitly set when writing ismv (Smooth Streaming) files.
  1894.  
  1895. =item B<-movflags separate_moof>
  1896.  
  1897. Write a separate moof (movie fragment) atom for each track. Normally,
  1898. packets for all tracks are written in a moof atom (which is slightly
  1899. more efficient), but with this option set, the muxer writes one moof/mdat
  1900. pair for each track, making it easier to separate tracks.
  1901.  
  1902. This option is implicitly set when writing ismv (Smooth Streaming) files.
  1903.  
  1904. =item B<-movflags faststart>
  1905.  
  1906. Run a second pass moving the index (moov atom) to the beginning of the file.
  1907. This operation can take a while, and will not work in various situations such
  1908. as fragmented output, thus it is not enabled by default.
  1909.  
  1910. =item B<-movflags rtphint>
  1911.  
  1912. Add RTP hinting tracks to the output file.
  1913.  
  1914. =item B<-movflags disable_chpl>
  1915.  
  1916. Disable Nero chapter markers (chpl atom).  Normally, both Nero chapters
  1917. and a QuickTime chapter track are written to the file. With this option
  1918. set, only the QuickTime chapter track will be written. Nero chapters can
  1919. cause failures when the file is reprocessed with certain tagging programs, like
  1920. mp3Tag 2.61a and iTunes 11.3, most likely other versions are affected as well.
  1921.  
  1922. =item B<-movflags omit_tfhd_offset>
  1923.  
  1924. Do not write any absolute base_data_offset in tfhd atoms. This avoids
  1925. tying fragments to absolute byte positions in the file/streams.
  1926.  
  1927. =item B<-movflags default_base_moof>
  1928.  
  1929. Similarly to the omit_tfhd_offset, this flag avoids writing the
  1930. absolute base_data_offset field in tfhd atoms, but does so by using
  1931. the new default-base-is-moof flag instead. This flag is new from
  1932. 14496-12:2012. This may make the fragments easier to parse in certain
  1933. circumstances (avoiding basing track fragment location calculations
  1934. on the implicit end of the previous track fragment).
  1935.  
  1936. =back
  1937.  
  1938.  
  1939.  
  1940. =head3 Example
  1941.  
  1942.  
  1943. Smooth Streaming content can be pushed in real time to a publishing
  1944. point on IIS with this muxer. Example:
  1945.        
  1946.         ffmpeg -re <<normal input/transcoding options>> -movflags isml+frag_keyframe -f ismv http://server/publishingpoint.isml/Streams(Encoder1)
  1947.  
  1948.  
  1949.  
  1950. =head3 Audible AAX
  1951.  
  1952.  
  1953. Audible AAX files are encrypted M4B files, and they can be decrypted by specifying a 4 byte activation secret.
  1954.        
  1955.         ffmpeg -activation_bytes 1CEB00DA -i test.aax -vn -c:a copy output.mp4
  1956.  
  1957.  
  1958.  
  1959. =head2 mp3
  1960.  
  1961.  
  1962. The MP3 muxer writes a raw MP3 stream with the following optional features:
  1963.  
  1964. =over 4
  1965.  
  1966.  
  1967. =item *
  1968.  
  1969. An ID3v2 metadata header at the beginning (enabled by default). Versions 2.3 and
  1970. 2.4 are supported, the C<id3v2_version> private option controls which one is
  1971. used (3 or 4). Setting C<id3v2_version> to 0 disables the ID3v2 header
  1972. completely.
  1973.  
  1974. The muxer supports writing attached pictures (APIC frames) to the ID3v2 header.
  1975. The pictures are supplied to the muxer in form of a video stream with a single
  1976. packet. There can be any number of those streams, each will correspond to a
  1977. single APIC frame.  The stream metadata tags I<title> and I<comment> map
  1978. to APIC I<description> and I<picture type> respectively. See
  1979. E<lt>B<http://id3.org/id3v2.4.0-frames>E<gt> for allowed picture types.
  1980.  
  1981. Note that the APIC frames must be written at the beginning, so the muxer will
  1982. buffer the audio frames until it gets all the pictures. It is therefore advised
  1983. to provide the pictures as soon as possible to avoid excessive buffering.
  1984.  
  1985.  
  1986. =item *
  1987.  
  1988. A Xing/LAME frame right after the ID3v2 header (if present). It is enabled by
  1989. default, but will be written only if the output is seekable. The
  1990. C<write_xing> private option can be used to disable it.  The frame contains
  1991. various information that may be useful to the decoder, like the audio duration
  1992. or encoder delay.
  1993.  
  1994.  
  1995. =item *
  1996.  
  1997. A legacy ID3v1 tag at the end of the file (disabled by default). It may be
  1998. enabled with the C<write_id3v1> private option, but as its capabilities are
  1999. very limited, its usage is not recommended.
  2000.  
  2001. =back
  2002.  
  2003.  
  2004. Examples:
  2005.  
  2006. Write an mp3 with an ID3v2.3 header and an ID3v1 footer:
  2007.        
  2008.         ffmpeg -i INPUT -id3v2_version 3 -write_id3v1 1 out.mp3
  2009.  
  2010.  
  2011. To attach a picture to an mp3 file select both the audio and the picture stream
  2012. with C<map>:
  2013.        
  2014.         ffmpeg -i input.mp3 -i cover.png -c copy -map 0 -map 1
  2015.         -metadata:s:v title="Album cover" -metadata:s:v comment="Cover (Front)" out.mp3
  2016.  
  2017.  
  2018. Write a "clean" MP3 without any extra features:
  2019.        
  2020.         ffmpeg -i input.wav -write_xing 0 -id3v2_version 0 out.mp3
  2021.  
  2022.  
  2023.  
  2024. =head2 mpegts
  2025.  
  2026.  
  2027. MPEG transport stream muxer.
  2028.  
  2029. This muxer implements ISO 13818-1 and part of ETSI EN 300 468.
  2030.  
  2031. The recognized metadata settings in mpegts muxer are C<service_provider>
  2032. and C<service_name>. If they are not set the default for
  2033. C<service_provider> is "FFmpeg" and the default for
  2034. C<service_name> is "Service01".
  2035.  
  2036.  
  2037. =head3 Options
  2038.  
  2039.  
  2040. The muxer options are:
  2041.  
  2042.  
  2043. =over 4
  2044.  
  2045.  
  2046. =item B<-mpegts_original_network_id> I<number>
  2047.  
  2048. Set the original_network_id (default 0x0001). This is unique identifier
  2049. of a network in DVB. Its main use is in the unique identification of a
  2050. service through the path Original_Network_ID, Transport_Stream_ID.
  2051.  
  2052. =item B<-mpegts_transport_stream_id> I<number>
  2053.  
  2054. Set the transport_stream_id (default 0x0001). This identifies a
  2055. transponder in DVB.
  2056.  
  2057. =item B<-mpegts_service_id> I<number>
  2058.  
  2059. Set the service_id (default 0x0001) also known as program in DVB.
  2060.  
  2061. =item B<-mpegts_service_type> I<number>
  2062.  
  2063. Set the program service_type (default I<digital_tv>), see below
  2064. a list of pre defined values.
  2065.  
  2066. =item B<-mpegts_pmt_start_pid> I<number>
  2067.  
  2068. Set the first PID for PMT (default 0x1000, max 0x1f00).
  2069.  
  2070. =item B<-mpegts_start_pid> I<number>
  2071.  
  2072. Set the first PID for data packets (default 0x0100, max 0x0f00).
  2073.  
  2074. =item B<-mpegts_m2ts_mode> I<number>
  2075.  
  2076. Enable m2ts mode if set to 1. Default value is -1 which disables m2ts mode.
  2077.  
  2078. =item B<-muxrate> I<number>
  2079.  
  2080. Set a constant muxrate (default VBR).
  2081.  
  2082. =item B<-pcr_period> I<numer>
  2083.  
  2084. Override the default PCR retransmission time (default 20ms), ignored
  2085. if variable muxrate is selected.
  2086.  
  2087. =item B<pat_period> I<number>
  2088.  
  2089. Maximal time in seconds between PAT/PMT tables.
  2090.  
  2091. =item B<sdt_period> I<number>
  2092.  
  2093. Maximal time in seconds between SDT tables.
  2094.  
  2095. =item B<-pes_payload_size> I<number>
  2096.  
  2097. Set minimum PES packet payload in bytes.
  2098.  
  2099. =item B<-mpegts_flags> I<flags>
  2100.  
  2101. Set flags (see below).
  2102.  
  2103. =item B<-mpegts_copyts> I<number>
  2104.  
  2105. Preserve original timestamps, if value is set to 1. Default value is -1, which
  2106. results in shifting timestamps so that they start from 0.
  2107.  
  2108. =item B<-tables_version> I<number>
  2109.  
  2110. Set PAT, PMT and SDT version (default 0, valid values are from 0 to 31, inclusively).
  2111. This option allows updating stream structure so that standard consumer may
  2112. detect the change. To do so, reopen output AVFormatContext (in case of API
  2113. usage) or restart ffmpeg instance, cyclically changing tables_version value:
  2114.        
  2115.         ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udp://1.1.1.1:1111
  2116.         ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
  2117.         ...
  2118.         ffmpeg -i source3.ts -codec copy -f mpegts -tables_version 31 udp://1.1.1.1:1111
  2119.         ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udp://1.1.1.1:1111
  2120.         ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
  2121.         ...
  2122.  
  2123.  
  2124. =back
  2125.  
  2126.  
  2127. Option mpegts_service_type accepts the following values:
  2128.  
  2129.  
  2130. =over 4
  2131.  
  2132.  
  2133. =item B<hex_value>
  2134.  
  2135. Any hexdecimal value between 0x01 to 0xff as defined in ETSI 300 468.
  2136.  
  2137. =item B<digital_tv>
  2138.  
  2139. Digital TV service.
  2140.  
  2141. =item B<digital_radio>
  2142.  
  2143. Digital Radio service.
  2144.  
  2145. =item B<teletext>
  2146.  
  2147. Teletext service.
  2148.  
  2149. =item B<advanced_codec_digital_radio>
  2150.  
  2151. Advanced Codec Digital Radio service.
  2152.  
  2153. =item B<mpeg2_digital_hdtv>
  2154.  
  2155. MPEG2 Digital HDTV service.
  2156.  
  2157. =item B<advanced_codec_digital_sdtv>
  2158.  
  2159. Advanced Codec Digital SDTV service.
  2160.  
  2161. =item B<advanced_codec_digital_hdtv>
  2162.  
  2163. Advanced Codec Digital HDTV service.
  2164.  
  2165. =back
  2166.  
  2167.  
  2168. Option mpegts_flags may take a set of such flags:
  2169.  
  2170.  
  2171. =over 4
  2172.  
  2173.  
  2174. =item B<resend_headers>
  2175.  
  2176. Reemit PAT/PMT before writing the next packet.
  2177.  
  2178. =item B<latm>
  2179.  
  2180. Use LATM packetization for AAC.
  2181.  
  2182. =item B<pat_pmt_at_frames>
  2183.  
  2184. Reemit PAT and PMT at each video frame.
  2185.  
  2186. =back
  2187.  
  2188.  
  2189.  
  2190. =head3 Example
  2191.  
  2192.  
  2193.        
  2194.         ffmpeg -i file.mpg -c copy \
  2195.              -mpegts_original_network_id 0x1122 \
  2196.              -mpegts_transport_stream_id 0x3344 \
  2197.              -mpegts_service_id 0x5566 \
  2198.              -mpegts_pmt_start_pid 0x1500 \
  2199.              -mpegts_start_pid 0x150 \
  2200.              -metadata service_provider="Some provider" \
  2201.              -metadata service_name="Some Channel" \
  2202.              -y out.ts
  2203.  
  2204.  
  2205.  
  2206. =head2 mxf, mxf_d10
  2207.  
  2208.  
  2209. MXF muxer.
  2210.  
  2211.  
  2212. =head3 Options
  2213.  
  2214.  
  2215. The muxer options are:
  2216.  
  2217.  
  2218. =over 4
  2219.  
  2220.  
  2221. =item B<store_user_comments> I<bool>
  2222.  
  2223. Set if user comments should be stored if available or never.
  2224. IRT D-10 does not allow user comments. The default is thus to write them for
  2225. mxf but not for mxf_d10
  2226.  
  2227. =back
  2228.  
  2229.  
  2230.  
  2231. =head2 null
  2232.  
  2233.  
  2234. Null muxer.
  2235.  
  2236. This muxer does not generate any output file, it is mainly useful for
  2237. testing or benchmarking purposes.
  2238.  
  2239. For example to benchmark decoding with B<ffmpeg> you can use the
  2240. command:
  2241.        
  2242.         ffmpeg -benchmark -i INPUT -f null out.null
  2243.  
  2244.  
  2245. Note that the above command does not read or write the F<out.null>
  2246. file, but specifying the output file is required by the B<ffmpeg>
  2247. syntax.
  2248.  
  2249. Alternatively you can write the command as:
  2250.        
  2251.         ffmpeg -benchmark -i INPUT -f null -
  2252.  
  2253.  
  2254.  
  2255. =head2 nut
  2256.  
  2257.  
  2258.  
  2259. =over 4
  2260.  
  2261.  
  2262. =item B<-syncpoints> I<flags>
  2263.  
  2264. Change the syncpoint usage in nut:
  2265.  
  2266. =over 4
  2267.  
  2268.  
  2269. =item I<default> B<use the normal low-overhead seeking aids.>
  2270.  
  2271.  
  2272. =item I<none> B<do not use the syncpoints at all, reducing the overhead but making the stream non-seekable;>
  2273.  
  2274.     Use of this option is not recommended, as the resulting files are very damage
  2275.     sensitive and seeking is not possible. Also in general the overhead from
  2276.     syncpoints is negligible. Note, -C<write_index> 0 can be used to disable
  2277.     all growing data tables, allowing to mux endless streams with limited memory
  2278.     and without these disadvantages.
  2279.  
  2280. =item I<timestamped> B<extend the syncpoint with a wallclock field.>
  2281.  
  2282.  
  2283. =back
  2284.  
  2285. The I<none> and I<timestamped> flags are experimental.
  2286.  
  2287. =item B<-write_index> I<bool>
  2288.  
  2289. Write index at the end, the default is to write an index.
  2290.  
  2291. =back
  2292.  
  2293.  
  2294.        
  2295.         ffmpeg -i INPUT -f_strict experimental -syncpoints none - | processor
  2296.  
  2297.  
  2298.  
  2299. =head2 ogg
  2300.  
  2301.  
  2302. Ogg container muxer.
  2303.  
  2304.  
  2305. =over 4
  2306.  
  2307.  
  2308. =item B<-page_duration> I<duration>
  2309.  
  2310. Preferred page duration, in microseconds. The muxer will attempt to create
  2311. pages that are approximately I<duration> microseconds long. This allows the
  2312. user to compromise between seek granularity and container overhead. The default
  2313. is 1 second. A value of 0 will fill all segments, making pages as large as
  2314. possible. A value of 1 will effectively use 1 packet-per-page in most
  2315. situations, giving a small seek granularity at the cost of additional container
  2316. overhead.
  2317.  
  2318. =item B<-serial_offset> I<value>
  2319.  
  2320. Serial value from which to set the streams serial number.
  2321. Setting it to different and sufficiently large values ensures that the produced
  2322. ogg files can be safely chained.
  2323.  
  2324.  
  2325. =back
  2326.  
  2327.  
  2328.  
  2329.  
  2330. =head2 segment, stream_segment, ssegment
  2331.  
  2332.  
  2333. Basic stream segmenter.
  2334.  
  2335. This muxer outputs streams to a number of separate files of nearly
  2336. fixed duration. Output filename pattern can be set in a fashion
  2337. similar to B<image2>, or by using a C<strftime> template if
  2338. the B<strftime> option is enabled.
  2339.  
  2340. C<stream_segment> is a variant of the muxer used to write to
  2341. streaming output formats, i.e. which do not require global headers,
  2342. and is recommended for outputting e.g. to MPEG transport stream segments.
  2343. C<ssegment> is a shorter alias for C<stream_segment>.
  2344.  
  2345. Every segment starts with a keyframe of the selected reference stream,
  2346. which is set through the B<reference_stream> option.
  2347.  
  2348. Note that if you want accurate splitting for a video file, you need to
  2349. make the input key frames correspond to the exact splitting times
  2350. expected by the segmenter, or the segment muxer will start the new
  2351. segment with the key frame found next after the specified start
  2352. time.
  2353.  
  2354. The segment muxer works best with a single constant frame rate video.
  2355.  
  2356. Optionally it can generate a list of the created segments, by setting
  2357. the option I<segment_list>. The list type is specified by the
  2358. I<segment_list_type> option. The entry filenames in the segment
  2359. list are set by default to the basename of the corresponding segment
  2360. files.
  2361.  
  2362. See also the B<hls> muxer, which provides a more specific
  2363. implementation for HLS segmentation.
  2364.  
  2365.  
  2366. =head3 Options
  2367.  
  2368.  
  2369. The segment muxer supports the following options:
  2370.  
  2371.  
  2372. =over 4
  2373.  
  2374.  
  2375. =item B<reference_stream> I<specifier>
  2376.  
  2377. Set the reference stream, as specified by the string I<specifier>.
  2378. If I<specifier> is set to C<auto>, the reference is chosen
  2379. automatically. Otherwise it must be a stream specifier (see the ``Stream
  2380. specifiers'' chapter in the ffmpeg manual) which specifies the
  2381. reference stream. The default value is C<auto>.
  2382.  
  2383.  
  2384. =item B<segment_format> I<format>
  2385.  
  2386. Override the inner container format, by default it is guessed by the filename
  2387. extension.
  2388.  
  2389.  
  2390. =item B<segment_format_options> I<options_list>
  2391.  
  2392. Set output format options using a :-separated list of key=value
  2393. parameters. Values containing the C<:> special character must be
  2394. escaped.
  2395.  
  2396.  
  2397. =item B<segment_list> I<name>
  2398.  
  2399. Generate also a listfile named I<name>. If not specified no
  2400. listfile is generated.
  2401.  
  2402.  
  2403. =item B<segment_list_flags> I<flags>
  2404.  
  2405. Set flags affecting the segment list generation.
  2406.  
  2407. It currently supports the following flags:
  2408.  
  2409. =over 4
  2410.  
  2411.  
  2412. =item B<cache>
  2413.  
  2414. Allow caching (only affects M3U8 list files).
  2415.  
  2416.  
  2417. =item B<live>
  2418.  
  2419. Allow live-friendly file generation.
  2420.  
  2421. =back
  2422.  
  2423.  
  2424.  
  2425. =item B<segment_list_size> I<size>
  2426.  
  2427. Update the list file so that it contains at most I<size>
  2428. segments. If 0 the list file will contain all the segments. Default
  2429. value is 0.
  2430.  
  2431.  
  2432. =item B<segment_list_entry_prefix> I<prefix>
  2433.  
  2434. Prepend I<prefix> to each entry. Useful to generate absolute paths.
  2435. By default no prefix is applied.
  2436.  
  2437.  
  2438. =item B<segment_list_type> I<type>
  2439.  
  2440. Select the listing format.
  2441.  
  2442. The following values are recognized:
  2443.  
  2444. =over 4
  2445.  
  2446.  
  2447. =item B<flat>
  2448.  
  2449. Generate a flat list for the created segments, one segment per line.
  2450.  
  2451.  
  2452. =item B<csv, ext>
  2453.  
  2454. Generate a list for the created segments, one segment per line,
  2455. each line matching the format (comma-separated values):
  2456.        
  2457.         <segment_filename>,<segment_start_time>,<segment_end_time>
  2458.  
  2459.  
  2460. I<segment_filename> is the name of the output file generated by the
  2461. muxer according to the provided pattern. CSV escaping (according to
  2462. RFC4180) is applied if required.
  2463.  
  2464. I<segment_start_time> and I<segment_end_time> specify
  2465. the segment start and end time expressed in seconds.
  2466.  
  2467. A list file with the suffix C<".csv"> or C<".ext"> will
  2468. auto-select this format.
  2469.  
  2470. B<ext> is deprecated in favor or B<csv>.
  2471.  
  2472.  
  2473. =item B<ffconcat>
  2474.  
  2475. Generate an ffconcat file for the created segments. The resulting file
  2476. can be read using the FFmpeg B<concat> demuxer.
  2477.  
  2478. A list file with the suffix C<".ffcat"> or C<".ffconcat"> will
  2479. auto-select this format.
  2480.  
  2481.  
  2482. =item B<m3u8>
  2483.  
  2484. Generate an extended M3U8 file, version 3, compliant with
  2485. E<lt>B<http://tools.ietf.org/id/draft-pantos-http-live-streaming>E<gt>.
  2486.  
  2487. A list file with the suffix C<".m3u8"> will auto-select this format.
  2488.  
  2489. =back
  2490.  
  2491.  
  2492. If not specified the type is guessed from the list file name suffix.
  2493.  
  2494.  
  2495. =item B<segment_time> I<time>
  2496.  
  2497. Set segment duration to I<time>, the value must be a duration
  2498. specification. Default value is "2". See also the
  2499. B<segment_times> option.
  2500.  
  2501. Note that splitting may not be accurate, unless you force the
  2502. reference stream key-frames at the given time. See the introductory
  2503. notice and the examples below.
  2504.  
  2505.  
  2506. =item B<segment_atclocktime> I<1|0>
  2507.  
  2508. If set to "1" split at regular clock time intervals starting from 00:00
  2509. o'clock. The I<time> value specified in B<segment_time> is
  2510. used for setting the length of the splitting interval.
  2511.  
  2512. For example with B<segment_time> set to "900" this makes it possible
  2513. to create files at 12:00 o'clock, 12:15, 12:30, etc.
  2514.  
  2515. Default value is "0".
  2516.  
  2517.  
  2518. =item B<segment_time_delta> I<delta>
  2519.  
  2520. Specify the accuracy time when selecting the start time for a
  2521. segment, expressed as a duration specification. Default value is "0".
  2522.  
  2523. When delta is specified a key-frame will start a new segment if its
  2524. PTS satisfies the relation:
  2525.        
  2526.         PTS >= start_time - time_delta
  2527.  
  2528.  
  2529. This option is useful when splitting video content, which is always
  2530. split at GOP boundaries, in case a key frame is found just before the
  2531. specified split time.
  2532.  
  2533. In particular may be used in combination with the F<ffmpeg> option
  2534. I<force_key_frames>. The key frame times specified by
  2535. I<force_key_frames> may not be set accurately because of rounding
  2536. issues, with the consequence that a key frame time may result set just
  2537. before the specified time. For constant frame rate videos a value of
  2538. 1/(2*I<frame_rate>) should address the worst case mismatch between
  2539. the specified time and the time set by I<force_key_frames>.
  2540.  
  2541.  
  2542. =item B<segment_times> I<times>
  2543.  
  2544. Specify a list of split points. I<times> contains a list of comma
  2545. separated duration specifications, in increasing order. See also
  2546. the B<segment_time> option.
  2547.  
  2548.  
  2549. =item B<segment_frames> I<frames>
  2550.  
  2551. Specify a list of split video frame numbers. I<frames> contains a
  2552. list of comma separated integer numbers, in increasing order.
  2553.  
  2554. This option specifies to start a new segment whenever a reference
  2555. stream key frame is found and the sequential number (starting from 0)
  2556. of the frame is greater or equal to the next value in the list.
  2557.  
  2558.  
  2559. =item B<segment_wrap> I<limit>
  2560.  
  2561. Wrap around segment index once it reaches I<limit>.
  2562.  
  2563.  
  2564. =item B<segment_start_number> I<number>
  2565.  
  2566. Set the sequence number of the first segment. Defaults to C<0>.
  2567.  
  2568.  
  2569. =item B<strftime> I<1|0>
  2570.  
  2571. Use the C<strftime> function to define the name of the new
  2572. segments to write. If this is selected, the output segment name must
  2573. contain a C<strftime> function template. Default value is
  2574. C<0>.
  2575.  
  2576.  
  2577. =item B<break_non_keyframes> I<1|0>
  2578.  
  2579. If enabled, allow segments to start on frames other than keyframes. This
  2580. improves behavior on some players when the time between keyframes is
  2581. inconsistent, but may make things worse on others, and can cause some oddities
  2582. during seeking. Defaults to C<0>.
  2583.  
  2584.  
  2585. =item B<reset_timestamps> I<1|0>
  2586.  
  2587. Reset timestamps at the begin of each segment, so that each segment
  2588. will start with near-zero timestamps. It is meant to ease the playback
  2589. of the generated segments. May not work with some combinations of
  2590. muxers/codecs. It is set to C<0> by default.
  2591.  
  2592.  
  2593. =item B<initial_offset> I<offset>
  2594.  
  2595. Specify timestamp offset to apply to the output packet timestamps. The
  2596. argument must be a time duration specification, and defaults to 0.
  2597.  
  2598. =back
  2599.  
  2600.  
  2601.  
  2602. =head3 Examples
  2603.  
  2604.  
  2605.  
  2606. =over 4
  2607.  
  2608.  
  2609. =item *
  2610.  
  2611. Remux the content of file F<in.mkv> to a list of segments
  2612. F<out-000.nut>, F<out-001.nut>, etc., and write the list of
  2613. generated segments to F<out.list>:
  2614.        
  2615.         ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.list out%03d.nut
  2616.  
  2617.  
  2618.  
  2619. =item *
  2620.  
  2621. Segment input and set output format options for the output segments:
  2622.        
  2623.         ffmpeg -i in.mkv -f segment -segment_time 10 -segment_format_options movflags=+faststart out%03d.mp4
  2624.  
  2625.  
  2626.  
  2627. =item *
  2628.  
  2629. Segment the input file according to the split points specified by the
  2630. I<segment_times> option:
  2631.        
  2632.         ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.csv -segment_times 1,2,3,5,8,13,21 out%03d.nut
  2633.  
  2634.  
  2635.  
  2636. =item *
  2637.  
  2638. Use the B<ffmpeg> B<force_key_frames>
  2639. option to force key frames in the input at the specified location, together
  2640. with the segment option B<segment_time_delta> to account for
  2641. possible roundings operated when setting key frame times.
  2642.        
  2643.         ffmpeg -i in.mkv -force_key_frames 1,2,3,5,8,13,21 -codec:v mpeg4 -codec:a pcm_s16le -map 0 \
  2644.         -f segment -segment_list out.csv -segment_times 1,2,3,5,8,13,21 -segment_time_delta 0.05 out%03d.nut
  2645.  
  2646. In order to force key frames on the input file, transcoding is
  2647. required.
  2648.  
  2649.  
  2650. =item *
  2651.  
  2652. Segment the input file by splitting the input file according to the
  2653. frame numbers sequence specified with the B<segment_frames> option:
  2654.        
  2655.         ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.csv -segment_frames 100,200,300,500,800 out%03d.nut
  2656.  
  2657.  
  2658.  
  2659. =item *
  2660.  
  2661. Convert the F<in.mkv> to TS segments using the C<libx264>
  2662. and C<libfaac> encoders:
  2663.        
  2664.         ffmpeg -i in.mkv -map 0 -codec:v libx264 -codec:a libfaac -f ssegment -segment_list out.list out%03d.ts
  2665.  
  2666.  
  2667.  
  2668. =item *
  2669.  
  2670. Segment the input file, and create an M3U8 live playlist (can be used
  2671. as live HLS source):
  2672.        
  2673.         ffmpeg -re -i in.mkv -codec copy -map 0 -f segment -segment_list playlist.m3u8 \
  2674.         -segment_list_flags +live -segment_time 10 out%03d.mkv
  2675.  
  2676.  
  2677. =back
  2678.  
  2679.  
  2680.  
  2681. =head2 smoothstreaming
  2682.  
  2683.  
  2684. Smooth Streaming muxer generates a set of files (Manifest, chunks) suitable for serving with conventional web server.
  2685.  
  2686.  
  2687. =over 4
  2688.  
  2689.  
  2690. =item B<window_size>
  2691.  
  2692. Specify the number of fragments kept in the manifest. Default 0 (keep all).
  2693.  
  2694.  
  2695. =item B<extra_window_size>
  2696.  
  2697. Specify the number of fragments kept outside of the manifest before removing from disk. Default 5.
  2698.  
  2699.  
  2700. =item B<lookahead_count>
  2701.  
  2702. Specify the number of lookahead fragments. Default 2.
  2703.  
  2704.  
  2705. =item B<min_frag_duration>
  2706.  
  2707. Specify the minimum fragment duration (in microseconds). Default 5000000.
  2708.  
  2709.  
  2710. =item B<remove_at_exit>
  2711.  
  2712. Specify whether to remove all fragments when finished. Default 0 (do not remove).
  2713.  
  2714.  
  2715. =back
  2716.  
  2717.  
  2718.  
  2719. =head2 tee
  2720.  
  2721.  
  2722. The tee muxer can be used to write the same data to several files or any
  2723. other kind of muxer. It can be used, for example, to both stream a video to
  2724. the network and save it to disk at the same time.
  2725.  
  2726. It is different from specifying several outputs to the B<ffmpeg>
  2727. command-line tool because the audio and video data will be encoded only once
  2728. with the tee muxer; encoding can be a very expensive process. It is not
  2729. useful when using the libavformat API directly because it is then possible
  2730. to feed the same packets to several muxers directly.
  2731.  
  2732. The slave outputs are specified in the file name given to the muxer,
  2733. separated by '|'. If any of the slave name contains the '|' separator,
  2734. leading or trailing spaces or any special character, it must be
  2735. escaped (see B<the "Quoting and escaping"
  2736. section in the ffmpeg-utils(1) manual>).
  2737.  
  2738. Muxer options can be specified for each slave by prepending them as a list of
  2739. I<key>=I<value> pairs separated by ':', between square brackets. If
  2740. the options values contain a special character or the ':' separator, they
  2741. must be escaped; note that this is a second level escaping.
  2742.  
  2743. The following special options are also recognized:
  2744.  
  2745. =over 4
  2746.  
  2747.  
  2748. =item B<f>
  2749.  
  2750. Specify the format name. Useful if it cannot be guessed from the
  2751. output name suffix.
  2752.  
  2753.  
  2754. =item B<bsfs[/>I<spec>B<]>
  2755.  
  2756. Specify a list of bitstream filters to apply to the specified
  2757. output.
  2758.  
  2759. It is possible to specify to which streams a given bitstream filter
  2760. applies, by appending a stream specifier to the option separated by
  2761. C</>. I<spec> must be a stream specifier (see B<Format
  2762. stream specifiers>).  If the stream specifier is not specified, the
  2763. bitstream filters will be applied to all streams in the output.
  2764.  
  2765. Several bitstream filters can be specified, separated by ",".
  2766.  
  2767.  
  2768. =item B<select>
  2769.  
  2770. Select the streams that should be mapped to the slave output,
  2771. specified by a stream specifier. If not specified, this defaults to
  2772. all the input streams.
  2773.  
  2774. =back
  2775.  
  2776.  
  2777.  
  2778. =head3 Examples
  2779.  
  2780.  
  2781.  
  2782. =over 4
  2783.  
  2784.  
  2785. =item *
  2786.  
  2787. Encode something and both archive it in a WebM file and stream it
  2788. as MPEG-TS over UDP (the streams need to be explicitly mapped):
  2789.        
  2790.         ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
  2791.           "archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/"
  2792.  
  2793.  
  2794.  
  2795. =item *
  2796.  
  2797. Use B<ffmpeg> to encode the input, and send the output
  2798. to three different destinations. The C<dump_extra> bitstream
  2799. filter is used to add extradata information to all the output video
  2800. keyframes packets, as requested by the MPEG-TS format. The select
  2801. option is applied to F<out.aac> in order to make it contain only
  2802. audio packets.
  2803.        
  2804.         ffmpeg -i ... -map 0 -flags +global_header -c:v libx264 -c:a aac -strict experimental
  2805.                -f tee "[bsfs/v=dump_extra]out.ts|[movflags=+faststart]out.mp4|[select=a]out.aac"
  2806.  
  2807.  
  2808.  
  2809. =item *
  2810.  
  2811. As below, but select only stream C<a:1> for the audio output. Note
  2812. that a second level escaping must be performed, as ":" is a special
  2813. character used to separate options.
  2814.        
  2815.         ffmpeg -i ... -map 0 -flags +global_header -c:v libx264 -c:a aac -strict experimental
  2816.                -f tee "[bsfs/v=dump_extra]out.ts|[movflags=+faststart]out.mp4|[select=\'a:1\']out.aac"
  2817.  
  2818.  
  2819. =back
  2820.  
  2821.  
  2822. Note: some codecs may need different options depending on the output format;
  2823. the auto-detection of this can not work with the tee muxer. The main example
  2824. is the B<global_header> flag.
  2825.  
  2826.  
  2827. =head2 webm_dash_manifest
  2828.  
  2829.  
  2830. WebM DASH Manifest muxer.
  2831.  
  2832. This muxer implements the WebM DASH Manifest specification to generate the DASH
  2833. manifest XML. It also supports manifest generation for DASH live streams.
  2834.  
  2835. For more information see:
  2836.  
  2837.  
  2838. =over 4
  2839.  
  2840.  
  2841. =item *
  2842.  
  2843. WebM DASH Specification: E<lt>B<https://sites.google.com/a/webmproject.org/wiki/adaptive-streaming/webm-dash-specification>E<gt>
  2844.  
  2845. =item *
  2846.  
  2847. ISO DASH Specification: E<lt>B<http://standards.iso.org/ittf/PubliclyAvailableStandards/c065274_ISO_IEC_23009-1_2014.zip>E<gt>
  2848.  
  2849. =back
  2850.  
  2851.  
  2852.  
  2853. =head3 Options
  2854.  
  2855.  
  2856. This muxer supports the following options:
  2857.  
  2858.  
  2859. =over 4
  2860.  
  2861.  
  2862. =item B<adaptation_sets>
  2863.  
  2864. This option has the following syntax: "id=x,streams=a,b,c id=y,streams=d,e" where x and y are the
  2865. unique identifiers of the adaptation sets and a,b,c,d and e are the indices of the corresponding
  2866. audio and video streams. Any number of adaptation sets can be added using this option.
  2867.  
  2868.  
  2869. =item B<live>
  2870.  
  2871. Set this to 1 to create a live stream DASH Manifest. Default: 0.
  2872.  
  2873.  
  2874. =item B<chunk_start_index>
  2875.  
  2876. Start index of the first chunk. This will go in the B<startNumber> attribute
  2877. of the B<SegmentTemplate> element in the manifest. Default: 0.
  2878.  
  2879.  
  2880. =item B<chunk_duration_ms>
  2881.  
  2882. Duration of each chunk in milliseconds. This will go in the B<duration>
  2883. attribute of the B<SegmentTemplate> element in the manifest. Default: 1000.
  2884.  
  2885.  
  2886. =item B<utc_timing_url>
  2887.  
  2888. URL of the page that will return the UTC timestamp in ISO format. This will go
  2889. in the B<value> attribute of the B<UTCTiming> element in the manifest.
  2890. Default: None.
  2891.  
  2892.  
  2893. =item B<time_shift_buffer_depth>
  2894.  
  2895. Smallest time (in seconds) shifting buffer for which any Representation is
  2896. guaranteed to be available. This will go in the B<timeShiftBufferDepth>
  2897. attribute of the B<MPD> element. Default: 60.
  2898.  
  2899.  
  2900. =item B<minimum_update_period>
  2901.  
  2902. Minimum update period (in seconds) of the manifest. This will go in the
  2903. B<minimumUpdatePeriod> attribute of the B<MPD> element. Default: 0.
  2904.  
  2905.  
  2906. =back
  2907.  
  2908.  
  2909.  
  2910. =head3 Example
  2911.  
  2912.        
  2913.         ffmpeg -f webm_dash_manifest -i video1.webm \
  2914.                -f webm_dash_manifest -i video2.webm \
  2915.                -f webm_dash_manifest -i audio1.webm \
  2916.                -f webm_dash_manifest -i audio2.webm \
  2917.                -map 0 -map 1 -map 2 -map 3 \
  2918.                -c copy \
  2919.                -f webm_dash_manifest \
  2920.                -adaptation_sets "id=0,streams=0,1 id=1,streams=2,3" \
  2921.                manifest.xml
  2922.  
  2923.  
  2924.  
  2925. =head2 webm_chunk
  2926.  
  2927.  
  2928. WebM Live Chunk Muxer.
  2929.  
  2930. This muxer writes out WebM headers and chunks as separate files which can be
  2931. consumed by clients that support WebM Live streams via DASH.
  2932.  
  2933.  
  2934. =head3 Options
  2935.  
  2936.  
  2937. This muxer supports the following options:
  2938.  
  2939.  
  2940. =over 4
  2941.  
  2942.  
  2943. =item B<chunk_start_index>
  2944.  
  2945. Index of the first chunk (defaults to 0).
  2946.  
  2947.  
  2948. =item B<header>
  2949.  
  2950. Filename of the header where the initialization data will be written.
  2951.  
  2952.  
  2953. =item B<audio_chunk_duration>
  2954.  
  2955. Duration of each audio chunk in milliseconds (defaults to 5000).
  2956.  
  2957. =back
  2958.  
  2959.  
  2960.  
  2961. =head3 Example
  2962.  
  2963.        
  2964.         ffmpeg -f v4l2 -i /dev/video0 \
  2965.                -f alsa -i hw:0 \
  2966.                -map 0:0 \
  2967.                -c:v libvpx-vp9 \
  2968.                -s 640x360 -keyint_min 30 -g 30 \
  2969.                -f webm_chunk \
  2970.                -header webm_live_video_360.hdr \
  2971.                -chunk_start_index 1 \
  2972.                webm_live_video_360_%d.chk \
  2973.                -map 1:0 \
  2974.                -c:a libvorbis \
  2975.                -b:a 128k \
  2976.                -f webm_chunk \
  2977.                -header webm_live_audio_128.hdr \
  2978.                -chunk_start_index 1 \
  2979.                -audio_chunk_duration 1000 \
  2980.                webm_live_audio_128_%d.chk
  2981.  
  2982.  
  2983.  
  2984. =head1 METADATA
  2985.  
  2986.  
  2987. FFmpeg is able to dump metadata from media files into a simple UTF-8-encoded
  2988. INI-like text file and then load it back using the metadata muxer/demuxer.
  2989.  
  2990. The file format is as follows:
  2991.  
  2992. =over 4
  2993.  
  2994.  
  2995.  
  2996. =item 1.
  2997.  
  2998. A file consists of a header and a number of metadata tags divided into sections,
  2999. each on its own line.
  3000.  
  3001.  
  3002. =item 2.
  3003.  
  3004. The header is a B<;FFMETADATA> string, followed by a version number (now 1).
  3005.  
  3006.  
  3007. =item 3.
  3008.  
  3009. Metadata tags are of the form B<key=value>
  3010.  
  3011.  
  3012. =item 4.
  3013.  
  3014. Immediately after header follows global metadata
  3015.  
  3016.  
  3017. =item 5.
  3018.  
  3019. After global metadata there may be sections with per-stream/per-chapter
  3020. metadata.
  3021.  
  3022.  
  3023. =item 6.
  3024.  
  3025. A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in
  3026. brackets (B<[>, B<]>) and ends with next section or end of file.
  3027.  
  3028.  
  3029. =item 7.
  3030.  
  3031. At the beginning of a chapter section there may be an optional timebase to be
  3032. used for start/end values. It must be in form
  3033. B<TIMEBASE=>I<num>B</>I<den>, where I<num> and I<den> are
  3034. integers. If the timebase is missing then start/end times are assumed to
  3035. be in milliseconds.
  3036.  
  3037. Next a chapter section must contain chapter start and end times in form
  3038. B<START=>I<num>, B<END=>I<num>, where I<num> is a positive
  3039. integer.
  3040.  
  3041.  
  3042. =item 8.
  3043.  
  3044. Empty lines and lines starting with B<;> or B<#> are ignored.
  3045.  
  3046.  
  3047. =item 9.
  3048.  
  3049. Metadata keys or values containing special characters (B<=>, B<;>,
  3050. B<#>, B<\> and a newline) must be escaped with a backslash B<\>.
  3051.  
  3052.  
  3053. =item 10.
  3054.  
  3055. Note that whitespace in metadata (e.g. B<foo = bar>) is considered to be
  3056. a part of the tag (in the example above key is B<foo> , value is
  3057.  B<bar>).
  3058.  
  3059. =back
  3060.  
  3061.  
  3062. A ffmetadata file might look like this:
  3063.        
  3064.         ;FFMETADATA1
  3065.         title=bike\\shed
  3066.         ;this is a comment
  3067.         artist=FFmpeg troll team
  3068.        
  3069.         [CHAPTER]
  3070.         TIMEBASE=1/1000
  3071.         START=0
  3072.         #chapter ends at 0:01:00
  3073.         END=60000
  3074.         title=chapter \#1
  3075.         [STREAM]
  3076.         title=multi\
  3077.         line
  3078.  
  3079.  
  3080. By using the ffmetadata muxer and demuxer it is possible to extract
  3081. metadata from an input file to an ffmetadata file, and then transcode
  3082. the file into an output file with the edited ffmetadata file.
  3083.  
  3084. Extracting an ffmetadata file with F<ffmpeg> goes as follows:
  3085.        
  3086.         ffmpeg -i INPUT -f ffmetadata FFMETADATAFILE
  3087.  
  3088.  
  3089. Reinserting edited metadata information from the FFMETADATAFILE file can
  3090. be done as:
  3091.        
  3092.         ffmpeg -i INPUT -i FFMETADATAFILE -map_metadata 1 -codec copy OUTPUT
  3093.  
  3094.  
  3095.  
  3096.  
  3097. =head1 SEE ALSO
  3098.  
  3099.  
  3100.  
  3101. ffmpeg(1), ffplay(1), ffprobe(1), ffserver(1), libavformat(3)
  3102.  
  3103.  
  3104. =head1 AUTHORS
  3105.  
  3106.  
  3107. The FFmpeg developers.
  3108.  
  3109. For details about the authorship, see the Git history of the project
  3110. (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
  3111. B<git log> in the FFmpeg source directory, or browsing the
  3112. online repository at E<lt>B<http://source.ffmpeg.org>E<gt>.
  3113.  
  3114. Maintainers for the specific components are listed in the file
  3115. F<MAINTAINERS> in the source code tree.
  3116.  
  3117.  
  3118.  
  3119.