yading@10: .\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) yading@10: .\" yading@10: .\" Standard preamble: yading@10: .\" ======================================================================== yading@10: .de Sp \" Vertical space (when we can't use .PP) yading@10: .if t .sp .5v yading@10: .if n .sp yading@10: .. yading@10: .de Vb \" Begin verbatim text yading@10: .ft CW yading@10: .nf yading@10: .ne \\$1 yading@10: .. yading@10: .de Ve \" End verbatim text yading@10: .ft R yading@10: .fi yading@10: .. yading@10: .\" Set up some character translations and predefined strings. \*(-- will yading@10: .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left yading@10: .\" double quote, and \*(R" will give a right double quote. \*(C+ will yading@10: .\" give a nicer C++. Capital omega is used to do unbreakable dashes and yading@10: .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, yading@10: .\" nothing in troff, for use with C<>. yading@10: .tr \(*W- yading@10: .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' yading@10: .ie n \{\ yading@10: . ds -- \(*W- yading@10: . ds PI pi yading@10: . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch yading@10: . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch yading@10: . ds L" "" yading@10: . ds R" "" yading@10: . ds C` "" yading@10: . ds C' "" yading@10: 'br\} yading@10: .el\{\ yading@10: . ds -- \|\(em\| yading@10: . ds PI \(*p yading@10: . ds L" `` yading@10: . ds R" '' yading@10: 'br\} yading@10: .\" yading@10: .\" Escape single quotes in literal strings from groff's Unicode transform. yading@10: .ie \n(.g .ds Aq \(aq yading@10: .el .ds Aq ' yading@10: .\" yading@10: .\" If the F register is turned on, we'll generate index entries on stderr for yading@10: .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index yading@10: .\" entries marked with X<> in POD. Of course, you'll have to process the yading@10: .\" output yourself in some meaningful fashion. yading@10: .ie \nF \{\ yading@10: . de IX yading@10: . tm Index:\\$1\t\\n%\t"\\$2" yading@10: .. yading@10: . nr % 0 yading@10: . rr F yading@10: .\} yading@10: .el \{\ yading@10: . de IX yading@10: .. yading@10: .\} yading@10: .\" yading@10: .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). yading@10: .\" Fear. Run. Save yourself. No user-serviceable parts. yading@10: . \" fudge factors for nroff and troff yading@10: .if n \{\ yading@10: . ds #H 0 yading@10: . ds #V .8m yading@10: . ds #F .3m yading@10: . ds #[ \f1 yading@10: . ds #] \fP yading@10: .\} yading@10: .if t \{\ yading@10: . ds #H ((1u-(\\\\n(.fu%2u))*.13m) yading@10: . ds #V .6m yading@10: . ds #F 0 yading@10: . ds #[ \& yading@10: . ds #] \& yading@10: .\} yading@10: . \" simple accents for nroff and troff yading@10: .if n \{\ yading@10: . ds ' \& yading@10: . ds ` \& yading@10: . ds ^ \& yading@10: . ds , \& yading@10: . ds ~ ~ yading@10: . ds / yading@10: .\} yading@10: .if t \{\ yading@10: . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" yading@10: . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' yading@10: . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' yading@10: . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' yading@10: . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' yading@10: . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' yading@10: .\} yading@10: . \" troff and (daisy-wheel) nroff accents yading@10: .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' yading@10: .ds 8 \h'\*(#H'\(*b\h'-\*(#H' yading@10: .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] yading@10: .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' yading@10: .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' yading@10: .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] yading@10: .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] yading@10: .ds ae a\h'-(\w'a'u*4/10)'e yading@10: .ds Ae A\h'-(\w'A'u*4/10)'E yading@10: . \" corrections for vroff yading@10: .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' yading@10: .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' yading@10: . \" for low resolution devices (crt and lpr) yading@10: .if \n(.H>23 .if \n(.V>19 \ yading@10: \{\ yading@10: . ds : e yading@10: . ds 8 ss yading@10: . ds o a yading@10: . ds d- d\h'-1'\(ga yading@10: . ds D- D\h'-1'\(hy yading@10: . ds th \o'bp' yading@10: . ds Th \o'LP' yading@10: . ds ae ae yading@10: . ds Ae AE yading@10: .\} yading@10: .rm #[ #] #H #V #F C yading@10: .\" ======================================================================== yading@10: .\" yading@10: .IX Title "FFMPEG-FORMATS 1" yading@10: .TH FFMPEG-FORMATS 1 "2013-04-21" " " " " yading@10: .\" For nroff, turn off justification. Always turn off hyphenation; it makes yading@10: .\" way too many mistakes in technical documents. yading@10: .if n .ad l yading@10: .nh yading@10: .SH "NAME" yading@10: ffmpeg\-formats \- FFmpeg formats yading@10: .SH "DESCRIPTION" yading@10: .IX Header "DESCRIPTION" yading@10: This document describes the supported formats (muxers and demuxers) yading@10: provided by the libavformat library. yading@10: .SH "FORMAT OPTIONS" yading@10: .IX Header "FORMAT OPTIONS" yading@10: The libavformat library provides some generic global options, which yading@10: can be set on all the muxers and demuxers. In addition each muxer or yading@10: demuxer may support so-called private options, which are specific for yading@10: that component. yading@10: .PP yading@10: Options may be set by specifying \-\fIoption\fR \fIvalue\fR in the yading@10: FFmpeg tools, or by setting the value explicitly in the yading@10: \&\f(CW\*(C`AVFormatContext\*(C'\fR options or using the \fIlibavutil/opt.h\fR \s-1API\s0 yading@10: for programmatic use. yading@10: .PP yading@10: The list of supported options follows: yading@10: .IP "\fBavioflags\fR \fIflags\fR \fB(\fR\fIinput/output\fR\fB)\fR" 4 yading@10: .IX Item "avioflags flags (input/output)" yading@10: Possible values: yading@10: .RS 4 yading@10: .IP "\fBdirect\fR" 4 yading@10: .IX Item "direct" yading@10: Reduce buffering. yading@10: .RE yading@10: .RS 4 yading@10: .RE yading@10: .IP "\fBprobesize\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4 yading@10: .IX Item "probesize integer (input)" yading@10: Set probing size in bytes, i.e. the size of the data to analyze to get yading@10: stream information. A higher value will allow to detect more yading@10: information in case it is dispersed into the stream, but will increase yading@10: latency. Must be an integer not lesser than 32. It is 5000000 by default. yading@10: .IP "\fBpacketsize\fR \fIinteger\fR \fB(\fR\fIoutput\fR\fB)\fR" 4 yading@10: .IX Item "packetsize integer (output)" yading@10: Set packet size. yading@10: .IP "\fBfflags\fR \fIflags\fR \fB(\fR\fIinput/output\fR\fB)\fR" 4 yading@10: .IX Item "fflags flags (input/output)" yading@10: Set format flags. yading@10: .Sp yading@10: Possible values: yading@10: .RS 4 yading@10: .IP "\fBignidx\fR" 4 yading@10: .IX Item "ignidx" yading@10: Ignore index. yading@10: .IP "\fBgenpts\fR" 4 yading@10: .IX Item "genpts" yading@10: Generate \s-1PTS\s0. yading@10: .IP "\fBnofillin\fR" 4 yading@10: .IX Item "nofillin" yading@10: Do not fill in missing values that can be exactly calculated. yading@10: .IP "\fBnoparse\fR" 4 yading@10: .IX Item "noparse" yading@10: Disable AVParsers, this needs \f(CW\*(C`+nofillin\*(C'\fR too. yading@10: .IP "\fBigndts\fR" 4 yading@10: .IX Item "igndts" yading@10: Ignore \s-1DTS\s0. yading@10: .IP "\fBdiscardcorrupt\fR" 4 yading@10: .IX Item "discardcorrupt" yading@10: Discard corrupted frames. yading@10: .IP "\fBsortdts\fR" 4 yading@10: .IX Item "sortdts" yading@10: Try to interleave output packets by \s-1DTS\s0. yading@10: .IP "\fBkeepside\fR" 4 yading@10: .IX Item "keepside" yading@10: Do not merge side data. yading@10: .IP "\fBlatm\fR" 4 yading@10: .IX Item "latm" yading@10: Enable \s-1RTP\s0 \s-1MP4A\-LATM\s0 payload. yading@10: .IP "\fBnobuffer\fR" 4 yading@10: .IX Item "nobuffer" yading@10: Reduce the latency introduced by optional buffering yading@10: .RE yading@10: .RS 4 yading@10: .RE yading@10: .IP "\fBanalyzeduration\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4 yading@10: .IX Item "analyzeduration integer (input)" yading@10: Specify how many microseconds are analyzed to probe the input. A yading@10: higher value will allow to detect more accurate information, but will yading@10: increase latency. It defaults to 5,000,000 microseconds = 5 seconds. yading@10: .IP "\fBcryptokey\fR \fIhexadecimal string\fR \fB(\fR\fIinput\fR\fB)\fR" 4 yading@10: .IX Item "cryptokey hexadecimal string (input)" yading@10: Set decryption key. yading@10: .IP "\fBindexmem\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4 yading@10: .IX Item "indexmem integer (input)" yading@10: Set max memory used for timestamp index (per stream). yading@10: .IP "\fBrtbufsize\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4 yading@10: .IX Item "rtbufsize integer (input)" yading@10: Set max memory used for buffering real-time frames. yading@10: .IP "\fBfdebug\fR \fIflags\fR \fB(\fR\fIinput/output\fR\fB)\fR" 4 yading@10: .IX Item "fdebug flags (input/output)" yading@10: Print specific debug info. yading@10: .Sp yading@10: Possible values: yading@10: .RS 4 yading@10: .IP "\fBts\fR" 4 yading@10: .IX Item "ts" yading@10: .RE yading@10: .RS 4 yading@10: .RE yading@10: .PD 0 yading@10: .IP "\fBmax_delay\fR \fIinteger\fR \fB(\fR\fIinput/output\fR\fB)\fR" 4 yading@10: .IX Item "max_delay integer (input/output)" yading@10: .PD yading@10: Set maximum muxing or demuxing delay in microseconds. yading@10: .IP "\fBfpsprobesize\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4 yading@10: .IX Item "fpsprobesize integer (input)" yading@10: Set number of frames used to probe fps. yading@10: .IP "\fBaudio_preload\fR \fIinteger\fR \fB(\fR\fIoutput\fR\fB)\fR" 4 yading@10: .IX Item "audio_preload integer (output)" yading@10: Set microseconds by which audio packets should be interleaved earlier. yading@10: .IP "\fBchunk_duration\fR \fIinteger\fR \fB(\fR\fIoutput\fR\fB)\fR" 4 yading@10: .IX Item "chunk_duration integer (output)" yading@10: Set microseconds for each chunk. yading@10: .IP "\fBchunk_size\fR \fIinteger\fR \fB(\fR\fIoutput\fR\fB)\fR" 4 yading@10: .IX Item "chunk_size integer (output)" yading@10: Set size in bytes for each chunk. yading@10: .IP "\fBerr_detect, f_err_detect\fR \fIflags\fR \fB(\fR\fIinput\fR\fB)\fR" 4 yading@10: .IX Item "err_detect, f_err_detect flags (input)" yading@10: Set error detection flags. \f(CW\*(C`f_err_detect\*(C'\fR is deprecated and yading@10: should be used only via the \fBffmpeg\fR tool. yading@10: .Sp yading@10: Possible values: yading@10: .RS 4 yading@10: .IP "\fBcrccheck\fR" 4 yading@10: .IX Item "crccheck" yading@10: Verify embedded CRCs. yading@10: .IP "\fBbitstream\fR" 4 yading@10: .IX Item "bitstream" yading@10: Detect bitstream specification deviations. yading@10: .IP "\fBbuffer\fR" 4 yading@10: .IX Item "buffer" yading@10: Detect improper bitstream length. yading@10: .IP "\fBexplode\fR" 4 yading@10: .IX Item "explode" yading@10: Abort decoding on minor error detection. yading@10: .IP "\fBcareful\fR" 4 yading@10: .IX Item "careful" yading@10: Consider things that violate the spec and have not been seen in the yading@10: wild as errors. yading@10: .IP "\fBcompliant\fR" 4 yading@10: .IX Item "compliant" yading@10: Consider all spec non compliancies as errors. yading@10: .IP "\fBaggressive\fR" 4 yading@10: .IX Item "aggressive" yading@10: Consider things that a sane encoder should not do as an error. yading@10: .RE yading@10: .RS 4 yading@10: .RE yading@10: .IP "\fBuse_wallclock_as_timestamps\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4 yading@10: .IX Item "use_wallclock_as_timestamps integer (input)" yading@10: Use wallclock as timestamps. yading@10: .IP "\fBavoid_negative_ts\fR \fIinteger\fR \fB(\fR\fIoutput\fR\fB)\fR" 4 yading@10: .IX Item "avoid_negative_ts integer (output)" yading@10: Shift timestamps to make them positive. A value of 1 enables shifting, yading@10: a value of 0 disables it, the default value of \-1 enables shifting yading@10: when required by the target format. yading@10: .Sp yading@10: When shifting is enabled, all output timestamps are shifted by the yading@10: same amount. Audio, video, and subtitles desynching and relative yading@10: timestamp differences are preserved compared to how they would have yading@10: been without shifting. yading@10: .Sp yading@10: Also note that this affects only leading negative timestamps, and not yading@10: non-monotonic negative timestamps. yading@10: .IP "\fBflush_packets\fR \fIinteger\fR \fB(\fR\fIoutput\fR\fB)\fR" 4 yading@10: .IX Item "flush_packets integer (output)" yading@10: Flush the underlying I/O stream after each packet. Default 1 enables it, and yading@10: has the effect of reducing the latency; 0 disables it and may slightly yading@10: increase performance in some cases. yading@10: .SH "DEMUXERS" yading@10: .IX Header "DEMUXERS" yading@10: Demuxers are configured elements in FFmpeg which allow to read the yading@10: multimedia streams from a particular type of file. yading@10: .PP yading@10: When you configure your FFmpeg build, all the supported demuxers yading@10: are enabled by default. You can list all available ones using the yading@10: configure option \f(CW\*(C`\-\-list\-demuxers\*(C'\fR. yading@10: .PP yading@10: You can disable all the demuxers using the configure option yading@10: \&\f(CW\*(C`\-\-disable\-demuxers\*(C'\fR, and selectively enable a single demuxer with yading@10: the option \f(CW\*(C`\-\-enable\-demuxer=\f(CIDEMUXER\f(CW\*(C'\fR, or disable it yading@10: with the option \f(CW\*(C`\-\-disable\-demuxer=\f(CIDEMUXER\f(CW\*(C'\fR. yading@10: .PP yading@10: The option \f(CW\*(C`\-formats\*(C'\fR of the ff* tools will display the list of yading@10: enabled demuxers. yading@10: .PP yading@10: The description of some of the currently available demuxers follows. yading@10: .SS "applehttp" yading@10: .IX Subsection "applehttp" yading@10: Apple \s-1HTTP\s0 Live Streaming demuxer. yading@10: .PP yading@10: This demuxer presents all AVStreams from all variant streams. yading@10: The id field is set to the bitrate variant index number. By setting yading@10: the discard flags on AVStreams (by pressing 'a' or 'v' in ffplay), yading@10: the caller can decide which variant streams to actually receive. yading@10: The total bitrate of the variant that the stream belongs to is yading@10: available in a metadata key named \*(L"variant_bitrate\*(R". yading@10: .SS "concat" yading@10: .IX Subsection "concat" yading@10: Virtual concatenation script demuxer. yading@10: .PP yading@10: This demuxer reads a list of files and other directives from a text file and yading@10: demuxes them one after the other, as if all their packet had been muxed yading@10: together. yading@10: .PP yading@10: The timestamps in the files are adjusted so that the first file starts at 0 yading@10: and each next file starts where the previous one finishes. Note that it is yading@10: done globally and may cause gaps if all streams do not have exactly the same yading@10: length. yading@10: .PP yading@10: All files must have the same streams (same codecs, same time base, etc.). yading@10: .PP yading@10: The duration of each file is used to adjust the timestamps of the next file: yading@10: if the duration is incorrect (because it was computed using the bit-rate or yading@10: because the file is truncated, for example), it can cause artifacts. The yading@10: \&\f(CW\*(C`duration\*(C'\fR directive can be used to override the duration stored in yading@10: each file. yading@10: .PP yading@10: \fISyntax\fR yading@10: .IX Subsection "Syntax" yading@10: .PP yading@10: The script is a text file in extended-ASCII, with one directive per line. yading@10: Empty lines, leading spaces and lines starting with '#' are ignored. The yading@10: following directive is recognized: yading@10: .ie n .IP "\fB\fB""file \f(BIpath\f(CB""\fB\fR" 4 yading@10: .el .IP "\fB\f(CBfile \f(CBpath\f(CB\fB\fR" 4 yading@10: .IX Item "file path" yading@10: Path to a file to read; special characters and spaces must be escaped with yading@10: backslash or single quotes. yading@10: .Sp yading@10: All subsequent directives apply to that file. yading@10: .ie n .IP "\fB\fB""ffconcat version 1.0""\fB\fR" 4 yading@10: .el .IP "\fB\f(CBffconcat version 1.0\fB\fR" 4 yading@10: .IX Item "ffconcat version 1.0" yading@10: Identify the script type and version. It also sets the \fBsafe\fR option yading@10: to 1 if it was to its default \-1. yading@10: .Sp yading@10: To make FFmpeg recognize the format automatically, this directive must yading@10: appears exactly as is (no extra space or byte-order-mark) on the very first yading@10: line of the script. yading@10: .ie n .IP "\fB\fB""duration \f(BIdur\f(CB""\fB\fR" 4 yading@10: .el .IP "\fB\f(CBduration \f(CBdur\f(CB\fB\fR" 4 yading@10: .IX Item "duration dur" yading@10: Duration of the file. This information can be specified from the file; yading@10: specifying it here may be more efficient or help if the information from the yading@10: file is not available or accurate. yading@10: .Sp yading@10: If the duration is set for all files, then it is possible to seek in the yading@10: whole concatenated video. yading@10: .PP yading@10: \fIOptions\fR yading@10: .IX Subsection "Options" yading@10: .PP yading@10: This demuxer accepts the following option: yading@10: .IP "\fBsafe\fR" 4 yading@10: .IX Item "safe" yading@10: If set to 1, reject unsafe file paths. A file path is considered safe if it yading@10: does not contain a protocol specification and is relative and all components yading@10: only contain characters from the portable character set (letters, digits, yading@10: period, underscore and hyphen) and have no period at the beginning of a yading@10: component. yading@10: .Sp yading@10: If set to 0, any file name is accepted. yading@10: .Sp yading@10: The default is \-1, it is equivalent to 1 if the format was automatically yading@10: probed and 0 otherwise. yading@10: .SS "libquvi" yading@10: .IX Subsection "libquvi" yading@10: Play media from Internet services using the quvi project. yading@10: .PP yading@10: The demuxer accepts a \fBformat\fR option to request a specific quality. It yading@10: is by default set to \fIbest\fR. yading@10: .PP yading@10: See <\fBhttp://quvi.sourceforge.net/\fR> for more information. yading@10: .PP yading@10: FFmpeg needs to be built with \f(CW\*(C`\-\-enable\-libquvi\*(C'\fR for this demuxer to be yading@10: enabled. yading@10: .SS "image2" yading@10: .IX Subsection "image2" yading@10: Image file demuxer. yading@10: .PP yading@10: This demuxer reads from a list of image files specified by a pattern. yading@10: The syntax and meaning of the pattern is specified by the yading@10: option \fIpattern_type\fR. yading@10: .PP yading@10: The pattern may contain a suffix which is used to automatically yading@10: determine the format of the images contained in the files. yading@10: .PP yading@10: The size, the pixel format, and the format of each image must be the yading@10: same for all the files in the sequence. yading@10: .PP yading@10: This demuxer accepts the following options: yading@10: .IP "\fBframerate\fR" 4 yading@10: .IX Item "framerate" yading@10: Set the frame rate for the video stream. It defaults to 25. yading@10: .IP "\fBloop\fR" 4 yading@10: .IX Item "loop" yading@10: If set to 1, loop over the input. Default value is 0. yading@10: .IP "\fBpattern_type\fR" 4 yading@10: .IX Item "pattern_type" yading@10: Select the pattern type used to interpret the provided filename. yading@10: .Sp yading@10: \&\fIpattern_type\fR accepts one of the following values. yading@10: .RS 4 yading@10: .IP "\fBsequence\fR" 4 yading@10: .IX Item "sequence" yading@10: Select a sequence pattern type, used to specify a sequence of files yading@10: indexed by sequential numbers. yading@10: .Sp yading@10: A sequence pattern may contain the string \*(L"%d\*(R" or "%0\fIN\fRd\*(L", which yading@10: specifies the position of the characters representing a sequential yading@10: number in each filename matched by the pattern. If the form yading@10: \&\*(R"%d0\fIN\fRd" is used, the string representing the number in each yading@10: filename is 0\-padded and \fIN\fR is the total number of 0\-padded yading@10: digits representing the number. The literal character '%' can be yading@10: specified in the pattern with the string \*(L"%%\*(R". yading@10: .Sp yading@10: If the sequence pattern contains \*(L"%d\*(R" or "%0\fIN\fRd", the first filename of yading@10: the file list specified by the pattern must contain a number yading@10: inclusively contained between \fIstart_number\fR and yading@10: \&\fIstart_number\fR+\fIstart_number_range\fR\-1, and all the following yading@10: numbers must be sequential. yading@10: .Sp yading@10: For example the pattern \*(L"img\-%03d.bmp\*(R" will match a sequence of yading@10: filenames of the form \fIimg\-001.bmp\fR, \fIimg\-002.bmp\fR, ..., yading@10: \&\fIimg\-010.bmp\fR, etc.; the pattern \*(L"i%%m%%g\-%d.jpg\*(R" will match a yading@10: sequence of filenames of the form \fIi%m%g\-1.jpg\fR, yading@10: \&\fIi%m%g\-2.jpg\fR, ..., \fIi%m%g\-10.jpg\fR, etc. yading@10: .Sp yading@10: Note that the pattern must not necessarily contain \*(L"%d\*(R" or yading@10: "%0\fIN\fRd", for example to convert a single image file yading@10: \&\fIimg.jpeg\fR you can employ the command: yading@10: .Sp yading@10: .Vb 1 yading@10: \& ffmpeg \-i img.jpeg img.png yading@10: .Ve yading@10: .IP "\fBglob\fR" 4 yading@10: .IX Item "glob" yading@10: Select a glob wildcard pattern type. yading@10: .Sp yading@10: The pattern is interpreted like a \f(CW\*(C`glob()\*(C'\fR pattern. This is only yading@10: selectable if libavformat was compiled with globbing support. yading@10: .IP "\fBglob_sequence\fR \fI(deprecated, will be removed)\fR" 4 yading@10: .IX Item "glob_sequence (deprecated, will be removed)" yading@10: Select a mixed glob wildcard/sequence pattern. yading@10: .Sp yading@10: If your version of libavformat was compiled with globbing support, and yading@10: the provided pattern contains at least one glob meta character among yading@10: \&\f(CW\*(C`%*?[]{}\*(C'\fR that is preceded by an unescaped \*(L"%\*(R", the pattern is yading@10: interpreted like a \f(CW\*(C`glob()\*(C'\fR pattern, otherwise it is interpreted yading@10: like a sequence pattern. yading@10: .Sp yading@10: All glob special characters \f(CW\*(C`%*?[]{}\*(C'\fR must be prefixed yading@10: with \*(L"%\*(R". To escape a literal \*(L"%\*(R" you shall use \*(L"%%\*(R". yading@10: .Sp yading@10: For example the pattern \f(CW\*(C`foo\-%*.jpeg\*(C'\fR will match all the yading@10: filenames prefixed by \*(L"foo\-\*(R" and terminating with \*(L".jpeg\*(R", and yading@10: \&\f(CW\*(C`foo\-%?%?%?.jpeg\*(C'\fR will match all the filenames prefixed with yading@10: \&\*(L"foo\-\*(R", followed by a sequence of three characters, and terminating yading@10: with \*(L".jpeg\*(R". yading@10: .Sp yading@10: This pattern type is deprecated in favor of \fIglob\fR and yading@10: \&\fIsequence\fR. yading@10: .RE yading@10: .RS 4 yading@10: .Sp yading@10: Default value is \fIglob_sequence\fR. yading@10: .RE yading@10: .IP "\fBpixel_format\fR" 4 yading@10: .IX Item "pixel_format" yading@10: Set the pixel format of the images to read. If not specified the pixel yading@10: format is guessed from the first image file in the sequence. yading@10: .IP "\fBstart_number\fR" 4 yading@10: .IX Item "start_number" yading@10: Set the index of the file matched by the image file pattern to start yading@10: to read from. Default value is 0. yading@10: .IP "\fBstart_number_range\fR" 4 yading@10: .IX Item "start_number_range" yading@10: Set the index interval range to check when looking for the first image yading@10: file in the sequence, starting from \fIstart_number\fR. Default value yading@10: is 5. yading@10: .IP "\fBvideo_size\fR" 4 yading@10: .IX Item "video_size" yading@10: Set the video size of the images to read. If not specified the video yading@10: size is guessed from the first image file in the sequence. yading@10: .PP yading@10: \fIExamples\fR yading@10: .IX Subsection "Examples" yading@10: .IP "\(bu" 4 yading@10: Use \fBffmpeg\fR for creating a video from the images in the file yading@10: sequence \fIimg\-001.jpeg\fR, \fIimg\-002.jpeg\fR, ..., assuming an yading@10: input frame rate of 10 frames per second: yading@10: .Sp yading@10: .Vb 1 yading@10: \& ffmpeg \-i \*(Aqimg\-%03d.jpeg\*(Aq \-r 10 out.mkv yading@10: .Ve yading@10: .IP "\(bu" 4 yading@10: As above, but start by reading from a file with index 100 in the sequence: yading@10: .Sp yading@10: .Vb 1 yading@10: \& ffmpeg \-start_number 100 \-i \*(Aqimg\-%03d.jpeg\*(Aq \-r 10 out.mkv yading@10: .Ve yading@10: .IP "\(bu" 4 yading@10: Read images matching the \*(L"*.png\*(R" glob pattern , that is all the files yading@10: terminating with the \*(L".png\*(R" suffix: yading@10: .Sp yading@10: .Vb 1 yading@10: \& ffmpeg \-pattern_type glob \-i "*.png" \-r 10 out.mkv yading@10: .Ve yading@10: .SS "rawvideo" yading@10: .IX Subsection "rawvideo" yading@10: Raw video demuxer. yading@10: .PP yading@10: This demuxer allows to read raw video data. Since there is no header yading@10: specifying the assumed video parameters, the user must specify them yading@10: in order to be able to decode the data correctly. yading@10: .PP yading@10: This demuxer accepts the following options: yading@10: .IP "\fBframerate\fR" 4 yading@10: .IX Item "framerate" yading@10: Set input video frame rate. Default value is 25. yading@10: .IP "\fBpixel_format\fR" 4 yading@10: .IX Item "pixel_format" yading@10: Set the input video pixel format. Default value is \f(CW\*(C`yuv420p\*(C'\fR. yading@10: .IP "\fBvideo_size\fR" 4 yading@10: .IX Item "video_size" yading@10: Set the input video size. This value must be specified explicitly. yading@10: .PP yading@10: For example to read a rawvideo file \fIinput.raw\fR with yading@10: \&\fBffplay\fR, assuming a pixel format of \f(CW\*(C`rgb24\*(C'\fR, a video yading@10: size of \f(CW\*(C`320x240\*(C'\fR, and a frame rate of 10 images per second, use yading@10: the command: yading@10: .PP yading@10: .Vb 1 yading@10: \& ffplay \-f rawvideo \-pixel_format rgb24 \-video_size 320x240 \-framerate 10 input.raw yading@10: .Ve yading@10: .SS "sbg" yading@10: .IX Subsection "sbg" yading@10: SBaGen script demuxer. yading@10: .PP yading@10: This demuxer reads the script language used by SBaGen yading@10: <\fBhttp://uazu.net/sbagen/\fR> to generate binaural beats sessions. A \s-1SBG\s0 yading@10: script looks like that: yading@10: .PP yading@10: .Vb 9 yading@10: \& \-SE yading@10: \& a: 300\-2.5/3 440+4.5/0 yading@10: \& b: 300\-2.5/0 440+4.5/3 yading@10: \& off: \- yading@10: \& NOW == a yading@10: \& +0:07:00 == b yading@10: \& +0:14:00 == a yading@10: \& +0:21:00 == b yading@10: \& +0:30:00 off yading@10: .Ve yading@10: .PP yading@10: A \s-1SBG\s0 script can mix absolute and relative timestamps. If the script uses yading@10: either only absolute timestamps (including the script start time) or only yading@10: relative ones, then its layout is fixed, and the conversion is yading@10: straightforward. On the other hand, if the script mixes both kind of yading@10: timestamps, then the \fI\s-1NOW\s0\fR reference for relative timestamps will be yading@10: taken from the current time of day at the time the script is read, and the yading@10: script layout will be frozen according to that reference. That means that if yading@10: the script is directly played, the actual times will match the absolute yading@10: timestamps up to the sound controller's clock accuracy, but if the user yading@10: somehow pauses the playback or seeks, all times will be shifted accordingly. yading@10: .SS "tedcaptions" yading@10: .IX Subsection "tedcaptions" yading@10: \&\s-1JSON\s0 captions used for <\fBhttp://www.ted.com/\fR>. yading@10: .PP yading@10: \&\s-1TED\s0 does not provide links to the captions, but they can be guessed from the yading@10: page. The file \fItools/bookmarklets.html\fR from the FFmpeg source tree yading@10: contains a bookmarklet to expose them. yading@10: .PP yading@10: This demuxer accepts the following option: yading@10: .IP "\fBstart_time\fR" 4 yading@10: .IX Item "start_time" yading@10: Set the start time of the \s-1TED\s0 talk, in milliseconds. The default is 15000 yading@10: (15s). It is used to sync the captions with the downloadable videos, because yading@10: they include a 15s intro. yading@10: .PP yading@10: Example: convert the captions to a format most players understand: yading@10: .PP yading@10: .Vb 1 yading@10: \& ffmpeg \-i http://www.ted.com/talks/subtitles/id/1/lang/en talk1\-en.srt yading@10: .Ve yading@10: .SH "MUXERS" yading@10: .IX Header "MUXERS" yading@10: Muxers are configured elements in FFmpeg which allow writing yading@10: multimedia streams to a particular type of file. yading@10: .PP yading@10: When you configure your FFmpeg build, all the supported muxers yading@10: are enabled by default. You can list all available muxers using the yading@10: configure option \f(CW\*(C`\-\-list\-muxers\*(C'\fR. yading@10: .PP yading@10: You can disable all the muxers with the configure option yading@10: \&\f(CW\*(C`\-\-disable\-muxers\*(C'\fR and selectively enable / disable single muxers yading@10: with the options \f(CW\*(C`\-\-enable\-muxer=\f(CIMUXER\f(CW\*(C'\fR / yading@10: \&\f(CW\*(C`\-\-disable\-muxer=\f(CIMUXER\f(CW\*(C'\fR. yading@10: .PP yading@10: The option \f(CW\*(C`\-formats\*(C'\fR of the ff* tools will display the list of yading@10: enabled muxers. yading@10: .PP yading@10: A description of some of the currently available muxers follows. yading@10: .SS "crc" yading@10: .IX Subsection "crc" yading@10: \&\s-1CRC\s0 (Cyclic Redundancy Check) testing format. yading@10: .PP yading@10: This muxer computes and prints the Adler\-32 \s-1CRC\s0 of all the input audio yading@10: and video frames. By default audio frames are converted to signed yading@10: 16\-bit raw audio and video frames to raw video before computing the yading@10: \&\s-1CRC\s0. yading@10: .PP yading@10: The output of the muxer consists of a single line of the form: yading@10: CRC=0x\fI\s-1CRC\s0\fR, where \fI\s-1CRC\s0\fR is a hexadecimal number 0\-padded to yading@10: 8 digits containing the \s-1CRC\s0 for all the decoded input frames. yading@10: .PP yading@10: For example to compute the \s-1CRC\s0 of the input, and store it in the file yading@10: \&\fIout.crc\fR: yading@10: .PP yading@10: .Vb 1 yading@10: \& ffmpeg \-i INPUT \-f crc out.crc yading@10: .Ve yading@10: .PP yading@10: You can print the \s-1CRC\s0 to stdout with the command: yading@10: .PP yading@10: .Vb 1 yading@10: \& ffmpeg \-i INPUT \-f crc \- yading@10: .Ve yading@10: .PP yading@10: You can select the output format of each frame with \fBffmpeg\fR by yading@10: specifying the audio and video codec and format. For example to yading@10: compute the \s-1CRC\s0 of the input audio converted to \s-1PCM\s0 unsigned 8\-bit yading@10: and the input video converted to \s-1MPEG\-2\s0 video, use the command: yading@10: .PP yading@10: .Vb 1 yading@10: \& ffmpeg \-i INPUT \-c:a pcm_u8 \-c:v mpeg2video \-f crc \- yading@10: .Ve yading@10: .PP yading@10: See also the framecrc muxer. yading@10: .SS "framecrc" yading@10: .IX Subsection "framecrc" yading@10: Per-packet \s-1CRC\s0 (Cyclic Redundancy Check) testing format. yading@10: .PP yading@10: This muxer computes and prints the Adler\-32 \s-1CRC\s0 for each audio yading@10: and video packet. By default audio frames are converted to signed yading@10: 16\-bit raw audio and video frames to raw video before computing the yading@10: \&\s-1CRC\s0. yading@10: .PP yading@10: The output of the muxer consists of a line for each audio and video yading@10: packet of the form: yading@10: .PP yading@10: .Vb 1 yading@10: \& , , , , , 0x yading@10: .Ve yading@10: .PP yading@10: \&\fI\s-1CRC\s0\fR is a hexadecimal number 0\-padded to 8 digits containing the yading@10: \&\s-1CRC\s0 of the packet. yading@10: .PP yading@10: For example to compute the \s-1CRC\s0 of the audio and video frames in yading@10: \&\fI\s-1INPUT\s0\fR, converted to raw audio and video packets, and store it yading@10: in the file \fIout.crc\fR: yading@10: .PP yading@10: .Vb 1 yading@10: \& ffmpeg \-i INPUT \-f framecrc out.crc yading@10: .Ve yading@10: .PP yading@10: To print the information to stdout, use the command: yading@10: .PP yading@10: .Vb 1 yading@10: \& ffmpeg \-i INPUT \-f framecrc \- yading@10: .Ve yading@10: .PP yading@10: With \fBffmpeg\fR, you can select the output format to which the yading@10: audio and video frames are encoded before computing the \s-1CRC\s0 for each yading@10: packet by specifying the audio and video codec. For example, to yading@10: compute the \s-1CRC\s0 of each decoded input audio frame converted to \s-1PCM\s0 yading@10: unsigned 8\-bit and of each decoded input video frame converted to yading@10: \&\s-1MPEG\-2\s0 video, use the command: yading@10: .PP yading@10: .Vb 1 yading@10: \& ffmpeg \-i INPUT \-c:a pcm_u8 \-c:v mpeg2video \-f framecrc \- yading@10: .Ve yading@10: .PP yading@10: See also the crc muxer. yading@10: .SS "framemd5" yading@10: .IX Subsection "framemd5" yading@10: Per-packet \s-1MD5\s0 testing format. yading@10: .PP yading@10: This muxer computes and prints the \s-1MD5\s0 hash for each audio yading@10: and video packet. By default audio frames are converted to signed yading@10: 16\-bit raw audio and video frames to raw video before computing the yading@10: hash. yading@10: .PP yading@10: The output of the muxer consists of a line for each audio and video yading@10: packet of the form: yading@10: .PP yading@10: .Vb 1 yading@10: \& , , , , , yading@10: .Ve yading@10: .PP yading@10: \&\fI\s-1MD5\s0\fR is a hexadecimal number representing the computed \s-1MD5\s0 hash yading@10: for the packet. yading@10: .PP yading@10: For example to compute the \s-1MD5\s0 of the audio and video frames in yading@10: \&\fI\s-1INPUT\s0\fR, converted to raw audio and video packets, and store it yading@10: in the file \fIout.md5\fR: yading@10: .PP yading@10: .Vb 1 yading@10: \& ffmpeg \-i INPUT \-f framemd5 out.md5 yading@10: .Ve yading@10: .PP yading@10: To print the information to stdout, use the command: yading@10: .PP yading@10: .Vb 1 yading@10: \& ffmpeg \-i INPUT \-f framemd5 \- yading@10: .Ve yading@10: .PP yading@10: See also the md5 muxer. yading@10: .SS "hls" yading@10: .IX Subsection "hls" yading@10: Apple \s-1HTTP\s0 Live Streaming muxer that segments MPEG-TS according to yading@10: the \s-1HTTP\s0 Live Streaming specification. yading@10: .PP yading@10: It creates a playlist file and numbered segment files. The output yading@10: filename specifies the playlist filename; the segment filenames yading@10: receive the same basename as the playlist, a sequential number and yading@10: a .ts extension. yading@10: .PP yading@10: .Vb 1 yading@10: \& ffmpeg \-i in.nut out.m3u8 yading@10: .Ve yading@10: .IP "\fB\-hls_time\fR \fIseconds\fR" 4 yading@10: .IX Item "-hls_time seconds" yading@10: Set the segment length in seconds. yading@10: .IP "\fB\-hls_list_size\fR \fIsize\fR" 4 yading@10: .IX Item "-hls_list_size size" yading@10: Set the maximum number of playlist entries. yading@10: .IP "\fB\-hls_wrap\fR \fIwrap\fR" 4 yading@10: .IX Item "-hls_wrap wrap" yading@10: Set the number after which index wraps. yading@10: .IP "\fB\-start_number\fR \fInumber\fR" 4 yading@10: .IX Item "-start_number number" yading@10: Start the sequence from \fInumber\fR. yading@10: .SS "ico" yading@10: .IX Subsection "ico" yading@10: \&\s-1ICO\s0 file muxer. yading@10: .PP yading@10: Microsoft's icon file format (\s-1ICO\s0) has some strict limitations that should be noted: yading@10: .IP "\(bu" 4 yading@10: Size cannot exceed 256 pixels in any dimension yading@10: .IP "\(bu" 4 yading@10: Only \s-1BMP\s0 and \s-1PNG\s0 images can be stored yading@10: .IP "\(bu" 4 yading@10: If a \s-1BMP\s0 image is used, it must be one of the following pixel formats: yading@10: .Sp yading@10: .Vb 7 yading@10: \& BMP Bit Depth FFmpeg Pixel Format yading@10: \& 1bit pal8 yading@10: \& 4bit pal8 yading@10: \& 8bit pal8 yading@10: \& 16bit rgb555le yading@10: \& 24bit bgr24 yading@10: \& 32bit bgra yading@10: .Ve yading@10: .IP "\(bu" 4 yading@10: If a \s-1BMP\s0 image is used, it must use the \s-1BITMAPINFOHEADER\s0 \s-1DIB\s0 header yading@10: .IP "\(bu" 4 yading@10: If a \s-1PNG\s0 image is used, it must use the rgba pixel format yading@10: .SS "image2" yading@10: .IX Subsection "image2" yading@10: Image file muxer. yading@10: .PP yading@10: The image file muxer writes video frames to image files. yading@10: .PP yading@10: The output filenames are specified by a pattern, which can be used to yading@10: produce sequentially numbered series of files. yading@10: The pattern may contain the string \*(L"%d\*(R" or "%0\fIN\fRd\*(L", this string yading@10: specifies the position of the characters representing a numbering in yading@10: the filenames. If the form \*(R"%0\fIN\fRd" is used, the string yading@10: representing the number in each filename is 0\-padded to \fIN\fR yading@10: digits. The literal character '%' can be specified in the pattern with yading@10: the string \*(L"%%\*(R". yading@10: .PP yading@10: If the pattern contains \*(L"%d\*(R" or "%0\fIN\fRd", the first filename of yading@10: the file list specified will contain the number 1, all the following yading@10: numbers will be sequential. yading@10: .PP yading@10: The pattern may contain a suffix which is used to automatically yading@10: determine the format of the image files to write. yading@10: .PP yading@10: For example the pattern \*(L"img\-%03d.bmp\*(R" will specify a sequence of yading@10: filenames of the form \fIimg\-001.bmp\fR, \fIimg\-002.bmp\fR, ..., yading@10: \&\fIimg\-010.bmp\fR, etc. yading@10: The pattern \*(L"img%%\-%d.jpg\*(R" will specify a sequence of filenames of the yading@10: form \fIimg%\-1.jpg\fR, \fIimg%\-2.jpg\fR, ..., \fIimg%\-10.jpg\fR, yading@10: etc. yading@10: .PP yading@10: The following example shows how to use \fBffmpeg\fR for creating a yading@10: sequence of files \fIimg\-001.jpeg\fR, \fIimg\-002.jpeg\fR, ..., yading@10: taking one image every second from the input video: yading@10: .PP yading@10: .Vb 1 yading@10: \& ffmpeg \-i in.avi \-vsync 1 \-r 1 \-f image2 \*(Aqimg\-%03d.jpeg\*(Aq yading@10: .Ve yading@10: .PP yading@10: Note that with \fBffmpeg\fR, if the format is not specified with the yading@10: \&\f(CW\*(C`\-f\*(C'\fR option and the output filename specifies an image file yading@10: format, the image2 muxer is automatically selected, so the previous yading@10: command can be written as: yading@10: .PP yading@10: .Vb 1 yading@10: \& ffmpeg \-i in.avi \-vsync 1 \-r 1 \*(Aqimg\-%03d.jpeg\*(Aq yading@10: .Ve yading@10: .PP yading@10: Note also that the pattern must not necessarily contain \*(L"%d\*(R" or yading@10: "%0\fIN\fRd", for example to create a single image file yading@10: \&\fIimg.jpeg\fR from the input video you can employ the command: yading@10: .PP yading@10: .Vb 1 yading@10: \& ffmpeg \-i in.avi \-f image2 \-frames:v 1 img.jpeg yading@10: .Ve yading@10: .IP "\fBstart_number\fR \fInumber\fR" 4 yading@10: .IX Item "start_number number" yading@10: Start the sequence from \fInumber\fR. Default value is 1. Must be a yading@10: positive number. yading@10: .IP "\fB\-update\fR \fInumber\fR" 4 yading@10: .IX Item "-update number" yading@10: If \fInumber\fR is nonzero, the filename will always be interpreted as just a yading@10: filename, not a pattern, and this file will be continuously overwritten with new yading@10: images. yading@10: .PP yading@10: The image muxer supports the .Y.U.V image file format. This format is yading@10: special in that that each image frame consists of three files, for yading@10: each of the \s-1YUV420P\s0 components. To read or write this image file format, yading@10: specify the name of the '.Y' file. The muxer will automatically open the yading@10: \&'.U' and '.V' files as required. yading@10: .SS "md5" yading@10: .IX Subsection "md5" yading@10: \&\s-1MD5\s0 testing format. yading@10: .PP yading@10: This muxer computes and prints the \s-1MD5\s0 hash of all the input audio yading@10: and video frames. By default audio frames are converted to signed yading@10: 16\-bit raw audio and video frames to raw video before computing the yading@10: hash. yading@10: .PP yading@10: The output of the muxer consists of a single line of the form: yading@10: MD5=\fI\s-1MD5\s0\fR, where \fI\s-1MD5\s0\fR is a hexadecimal number representing yading@10: the computed \s-1MD5\s0 hash. yading@10: .PP yading@10: For example to compute the \s-1MD5\s0 hash of the input converted to raw yading@10: audio and video, and store it in the file \fIout.md5\fR: yading@10: .PP yading@10: .Vb 1 yading@10: \& ffmpeg \-i INPUT \-f md5 out.md5 yading@10: .Ve yading@10: .PP yading@10: You can print the \s-1MD5\s0 to stdout with the command: yading@10: .PP yading@10: .Vb 1 yading@10: \& ffmpeg \-i INPUT \-f md5 \- yading@10: .Ve yading@10: .PP yading@10: See also the framemd5 muxer. yading@10: .SS "\s-1MOV/MP4/ISMV\s0" yading@10: .IX Subsection "MOV/MP4/ISMV" yading@10: The mov/mp4/ismv muxer supports fragmentation. Normally, a \s-1MOV/MP4\s0 yading@10: file has all the metadata about all packets stored in one location yading@10: (written at the end of the file, it can be moved to the start for yading@10: better playback by adding \fIfaststart\fR to the \fImovflags\fR, or yading@10: using the \fBqt-faststart\fR tool). A fragmented yading@10: file consists of a number of fragments, where packets and metadata yading@10: about these packets are stored together. Writing a fragmented yading@10: file has the advantage that the file is decodable even if the yading@10: writing is interrupted (while a normal \s-1MOV/MP4\s0 is undecodable if yading@10: it is not properly finished), and it requires less memory when writing yading@10: very long files (since writing normal \s-1MOV/MP4\s0 files stores info about yading@10: every single packet in memory until the file is closed). The downside yading@10: is that it is less compatible with other applications. yading@10: .PP yading@10: Fragmentation is enabled by setting one of the AVOptions that define yading@10: how to cut the file into fragments: yading@10: .IP "\fB\-moov_size\fR \fIbytes\fR" 4 yading@10: .IX Item "-moov_size bytes" yading@10: Reserves space for the moov atom at the beginning of the file instead of placing the yading@10: moov atom at the end. If the space reserved is insufficient, muxing will fail. yading@10: .IP "\fB\-movflags frag_keyframe\fR" 4 yading@10: .IX Item "-movflags frag_keyframe" yading@10: Start a new fragment at each video keyframe. yading@10: .IP "\fB\-frag_duration\fR \fIduration\fR" 4 yading@10: .IX Item "-frag_duration duration" yading@10: Create fragments that are \fIduration\fR microseconds long. yading@10: .IP "\fB\-frag_size\fR \fIsize\fR" 4 yading@10: .IX Item "-frag_size size" yading@10: Create fragments that contain up to \fIsize\fR bytes of payload data. yading@10: .IP "\fB\-movflags frag_custom\fR" 4 yading@10: .IX Item "-movflags frag_custom" yading@10: Allow the caller to manually choose when to cut fragments, by yading@10: calling \f(CW\*(C`av_write_frame(ctx, NULL)\*(C'\fR to write a fragment with yading@10: the packets written so far. (This is only useful with other yading@10: applications integrating libavformat, not from \fBffmpeg\fR.) yading@10: .IP "\fB\-min_frag_duration\fR \fIduration\fR" 4 yading@10: .IX Item "-min_frag_duration duration" yading@10: Don't create fragments that are shorter than \fIduration\fR microseconds long. yading@10: .PP yading@10: If more than one condition is specified, fragments are cut when yading@10: one of the specified conditions is fulfilled. The exception to this is yading@10: \&\f(CW\*(C`\-min_frag_duration\*(C'\fR, which has to be fulfilled for any of the other yading@10: conditions to apply. yading@10: .PP yading@10: Additionally, the way the output file is written can be adjusted yading@10: through a few other options: yading@10: .IP "\fB\-movflags empty_moov\fR" 4 yading@10: .IX Item "-movflags empty_moov" yading@10: Write an initial moov atom directly at the start of the file, without yading@10: describing any samples in it. Generally, an mdat/moov pair is written yading@10: at the start of the file, as a normal \s-1MOV/MP4\s0 file, containing only yading@10: a short portion of the file. With this option set, there is no initial yading@10: mdat atom, and the moov atom only describes the tracks but has yading@10: a zero duration. yading@10: .Sp yading@10: Files written with this option set do not work in QuickTime. yading@10: This option is implicitly set when writing ismv (Smooth Streaming) files. yading@10: .IP "\fB\-movflags separate_moof\fR" 4 yading@10: .IX Item "-movflags separate_moof" yading@10: Write a separate moof (movie fragment) atom for each track. Normally, yading@10: packets for all tracks are written in a moof atom (which is slightly yading@10: more efficient), but with this option set, the muxer writes one moof/mdat yading@10: pair for each track, making it easier to separate tracks. yading@10: .Sp yading@10: This option is implicitly set when writing ismv (Smooth Streaming) files. yading@10: .IP "\fB\-movflags faststart\fR" 4 yading@10: .IX Item "-movflags faststart" yading@10: Run a second pass moving the moov atom on top of the file. This yading@10: operation can take a while, and will not work in various situations such yading@10: as fragmented output, thus it is not enabled by default. yading@10: .IP "\fB\-movflags rtphint\fR" 4 yading@10: .IX Item "-movflags rtphint" yading@10: Add \s-1RTP\s0 hinting tracks to the output file. yading@10: .PP yading@10: Smooth Streaming content can be pushed in real time to a publishing yading@10: point on \s-1IIS\s0 with this muxer. Example: yading@10: .PP yading@10: .Vb 1 yading@10: \& ffmpeg \-re <> \-movflags isml+frag_keyframe \-f ismv http://server/publishingpoint.isml/Streams(Encoder1) yading@10: .Ve yading@10: .SS "mpegts" yading@10: .IX Subsection "mpegts" yading@10: \&\s-1MPEG\s0 transport stream muxer. yading@10: .PP yading@10: This muxer implements \s-1ISO\s0 13818\-1 and part of \s-1ETSI\s0 \s-1EN\s0 300 468. yading@10: .PP yading@10: The muxer options are: yading@10: .IP "\fB\-mpegts_original_network_id\fR \fInumber\fR" 4 yading@10: .IX Item "-mpegts_original_network_id number" yading@10: Set the original_network_id (default 0x0001). This is unique identifier yading@10: of a network in \s-1DVB\s0. Its main use is in the unique identification of a yading@10: service through the path Original_Network_ID, Transport_Stream_ID. yading@10: .IP "\fB\-mpegts_transport_stream_id\fR \fInumber\fR" 4 yading@10: .IX Item "-mpegts_transport_stream_id number" yading@10: Set the transport_stream_id (default 0x0001). This identifies a yading@10: transponder in \s-1DVB\s0. yading@10: .IP "\fB\-mpegts_service_id\fR \fInumber\fR" 4 yading@10: .IX Item "-mpegts_service_id number" yading@10: Set the service_id (default 0x0001) also known as program in \s-1DVB\s0. yading@10: .IP "\fB\-mpegts_pmt_start_pid\fR \fInumber\fR" 4 yading@10: .IX Item "-mpegts_pmt_start_pid number" yading@10: Set the first \s-1PID\s0 for \s-1PMT\s0 (default 0x1000, max 0x1f00). yading@10: .IP "\fB\-mpegts_start_pid\fR \fInumber\fR" 4 yading@10: .IX Item "-mpegts_start_pid number" yading@10: Set the first \s-1PID\s0 for data packets (default 0x0100, max 0x0f00). yading@10: .PP yading@10: The recognized metadata settings in mpegts muxer are \f(CW\*(C`service_provider\*(C'\fR yading@10: and \f(CW\*(C`service_name\*(C'\fR. If they are not set the default for yading@10: \&\f(CW\*(C`service_provider\*(C'\fR is \*(L"FFmpeg\*(R" and the default for yading@10: \&\f(CW\*(C`service_name\*(C'\fR is \*(L"Service01\*(R". yading@10: .PP yading@10: .Vb 9 yading@10: \& ffmpeg \-i file.mpg \-c copy \e yading@10: \& \-mpegts_original_network_id 0x1122 \e yading@10: \& \-mpegts_transport_stream_id 0x3344 \e yading@10: \& \-mpegts_service_id 0x5566 \e yading@10: \& \-mpegts_pmt_start_pid 0x1500 \e yading@10: \& \-mpegts_start_pid 0x150 \e yading@10: \& \-metadata service_provider="Some provider" \e yading@10: \& \-metadata service_name="Some Channel" \e yading@10: \& \-y out.ts yading@10: .Ve yading@10: .SS "null" yading@10: .IX Subsection "null" yading@10: Null muxer. yading@10: .PP yading@10: This muxer does not generate any output file, it is mainly useful for yading@10: testing or benchmarking purposes. yading@10: .PP yading@10: For example to benchmark decoding with \fBffmpeg\fR you can use the yading@10: command: yading@10: .PP yading@10: .Vb 1 yading@10: \& ffmpeg \-benchmark \-i INPUT \-f null out.null yading@10: .Ve yading@10: .PP yading@10: Note that the above command does not read or write the \fIout.null\fR yading@10: file, but specifying the output file is required by the \fBffmpeg\fR yading@10: syntax. yading@10: .PP yading@10: Alternatively you can write the command as: yading@10: .PP yading@10: .Vb 1 yading@10: \& ffmpeg \-benchmark \-i INPUT \-f null \- yading@10: .Ve yading@10: .SS "matroska" yading@10: .IX Subsection "matroska" yading@10: Matroska container muxer. yading@10: .PP yading@10: This muxer implements the matroska and webm container specs. yading@10: .PP yading@10: The recognized metadata settings in this muxer are: yading@10: .IP "\fBtitle=\fR\fItitle name\fR" 4 yading@10: .IX Item "title=title name" yading@10: Name provided to a single track yading@10: .IP "\fBlanguage=\fR\fIlanguage name\fR" 4 yading@10: .IX Item "language=language name" yading@10: Specifies the language of the track in the Matroska languages form yading@10: .IP "\fBstereo_mode=\fR\fImode\fR" 4 yading@10: .IX Item "stereo_mode=mode" yading@10: Stereo 3D video layout of two views in a single video track yading@10: .RS 4 yading@10: .IP "\fBmono\fR" 4 yading@10: .IX Item "mono" yading@10: video is not stereo yading@10: .IP "\fBleft_right\fR" 4 yading@10: .IX Item "left_right" yading@10: Both views are arranged side by side, Left-eye view is on the left yading@10: .IP "\fBbottom_top\fR" 4 yading@10: .IX Item "bottom_top" yading@10: Both views are arranged in top-bottom orientation, Left-eye view is at bottom yading@10: .IP "\fBtop_bottom\fR" 4 yading@10: .IX Item "top_bottom" yading@10: Both views are arranged in top-bottom orientation, Left-eye view is on top yading@10: .IP "\fBcheckerboard_rl\fR" 4 yading@10: .IX Item "checkerboard_rl" yading@10: Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first yading@10: .IP "\fBcheckerboard_lr\fR" 4 yading@10: .IX Item "checkerboard_lr" yading@10: Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first yading@10: .IP "\fBrow_interleaved_rl\fR" 4 yading@10: .IX Item "row_interleaved_rl" yading@10: Each view is constituted by a row based interleaving, Right-eye view is first row yading@10: .IP "\fBrow_interleaved_lr\fR" 4 yading@10: .IX Item "row_interleaved_lr" yading@10: Each view is constituted by a row based interleaving, Left-eye view is first row yading@10: .IP "\fBcol_interleaved_rl\fR" 4 yading@10: .IX Item "col_interleaved_rl" yading@10: Both views are arranged in a column based interleaving manner, Right-eye view is first column yading@10: .IP "\fBcol_interleaved_lr\fR" 4 yading@10: .IX Item "col_interleaved_lr" yading@10: Both views are arranged in a column based interleaving manner, Left-eye view is first column yading@10: .IP "\fBanaglyph_cyan_red\fR" 4 yading@10: .IX Item "anaglyph_cyan_red" yading@10: All frames are in anaglyph format viewable through red-cyan filters yading@10: .IP "\fBright_left\fR" 4 yading@10: .IX Item "right_left" yading@10: Both views are arranged side by side, Right-eye view is on the left yading@10: .IP "\fBanaglyph_green_magenta\fR" 4 yading@10: .IX Item "anaglyph_green_magenta" yading@10: All frames are in anaglyph format viewable through green-magenta filters yading@10: .IP "\fBblock_lr\fR" 4 yading@10: .IX Item "block_lr" yading@10: Both eyes laced in one Block, Left-eye view is first yading@10: .IP "\fBblock_rl\fR" 4 yading@10: .IX Item "block_rl" yading@10: Both eyes laced in one Block, Right-eye view is first yading@10: .RE yading@10: .RS 4 yading@10: .RE yading@10: .PP yading@10: For example a 3D WebM clip can be created using the following command line: yading@10: .PP yading@10: .Vb 1 yading@10: \& ffmpeg \-i sample_left_right_clip.mpg \-an \-c:v libvpx \-metadata stereo_mode=left_right \-y stereo_clip.webm yading@10: .Ve yading@10: .SS "segment, stream_segment, ssegment" yading@10: .IX Subsection "segment, stream_segment, ssegment" yading@10: Basic stream segmenter. yading@10: .PP yading@10: The segmenter muxer outputs streams to a number of separate files of nearly yading@10: fixed duration. Output filename pattern can be set in a fashion similar to yading@10: image2. yading@10: .PP yading@10: \&\f(CW\*(C`stream_segment\*(C'\fR is a variant of the muxer used to write to yading@10: streaming output formats, i.e. which do not require global headers, yading@10: and is recommended for outputting e.g. to \s-1MPEG\s0 transport stream segments. yading@10: \&\f(CW\*(C`ssegment\*(C'\fR is a shorter alias for \f(CW\*(C`stream_segment\*(C'\fR. yading@10: .PP yading@10: Every segment starts with a keyframe of the selected reference stream, yading@10: which is set through the \fBreference_stream\fR option. yading@10: .PP yading@10: Note that if you want accurate splitting for a video file, you need to yading@10: make the input key frames correspond to the exact splitting times yading@10: expected by the segmenter, or the segment muxer will start the new yading@10: segment with the key frame found next after the specified start yading@10: time. yading@10: .PP yading@10: The segment muxer works best with a single constant frame rate video. yading@10: .PP yading@10: Optionally it can generate a list of the created segments, by setting yading@10: the option \fIsegment_list\fR. The list type is specified by the yading@10: \&\fIsegment_list_type\fR option. yading@10: .PP yading@10: The segment muxer supports the following options: yading@10: .IP "\fBreference_stream\fR \fIspecifier\fR" 4 yading@10: .IX Item "reference_stream specifier" yading@10: Set the reference stream, as specified by the string \fIspecifier\fR. yading@10: If \fIspecifier\fR is set to \f(CW\*(C`auto\*(C'\fR, the reference is choosen yading@10: automatically. Otherwise it must be a stream specifier (see the ``Stream yading@10: specifiers'' chapter in the ffmpeg manual) which specifies the yading@10: reference stream. The default value is ``auto''. yading@10: .IP "\fBsegment_format\fR \fIformat\fR" 4 yading@10: .IX Item "segment_format format" yading@10: Override the inner container format, by default it is guessed by the filename yading@10: extension. yading@10: .IP "\fBsegment_list\fR \fIname\fR" 4 yading@10: .IX Item "segment_list name" yading@10: Generate also a listfile named \fIname\fR. If not specified no yading@10: listfile is generated. yading@10: .IP "\fBsegment_list_flags\fR \fIflags\fR" 4 yading@10: .IX Item "segment_list_flags flags" yading@10: Set flags affecting the segment list generation. yading@10: .Sp yading@10: It currently supports the following flags: yading@10: .RS 4 yading@10: .IP "\fIcache\fR" 4 yading@10: .IX Item "cache" yading@10: Allow caching (only affects M3U8 list files). yading@10: .IP "\fIlive\fR" 4 yading@10: .IX Item "live" yading@10: Allow live-friendly file generation. yading@10: .RE yading@10: .RS 4 yading@10: .Sp yading@10: Default value is \f(CW\*(C`cache\*(C'\fR. yading@10: .RE yading@10: .IP "\fBsegment_list_size\fR \fIsize\fR" 4 yading@10: .IX Item "segment_list_size size" yading@10: Update the list file so that it contains at most the last \fIsize\fR yading@10: segments. If 0 the list file will contain all the segments. Default yading@10: value is 0. yading@10: .IP "\fBsegment_list type\fR \fItype\fR" 4 yading@10: .IX Item "segment_list type type" yading@10: Specify the format for the segment list file. yading@10: .Sp yading@10: The following values are recognized: yading@10: .RS 4 yading@10: .IP "\fBflat\fR" 4 yading@10: .IX Item "flat" yading@10: Generate a flat list for the created segments, one segment per line. yading@10: .IP "\fBcsv, ext\fR" 4 yading@10: .IX Item "csv, ext" yading@10: Generate a list for the created segments, one segment per line, yading@10: each line matching the format (comma-separated values): yading@10: .Sp yading@10: .Vb 1 yading@10: \& ,, yading@10: .Ve yading@10: .Sp yading@10: \&\fIsegment_filename\fR is the name of the output file generated by the yading@10: muxer according to the provided pattern. \s-1CSV\s0 escaping (according to yading@10: \&\s-1RFC4180\s0) is applied if required. yading@10: .Sp yading@10: \&\fIsegment_start_time\fR and \fIsegment_end_time\fR specify yading@10: the segment start and end time expressed in seconds. yading@10: .Sp yading@10: A list file with the suffix \f(CW".csv"\fR or \f(CW".ext"\fR will yading@10: auto-select this format. yading@10: .Sp yading@10: \&\f(CW\*(C`ext\*(C'\fR is deprecated in favor or \f(CW\*(C`csv\*(C'\fR. yading@10: .IP "\fBffconcat\fR" 4 yading@10: .IX Item "ffconcat" yading@10: Generate an ffconcat file for the created segments. The resulting file yading@10: can be read using the FFmpeg concat demuxer. yading@10: .Sp yading@10: A list file with the suffix \f(CW".ffcat"\fR or \f(CW".ffconcat"\fR will yading@10: auto-select this format. yading@10: .IP "\fBm3u8\fR" 4 yading@10: .IX Item "m3u8" yading@10: Generate an extended M3U8 file, version 3, compliant with yading@10: <\fBhttp://tools.ietf.org/id/draft\-pantos\-http\-live\-streaming\fR>. yading@10: .Sp yading@10: A list file with the suffix \f(CW".m3u8"\fR will auto-select this format. yading@10: .RE yading@10: .RS 4 yading@10: .Sp yading@10: If not specified the type is guessed from the list file name suffix. yading@10: .RE yading@10: .IP "\fBsegment_time\fR \fItime\fR" 4 yading@10: .IX Item "segment_time time" yading@10: Set segment duration to \fItime\fR, the value must be a duration yading@10: specification. Default value is \*(L"2\*(R". See also the yading@10: \&\fBsegment_times\fR option. yading@10: .Sp yading@10: Note that splitting may not be accurate, unless you force the yading@10: reference stream key-frames at the given time. See the introductory yading@10: notice and the examples below. yading@10: .IP "\fBsegment_time_delta\fR \fIdelta\fR" 4 yading@10: .IX Item "segment_time_delta delta" yading@10: Specify the accuracy time when selecting the start time for a yading@10: segment, expressed as a duration specification. Default value is \*(L"0\*(R". yading@10: .Sp yading@10: When delta is specified a key-frame will start a new segment if its yading@10: \&\s-1PTS\s0 satisfies the relation: yading@10: .Sp yading@10: .Vb 1 yading@10: \& PTS >= start_time \- time_delta yading@10: .Ve yading@10: .Sp yading@10: This option is useful when splitting video content, which is always yading@10: split at \s-1GOP\s0 boundaries, in case a key frame is found just before the yading@10: specified split time. yading@10: .Sp yading@10: In particular may be used in combination with the \fIffmpeg\fR option yading@10: \&\fIforce_key_frames\fR. The key frame times specified by yading@10: \&\fIforce_key_frames\fR may not be set accurately because of rounding yading@10: issues, with the consequence that a key frame time may result set just yading@10: before the specified time. For constant frame rate videos a value of yading@10: 1/2*\fIframe_rate\fR should address the worst case mismatch between yading@10: the specified time and the time set by \fIforce_key_frames\fR. yading@10: .IP "\fBsegment_times\fR \fItimes\fR" 4 yading@10: .IX Item "segment_times times" yading@10: Specify a list of split points. \fItimes\fR contains a list of comma yading@10: separated duration specifications, in increasing order. See also yading@10: the \fBsegment_time\fR option. yading@10: .IP "\fBsegment_frames\fR \fIframes\fR" 4 yading@10: .IX Item "segment_frames frames" yading@10: Specify a list of split video frame numbers. \fIframes\fR contains a yading@10: list of comma separated integer numbers, in increasing order. yading@10: .Sp yading@10: This option specifies to start a new segment whenever a reference yading@10: stream key frame is found and the sequential number (starting from 0) yading@10: of the frame is greater or equal to the next value in the list. yading@10: .IP "\fBsegment_wrap\fR \fIlimit\fR" 4 yading@10: .IX Item "segment_wrap limit" yading@10: Wrap around segment index once it reaches \fIlimit\fR. yading@10: .IP "\fBsegment_start_number\fR \fInumber\fR" 4 yading@10: .IX Item "segment_start_number number" yading@10: Set the sequence number of the first segment. Defaults to \f(CW0\fR. yading@10: .IP "\fBreset_timestamps\fR \fI1|0\fR" 4 yading@10: .IX Item "reset_timestamps 1|0" yading@10: Reset timestamps at the begin of each segment, so that each segment yading@10: will start with near-zero timestamps. It is meant to ease the playback yading@10: of the generated segments. May not work with some combinations of yading@10: muxers/codecs. It is set to \f(CW0\fR by default. yading@10: .PP yading@10: \fIExamples\fR yading@10: .IX Subsection "Examples" yading@10: .IP "\(bu" 4 yading@10: To remux the content of file \fIin.mkv\fR to a list of segments yading@10: \&\fIout\-000.nut\fR, \fIout\-001.nut\fR, etc., and write the list of yading@10: generated segments to \fIout.list\fR: yading@10: .Sp yading@10: .Vb 1 yading@10: \& ffmpeg \-i in.mkv \-codec copy \-map 0 \-f segment \-segment_list out.list out%03d.nut yading@10: .Ve yading@10: .IP "\(bu" 4 yading@10: As the example above, but segment the input file according to the split yading@10: points specified by the \fIsegment_times\fR option: yading@10: .Sp yading@10: .Vb 1 yading@10: \& 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 yading@10: .Ve yading@10: .IP "\(bu" 4 yading@10: As the example above, but use the \f(CW\*(C`ffmpeg\*(C'\fR \fIforce_key_frames\fR yading@10: option to force key frames in the input at the specified location, together yading@10: with the segment option \fIsegment_time_delta\fR to account for yading@10: possible roundings operated when setting key frame times. yading@10: .Sp yading@10: .Vb 2 yading@10: \& ffmpeg \-i in.mkv \-force_key_frames 1,2,3,5,8,13,21 \-codec:v mpeg4 \-codec:a pcm_s16le \-map 0 \e yading@10: \& \-f segment \-segment_list out.csv \-segment_times 1,2,3,5,8,13,21 \-segment_time_delta 0.05 out%03d.nut yading@10: .Ve yading@10: .Sp yading@10: In order to force key frames on the input file, transcoding is yading@10: required. yading@10: .IP "\(bu" 4 yading@10: Segment the input file by splitting the input file according to the yading@10: frame numbers sequence specified with the \fIsegment_frames\fR option: yading@10: .Sp yading@10: .Vb 1 yading@10: \& ffmpeg \-i in.mkv \-codec copy \-map 0 \-f segment \-segment_list out.csv \-segment_frames 100,200,300,500,800 out%03d.nut yading@10: .Ve yading@10: .IP "\(bu" 4 yading@10: To convert the \fIin.mkv\fR to \s-1TS\s0 segments using the \f(CW\*(C`libx264\*(C'\fR yading@10: and \f(CW\*(C`libfaac\*(C'\fR encoders: yading@10: .Sp yading@10: .Vb 1 yading@10: \& ffmpeg \-i in.mkv \-map 0 \-codec:v libx264 \-codec:a libfaac \-f ssegment \-segment_list out.list out%03d.ts yading@10: .Ve yading@10: .IP "\(bu" 4 yading@10: Segment the input file, and create an M3U8 live playlist (can be used yading@10: as live \s-1HLS\s0 source): yading@10: .Sp yading@10: .Vb 2 yading@10: \& ffmpeg \-re \-i in.mkv \-codec copy \-map 0 \-f segment \-segment_list playlist.m3u8 \e yading@10: \& \-segment_list_flags +live \-segment_time 10 out%03d.mkv yading@10: .Ve yading@10: .SS "mp3" yading@10: .IX Subsection "mp3" yading@10: The \s-1MP3\s0 muxer writes a raw \s-1MP3\s0 stream with an ID3v2 header at the beginning and yading@10: optionally an ID3v1 tag at the end. ID3v2.3 and ID3v2.4 are supported, the yading@10: \&\f(CW\*(C`id3v2_version\*(C'\fR option controls which one is used. The legacy ID3v1 tag is yading@10: not written by default, but may be enabled with the \f(CW\*(C`write_id3v1\*(C'\fR option. yading@10: .PP yading@10: For seekable output the muxer also writes a Xing frame at the beginning, which yading@10: contains the number of frames in the file. It is useful for computing duration yading@10: of \s-1VBR\s0 files. yading@10: .PP yading@10: The muxer supports writing ID3v2 attached pictures (\s-1APIC\s0 frames). The pictures yading@10: are supplied to the muxer in form of a video stream with a single packet. There yading@10: can be any number of those streams, each will correspond to a single \s-1APIC\s0 frame. yading@10: The stream metadata tags \fItitle\fR and \fIcomment\fR map to \s-1APIC\s0 yading@10: \&\fIdescription\fR and \fIpicture type\fR respectively. See yading@10: <\fBhttp://id3.org/id3v2.4.0\-frames\fR> for allowed picture types. yading@10: .PP yading@10: Note that the \s-1APIC\s0 frames must be written at the beginning, so the muxer will yading@10: buffer the audio frames until it gets all the pictures. It is therefore advised yading@10: to provide the pictures as soon as possible to avoid excessive buffering. yading@10: .PP yading@10: Examples: yading@10: .PP yading@10: Write an mp3 with an ID3v2.3 header and an ID3v1 footer: yading@10: .PP yading@10: .Vb 1 yading@10: \& ffmpeg \-i INPUT \-id3v2_version 3 \-write_id3v1 1 out.mp3 yading@10: .Ve yading@10: .PP yading@10: To attach a picture to an mp3 file select both the audio and the picture stream yading@10: with \f(CW\*(C`map\*(C'\fR: yading@10: .PP yading@10: .Vb 2 yading@10: \& ffmpeg \-i input.mp3 \-i cover.png \-c copy \-map 0 \-map 1 yading@10: \& \-metadata:s:v title="Album cover" \-metadata:s:v comment="Cover (Front)" out.mp3 yading@10: .Ve yading@10: .SS "ogg" yading@10: .IX Subsection "ogg" yading@10: Ogg container muxer. yading@10: .IP "\fB\-page_duration\fR \fIduration\fR" 4 yading@10: .IX Item "-page_duration duration" yading@10: Preferred page duration, in microseconds. The muxer will attempt to create yading@10: pages that are approximately \fIduration\fR microseconds long. This allows the yading@10: user to compromise between seek granularity and container overhead. The default yading@10: is 1 second. A value of 0 will fill all segments, making pages as large as yading@10: possible. A value of 1 will effectively use 1 packet-per-page in most yading@10: situations, giving a small seek granularity at the cost of additional container yading@10: overhead. yading@10: .SS "tee" yading@10: .IX Subsection "tee" yading@10: The tee muxer can be used to write the same data to several files or any yading@10: other kind of muxer. It can be used, for example, to both stream a video to yading@10: the network and save it to disk at the same time. yading@10: .PP yading@10: It is different from specifying several outputs to the \fBffmpeg\fR yading@10: command-line tool because the audio and video data will be encoded only once yading@10: with the tee muxer; encoding can be a very expensive process. It is not yading@10: useful when using the libavformat \s-1API\s0 directly because it is then possible yading@10: to feed the same packets to several muxers directly. yading@10: .PP yading@10: The slave outputs are specified in the file name given to the muxer, yading@10: separated by '|'. If any of the slave name contains the '|' separator, yading@10: leading or trailing spaces or any special character, it must be yading@10: escaped (see the ``Quoting and escaping'' section in the ffmpeg-utils yading@10: manual). yading@10: .PP yading@10: Options can be specified for each slave by prepending them as a list of yading@10: \&\fIkey\fR=\fIvalue\fR pairs separated by ':', between square brackets. If yading@10: the options values contain a special character or the ':' separator, they yading@10: must be escaped; note that this is a second level escaping. yading@10: .PP yading@10: Example: encode something and both archive it in a WebM file and stream it yading@10: as MPEG-TS over \s-1UDP\s0 (the streams need to be explicitly mapped): yading@10: .PP yading@10: .Vb 2 yading@10: \& ffmpeg \-i ... \-c:v libx264 \-c:a mp2 \-f tee \-map 0:v \-map 0:a yading@10: \& "archive\-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/" yading@10: .Ve yading@10: .PP yading@10: Note: some codecs may need different options depending on the output format; yading@10: the auto-detection of this can not work with the tee muxer. The main example yading@10: is the \fBglobal_header\fR flag. yading@10: .SH "METADATA" yading@10: .IX Header "METADATA" yading@10: FFmpeg is able to dump metadata from media files into a simple UTF\-8\-encoded yading@10: INI-like text file and then load it back using the metadata muxer/demuxer. yading@10: .PP yading@10: The file format is as follows: yading@10: .IP "1." 4 yading@10: A file consists of a header and a number of metadata tags divided into sections, yading@10: each on its own line. yading@10: .IP "2." 4 yading@10: The header is a ';FFMETADATA' string, followed by a version number (now 1). yading@10: .IP "3." 4 yading@10: Metadata tags are of the form 'key=value' yading@10: .IP "4." 4 yading@10: Immediately after header follows global metadata yading@10: .IP "5." 4 yading@10: After global metadata there may be sections with per\-stream/per\-chapter yading@10: metadata. yading@10: .IP "6." 4 yading@10: A section starts with the section name in uppercase (i.e. \s-1STREAM\s0 or \s-1CHAPTER\s0) in yading@10: brackets ('[', ']') and ends with next section or end of file. yading@10: .IP "7." 4 yading@10: At the beginning of a chapter section there may be an optional timebase to be yading@10: used for start/end values. It must be in form 'TIMEBASE=num/den', where num and yading@10: den are integers. If the timebase is missing then start/end times are assumed to yading@10: be in milliseconds. yading@10: Next a chapter section must contain chapter start and end times in form yading@10: \&'START=num', 'END=num', where num is a positive integer. yading@10: .IP "8." 4 yading@10: Empty lines and lines starting with ';' or '#' are ignored. yading@10: .IP "9." 4 yading@10: Metadata keys or values containing special characters ('=', ';', '#', '\e' and a yading@10: newline) must be escaped with a backslash '\e'. yading@10: .IP "10." 4 yading@10: Note that whitespace in metadata (e.g. foo = bar) is considered to be a part of yading@10: the tag (in the example above key is 'foo ', value is ' bar'). yading@10: .PP yading@10: A ffmetadata file might look like this: yading@10: .PP yading@10: .Vb 4 yading@10: \& ;FFMETADATA1 yading@10: \& title=bike\e\eshed yading@10: \& ;this is a comment yading@10: \& artist=FFmpeg troll team yading@10: \& yading@10: \& [CHAPTER] yading@10: \& TIMEBASE=1/1000 yading@10: \& START=0 yading@10: \& #chapter ends at 0:01:00 yading@10: \& END=60000 yading@10: \& title=chapter \e#1 yading@10: \& [STREAM] yading@10: \& title=multi\e yading@10: \& line yading@10: .Ve yading@10: .SH "SEE ALSO" yading@10: .IX Header "SEE ALSO" yading@10: \&\fIffmpeg\fR\|(1), \fIffplay\fR\|(1), \fIffprobe\fR\|(1), \fIffserver\fR\|(1), \fIlibavformat\fR\|(3) yading@10: .SH "AUTHORS" yading@10: .IX Header "AUTHORS" yading@10: The FFmpeg developers. yading@10: .PP yading@10: For details about the authorship, see the Git history of the project yading@10: (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command yading@10: \&\fBgit log\fR in the FFmpeg source directory, or browsing the yading@10: online repository at <\fBhttp://source.ffmpeg.org\fR>. yading@10: .PP yading@10: Maintainers for the specific components are listed in the file yading@10: \&\fI\s-1MAINTAINERS\s0\fR in the source code tree.