Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
  2. .\"
  3. .\" Standard preamble:
  4. .\" ========================================================================
  5. .de Sh \" Subsection heading
  6. .br
  7. .if t .Sp
  8. .ne 5
  9. .PP
  10. \fB\\$1\fR
  11. .PP
  12. ..
  13. .de Sp \" Vertical space (when we can't use .PP)
  14. .if t .sp .5v
  15. .if n .sp
  16. ..
  17. .de Vb \" Begin verbatim text
  18. .ft CW
  19. .nf
  20. .ne \\$1
  21. ..
  22. .de Ve \" End verbatim text
  23. .ft R
  24. .fi
  25. ..
  26. .\" Set up some character translations and predefined strings.  \*(-- will
  27. .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
  28. .\" double quote, and \*(R" will give a right double quote.  | will give a
  29. .\" real vertical bar.  \*(C+ will give a nicer C++.  Capital omega is used to
  30. .\" do unbreakable dashes and therefore won't be available.  \*(C` and \*(C'
  31. .\" expand to `' in nroff, nothing in troff, for use with C<>.
  32. .tr \(*W-|\(bv\*(Tr
  33. .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
  34. .ie n \{\
  35. .    ds -- \(*W-
  36. .    ds PI pi
  37. .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
  38. .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
  39. .    ds L" ""
  40. .    ds R" ""
  41. .    ds C` ""
  42. .    ds C' ""
  43. 'br\}
  44. .el\{\
  45. .    ds -- \|\(em\|
  46. .    ds PI \(*p
  47. .    ds L" ``
  48. .    ds R" ''
  49. 'br\}
  50. .\"
  51. .\" If the F register is turned on, we'll generate index entries on stderr for
  52. .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
  53. .\" entries marked with X<> in POD.  Of course, you'll have to process the
  54. .\" output yourself in some meaningful fashion.
  55. .if \nF \{\
  56. .    de IX
  57. .    tm Index:\\$1\t\\n%\t"\\$2"
  58. ..
  59. .    nr % 0
  60. .    rr F
  61. .\}
  62. .\"
  63. .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
  64. .\" way too many mistakes in technical documents.
  65. .hy 0
  66. .if n .na
  67. .\"
  68. .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
  69. .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
  70. .    \" fudge factors for nroff and troff
  71. .if n \{\
  72. .    ds #H 0
  73. .    ds #V .8m
  74. .    ds #F .3m
  75. .    ds #[ \f1
  76. .    ds #] \fP
  77. .\}
  78. .if t \{\
  79. .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
  80. .    ds #V .6m
  81. .    ds #F 0
  82. .    ds #[ \&
  83. .    ds #] \&
  84. .\}
  85. .    \" simple accents for nroff and troff
  86. .if n \{\
  87. .    ds ' \&
  88. .    ds ` \&
  89. .    ds ^ \&
  90. .    ds , \&
  91. .    ds ~ ~
  92. .    ds /
  93. .\}
  94. .if t \{\
  95. .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
  96. .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
  97. .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
  98. .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
  99. .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
  100. .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
  101. .\}
  102. .    \" troff and (daisy-wheel) nroff accents
  103. .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
  104. .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
  105. .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
  106. .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
  107. .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
  108. .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
  109. .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
  110. .ds ae a\h'-(\w'a'u*4/10)'e
  111. .ds Ae A\h'-(\w'A'u*4/10)'E
  112. .    \" corrections for vroff
  113. .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
  114. .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
  115. .    \" for low resolution devices (crt and lpr)
  116. .if \n(.H>23 .if \n(.V>19 \
  117. \{\
  118. .    ds : e
  119. .    ds 8 ss
  120. .    ds o a
  121. .    ds d- d\h'-1'\(ga
  122. .    ds D- D\h'-1'\(hy
  123. .    ds th \o'bp'
  124. .    ds Th \o'LP'
  125. .    ds ae ae
  126. .    ds Ae AE
  127. .\}
  128. .rm #[ #] #H #V #F C
  129. .\" ========================================================================
  130. .\"
  131. .IX Title "FFMPEG-FORMATS 1"
  132. .TH FFMPEG-FORMATS 1 "2013-12-14" " " " "
  133. .SH "NAME"
  134. ffmpeg\-formats \- FFmpeg formats
  135. .SH "DESCRIPTION"
  136. .IX Header "DESCRIPTION"
  137. This document describes the supported formats (muxers and demuxers)
  138. provided by the libavformat library.
  139. .SH "FORMAT OPTIONS"
  140. .IX Header "FORMAT OPTIONS"
  141. The libavformat library provides some generic global options, which
  142. can be set on all the muxers and demuxers. In addition each muxer or
  143. demuxer may support so-called private options, which are specific for
  144. that component.
  145. .PP
  146. Options may be set by specifying \-\fIoption\fR \fIvalue\fR in the
  147. FFmpeg tools, or by setting the value explicitly in the
  148. \&\f(CW\*(C`AVFormatContext\*(C'\fR options or using the \fIlibavutil/opt.h\fR \s-1API\s0
  149. for programmatic use.
  150. .PP
  151. The list of supported options follows:
  152. .IP "\fBavioflags\fR \fIflags\fR \fB(\fR\fIinput/output\fR\fB)\fR" 4
  153. .IX Item "avioflags flags (input/output)"
  154. Possible values:
  155. .RS 4
  156. .IP "\fBdirect\fR" 4
  157. .IX Item "direct"
  158. Reduce buffering.
  159. .RE
  160. .RS 4
  161. .RE
  162. .IP "\fBprobesize\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4
  163. .IX Item "probesize integer (input)"
  164. Set probing size in bytes, i.e. the size of the data to analyze to get
  165. stream information. A higher value will allow to detect more
  166. information in case it is dispersed into the stream, but will increase
  167. latency. Must be an integer not lesser than 32. It is 5000000 by default.
  168. .IP "\fBpacketsize\fR \fIinteger\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
  169. .IX Item "packetsize integer (output)"
  170. Set packet size.
  171. .IP "\fBfflags\fR \fIflags\fR \fB(\fR\fIinput/output\fR\fB)\fR" 4
  172. .IX Item "fflags flags (input/output)"
  173. Set format flags.
  174. .Sp
  175. Possible values:
  176. .RS 4
  177. .IP "\fBignidx\fR" 4
  178. .IX Item "ignidx"
  179. Ignore index.
  180. .IP "\fBgenpts\fR" 4
  181. .IX Item "genpts"
  182. Generate \s-1PTS\s0.
  183. .IP "\fBnofillin\fR" 4
  184. .IX Item "nofillin"
  185. Do not fill in missing values that can be exactly calculated.
  186. .IP "\fBnoparse\fR" 4
  187. .IX Item "noparse"
  188. Disable AVParsers, this needs \f(CW\*(C`+nofillin\*(C'\fR too.
  189. .IP "\fBigndts\fR" 4
  190. .IX Item "igndts"
  191. Ignore \s-1DTS\s0.
  192. .IP "\fBdiscardcorrupt\fR" 4
  193. .IX Item "discardcorrupt"
  194. Discard corrupted frames.
  195. .IP "\fBsortdts\fR" 4
  196. .IX Item "sortdts"
  197. Try to interleave output packets by \s-1DTS\s0.
  198. .IP "\fBkeepside\fR" 4
  199. .IX Item "keepside"
  200. Do not merge side data.
  201. .IP "\fBlatm\fR" 4
  202. .IX Item "latm"
  203. Enable \s-1RTP\s0 \s-1MP4A\-LATM\s0 payload.
  204. .IP "\fBnobuffer\fR" 4
  205. .IX Item "nobuffer"
  206. Reduce the latency introduced by optional buffering
  207. .RE
  208. .RS 4
  209. .RE
  210. .IP "\fBseek2any\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4
  211. .IX Item "seek2any integer (input)"
  212. Allow seeking to non-keyframes on demuxer level when supported if set to 1.
  213. Default is 0.
  214. .IP "\fBanalyzeduration\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4
  215. .IX Item "analyzeduration integer (input)"
  216. Specify how many microseconds are analyzed to probe the input. A
  217. higher value will allow to detect more accurate information, but will
  218. increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
  219. .IP "\fBcryptokey\fR \fIhexadecimal string\fR \fB(\fR\fIinput\fR\fB)\fR" 4
  220. .IX Item "cryptokey hexadecimal string (input)"
  221. Set decryption key.
  222. .IP "\fBindexmem\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4
  223. .IX Item "indexmem integer (input)"
  224. Set max memory used for timestamp index (per stream).
  225. .IP "\fBrtbufsize\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4
  226. .IX Item "rtbufsize integer (input)"
  227. Set max memory used for buffering real-time frames.
  228. .IP "\fBfdebug\fR \fIflags\fR \fB(\fR\fIinput/output\fR\fB)\fR" 4
  229. .IX Item "fdebug flags (input/output)"
  230. Print specific debug info.
  231. .Sp
  232. Possible values:
  233. .RS 4
  234. .IP "\fBts\fR" 4
  235. .IX Item "ts"
  236. .RE
  237. .RS 4
  238. .RE
  239. .PD 0
  240. .IP "\fBmax_delay\fR \fIinteger\fR \fB(\fR\fIinput/output\fR\fB)\fR" 4
  241. .IX Item "max_delay integer (input/output)"
  242. .PD
  243. Set maximum muxing or demuxing delay in microseconds.
  244. .IP "\fBfpsprobesize\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4
  245. .IX Item "fpsprobesize integer (input)"
  246. Set number of frames used to probe fps.
  247. .IP "\fBaudio_preload\fR \fIinteger\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
  248. .IX Item "audio_preload integer (output)"
  249. Set microseconds by which audio packets should be interleaved earlier.
  250. .IP "\fBchunk_duration\fR \fIinteger\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
  251. .IX Item "chunk_duration integer (output)"
  252. Set microseconds for each chunk.
  253. .IP "\fBchunk_size\fR \fIinteger\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
  254. .IX Item "chunk_size integer (output)"
  255. Set size in bytes for each chunk.
  256. .IP "\fBerr_detect, f_err_detect\fR \fIflags\fR \fB(\fR\fIinput\fR\fB)\fR" 4
  257. .IX Item "err_detect, f_err_detect flags (input)"
  258. Set error detection flags. \f(CW\*(C`f_err_detect\*(C'\fR is deprecated and
  259. should be used only via the \fBffmpeg\fR tool.
  260. .Sp
  261. Possible values:
  262. .RS 4
  263. .IP "\fBcrccheck\fR" 4
  264. .IX Item "crccheck"
  265. Verify embedded CRCs.
  266. .IP "\fBbitstream\fR" 4
  267. .IX Item "bitstream"
  268. Detect bitstream specification deviations.
  269. .IP "\fBbuffer\fR" 4
  270. .IX Item "buffer"
  271. Detect improper bitstream length.
  272. .IP "\fBexplode\fR" 4
  273. .IX Item "explode"
  274. Abort decoding on minor error detection.
  275. .IP "\fBcareful\fR" 4
  276. .IX Item "careful"
  277. Consider things that violate the spec and have not been seen in the
  278. wild as errors.
  279. .IP "\fBcompliant\fR" 4
  280. .IX Item "compliant"
  281. Consider all spec non compliancies as errors.
  282. .IP "\fBaggressive\fR" 4
  283. .IX Item "aggressive"
  284. Consider things that a sane encoder should not do as an error.
  285. .RE
  286. .RS 4
  287. .RE
  288. .IP "\fBuse_wallclock_as_timestamps\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4
  289. .IX Item "use_wallclock_as_timestamps integer (input)"
  290. Use wallclock as timestamps.
  291. .IP "\fBavoid_negative_ts\fR \fIinteger\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
  292. .IX Item "avoid_negative_ts integer (output)"
  293. Shift timestamps to make them non\-negative. A value of 1 enables shifting,
  294. a value of 0 disables it, the default value of \-1 enables shifting
  295. when required by the target format.
  296. .Sp
  297. When shifting is enabled, all output timestamps are shifted by the
  298. same amount. Audio, video, and subtitles desynching and relative
  299. timestamp differences are preserved compared to how they would have
  300. been without shifting.
  301. .Sp
  302. Also note that this affects only leading negative timestamps, and not
  303. non-monotonic negative timestamps.
  304. .IP "\fBskip_initial_bytes\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4
  305. .IX Item "skip_initial_bytes integer (input)"
  306. Set number of bytes to skip before reading header and frames if set to 1.
  307. Default is 0.
  308. .IP "\fBcorrect_ts_overflow\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4
  309. .IX Item "correct_ts_overflow integer (input)"
  310. Correct single timestamp overflows if set to 1. Default is 1.
  311. .IP "\fBflush_packets\fR \fIinteger\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
  312. .IX Item "flush_packets integer (output)"
  313. Flush the underlying I/O stream after each packet. Default 1 enables it, and
  314. has the effect of reducing the latency; 0 disables it and may slightly
  315. increase performance in some cases.
  316. .Sh "Format stream specifiers"
  317. .IX Subsection "Format stream specifiers"
  318. Format stream specifiers allow selection of one or more streams that
  319. match specific properties.
  320. .PP
  321. Possible forms of stream specifiers are:
  322. .IP "\fIstream_index\fR" 4
  323. .IX Item "stream_index"
  324. Matches the stream with this index.
  325. .IP "\fIstream_type\fR\fB[:\fR\fIstream_index\fR\fB]\fR" 4
  326. .IX Item "stream_type[:stream_index]"
  327. \&\fIstream_type\fR is one of following: 'v' for video, 'a' for audio,
  328. \&'s' for subtitle, 'd' for data, and 't' for attachments. If
  329. \&\fIstream_index\fR is given, then it matches the stream number
  330. \&\fIstream_index\fR of this type. Otherwise, it matches all streams of
  331. this type.
  332. .IP "\fBp:\fR\fIprogram_id\fR\fB[:\fR\fIstream_index\fR\fB]\fR" 4
  333. .IX Item "p:program_id[:stream_index]"
  334. If \fIstream_index\fR is given, then it matches the stream with number
  335. \&\fIstream_index\fR in the program with the id
  336. \&\fIprogram_id\fR. Otherwise, it matches all streams in the program.
  337. .IP "\fB#\fR\fIstream_id\fR" 4
  338. .IX Item "#stream_id"
  339. Matches the stream by a format-specific \s-1ID\s0.
  340. .PP
  341. The exact semantics of stream specifiers is defined by the
  342. \&\f(CW\*(C`avformat_match_stream_specifier()\*(C'\fR function declared in the
  343. \&\fIlibavformat/avformat.h\fR header.
  344. .SH "DEMUXERS"
  345. .IX Header "DEMUXERS"
  346. Demuxers are configured elements in FFmpeg that can read the
  347. multimedia streams from a particular type of file.
  348. .PP
  349. When you configure your FFmpeg build, all the supported demuxers
  350. are enabled by default. You can list all available ones using the
  351. configure option \f(CW\*(C`\-\-list\-demuxers\*(C'\fR.
  352. .PP
  353. You can disable all the demuxers using the configure option
  354. \&\f(CW\*(C`\-\-disable\-demuxers\*(C'\fR, and selectively enable a single demuxer with
  355. the option \f(CW\*(C`\-\-enable\-demuxer=\f(CI\s-1DEMUXER\s0\f(CW\*(C'\fR, or disable it
  356. with the option \f(CW\*(C`\-\-disable\-demuxer=\f(CI\s-1DEMUXER\s0\f(CW\*(C'\fR.
  357. .PP
  358. The option \f(CW\*(C`\-formats\*(C'\fR of the ff* tools will display the list of
  359. enabled demuxers.
  360. .PP
  361. The description of some of the currently available demuxers follows.
  362. .Sh "applehttp"
  363. .IX Subsection "applehttp"
  364. Apple \s-1HTTP\s0 Live Streaming demuxer.
  365. .PP
  366. This demuxer presents all AVStreams from all variant streams.
  367. The id field is set to the bitrate variant index number. By setting
  368. the discard flags on AVStreams (by pressing 'a' or 'v' in ffplay),
  369. the caller can decide which variant streams to actually receive.
  370. The total bitrate of the variant that the stream belongs to is
  371. available in a metadata key named \*(L"variant_bitrate\*(R".
  372. .Sh "asf"
  373. .IX Subsection "asf"
  374. Advanced Systems Format demuxer.
  375. .PP
  376. This demuxer is used to demux \s-1ASF\s0 files and \s-1MMS\s0 network streams.
  377. .IP "\fB\-no_resync_search\fR \fIbool\fR" 4
  378. .IX Item "-no_resync_search bool"
  379. Do not try to resynchronize by looking for a certain optional start code.
  380. .Sh "concat"
  381. .IX Subsection "concat"
  382. Virtual concatenation script demuxer.
  383. .PP
  384. This demuxer reads a list of files and other directives from a text file and
  385. demuxes them one after the other, as if all their packet had been muxed
  386. together.
  387. .PP
  388. The timestamps in the files are adjusted so that the first file starts at 0
  389. and each next file starts where the previous one finishes. Note that it is
  390. done globally and may cause gaps if all streams do not have exactly the same
  391. length.
  392. .PP
  393. All files must have the same streams (same codecs, same time base, etc.).
  394. .PP
  395. The duration of each file is used to adjust the timestamps of the next file:
  396. if the duration is incorrect (because it was computed using the bit-rate or
  397. because the file is truncated, for example), it can cause artifacts. The
  398. \&\f(CW\*(C`duration\*(C'\fR directive can be used to override the duration stored in
  399. each file.
  400. .PP
  401. \fISyntax\fR
  402. .IX Subsection "Syntax"
  403. .PP
  404. The script is a text file in extended\-ASCII, with one directive per line.
  405. Empty lines, leading spaces and lines starting with '#' are ignored. The
  406. following directive is recognized:
  407. .ie n .IP "\fB\fB""file \f(BIpath\f(CB""\fB\fR" 4
  408. .el .IP "\fB\f(CBfile \f(CBpath\f(CB\fB\fR" 4
  409. .IX Item "file path"
  410. Path to a file to read; special characters and spaces must be escaped with
  411. backslash or single quotes.
  412. .Sp
  413. All subsequent directives apply to that file.
  414. .ie n .IP "\fB\fB""ffconcat version 1.0""\fB\fR" 4
  415. .el .IP "\fB\f(CBffconcat version 1.0\fB\fR" 4
  416. .IX Item "ffconcat version 1.0"
  417. Identify the script type and version. It also sets the \fBsafe\fR option
  418. to 1 if it was to its default \-1.
  419. .Sp
  420. To make FFmpeg recognize the format automatically, this directive must
  421. appears exactly as is (no extra space or byte\-order\-mark) on the very first
  422. line of the script.
  423. .ie n .IP "\fB\fB""duration \f(BIdur\f(CB""\fB\fR" 4
  424. .el .IP "\fB\f(CBduration \f(CBdur\f(CB\fB\fR" 4
  425. .IX Item "duration dur"
  426. Duration of the file. This information can be specified from the file;
  427. specifying it here may be more efficient or help if the information from the
  428. file is not available or accurate.
  429. .Sp
  430. If the duration is set for all files, then it is possible to seek in the
  431. whole concatenated video.
  432. .PP
  433. \fIOptions\fR
  434. .IX Subsection "Options"
  435. .PP
  436. This demuxer accepts the following option:
  437. .IP "\fBsafe\fR" 4
  438. .IX Item "safe"
  439. If set to 1, reject unsafe file paths. A file path is considered safe if it
  440. does not contain a protocol specification and is relative and all components
  441. only contain characters from the portable character set (letters, digits,
  442. period, underscore and hyphen) and have no period at the beginning of a
  443. component.
  444. .Sp
  445. If set to 0, any file name is accepted.
  446. .Sp
  447. The default is \-1, it is equivalent to 1 if the format was automatically
  448. probed and 0 otherwise.
  449. .Sh "flv"
  450. .IX Subsection "flv"
  451. Adobe Flash Video Format demuxer.
  452. .PP
  453. This demuxer is used to demux \s-1FLV\s0 files and \s-1RTMP\s0 network streams.
  454. .IP "\fB\-flv_metadata\fR \fIbool\fR" 4
  455. .IX Item "-flv_metadata bool"
  456. Allocate the streams according to the onMetaData array content.
  457. .Sh "libgme"
  458. .IX Subsection "libgme"
  459. The Game Music Emu library is a collection of video game music file emulators.
  460. .PP
  461. See <\fBhttp://code.google.com/p/game\-music\-emu/\fR> for more information.
  462. .PP
  463. Some files have multiple tracks. The demuxer will pick the first track by
  464. default. The \fBtrack_index\fR option can be used to select a different
  465. track. Track indexes start at 0. The demuxer exports the number of tracks as
  466. \&\fItracks\fR meta data entry.
  467. .PP
  468. For very large files, the \fBmax_size\fR option may have to be adjusted.
  469. .Sh "libquvi"
  470. .IX Subsection "libquvi"
  471. Play media from Internet services using the quvi project.
  472. .PP
  473. The demuxer accepts a \fBformat\fR option to request a specific quality. It
  474. is by default set to \fIbest\fR.
  475. .PP
  476. See <\fBhttp://quvi.sourceforge.net/\fR> for more information.
  477. .PP
  478. FFmpeg needs to be built with \f(CW\*(C`\-\-enable\-libquvi\*(C'\fR for this demuxer to be
  479. enabled.
  480. .Sh "image2"
  481. .IX Subsection "image2"
  482. Image file demuxer.
  483. .PP
  484. This demuxer reads from a list of image files specified by a pattern.
  485. The syntax and meaning of the pattern is specified by the
  486. option \fIpattern_type\fR.
  487. .PP
  488. The pattern may contain a suffix which is used to automatically
  489. determine the format of the images contained in the files.
  490. .PP
  491. The size, the pixel format, and the format of each image must be the
  492. same for all the files in the sequence.
  493. .PP
  494. This demuxer accepts the following options:
  495. .IP "\fBframerate\fR" 4
  496. .IX Item "framerate"
  497. Set the frame rate for the video stream. It defaults to 25.
  498. .IP "\fBloop\fR" 4
  499. .IX Item "loop"
  500. If set to 1, loop over the input. Default value is 0.
  501. .IP "\fBpattern_type\fR" 4
  502. .IX Item "pattern_type"
  503. Select the pattern type used to interpret the provided filename.
  504. .Sp
  505. \&\fIpattern_type\fR accepts one of the following values.
  506. .RS 4
  507. .IP "\fBsequence\fR" 4
  508. .IX Item "sequence"
  509. Select a sequence pattern type, used to specify a sequence of files
  510. indexed by sequential numbers.
  511. .Sp
  512. A sequence pattern may contain the string \*(L"%d\*(R" or "%0\fIN\fRd\*(L", which
  513. specifies the position of the characters representing a sequential
  514. number in each filename matched by the pattern. If the form
  515. \&\*(R"%d0\fIN\fRd" is used, the string representing the number in each
  516. filename is 0\-padded and \fIN\fR is the total number of 0\-padded
  517. digits representing the number. The literal character '%' can be
  518. specified in the pattern with the string \*(L"%%\*(R".
  519. .Sp
  520. If the sequence pattern contains \*(L"%d\*(R" or "%0\fIN\fRd", the first filename of
  521. the file list specified by the pattern must contain a number
  522. inclusively contained between \fIstart_number\fR and
  523. \&\fIstart_number\fR+\fIstart_number_range\fR\-1, and all the following
  524. numbers must be sequential.
  525. .Sp
  526. For example the pattern \*(L"img\-%03d.bmp\*(R" will match a sequence of
  527. filenames of the form \fIimg\-001.bmp\fR, \fIimg\-002.bmp\fR, ...,
  528. \&\fIimg\-010.bmp\fR, etc.; the pattern \*(L"i%%m%%g\-%d.jpg\*(R" will match a
  529. sequence of filenames of the form \fIi%m%g\-1.jpg\fR,
  530. \&\fIi%m%g\-2.jpg\fR, ..., \fIi%m%g\-10.jpg\fR, etc.
  531. .Sp
  532. Note that the pattern must not necessarily contain \*(L"%d\*(R" or
  533. "%0\fIN\fRd", for example to convert a single image file
  534. \&\fIimg.jpeg\fR you can employ the command:
  535. .Sp
  536. .Vb 1
  537. \&        ffmpeg -i img.jpeg img.png
  538. .Ve
  539. .IP "\fBglob\fR" 4
  540. .IX Item "glob"
  541. Select a glob wildcard pattern type.
  542. .Sp
  543. The pattern is interpreted like a \f(CW\*(C`glob()\*(C'\fR pattern. This is only
  544. selectable if libavformat was compiled with globbing support.
  545. .IP "\fBglob_sequence\fR \fI(deprecated, will be removed)\fR" 4
  546. .IX Item "glob_sequence (deprecated, will be removed)"
  547. Select a mixed glob wildcard/sequence pattern.
  548. .Sp
  549. If your version of libavformat was compiled with globbing support, and
  550. the provided pattern contains at least one glob meta character among
  551. \&\f(CW\*(C`%*?[]{}\*(C'\fR that is preceded by an unescaped \*(L"%\*(R", the pattern is
  552. interpreted like a \f(CW\*(C`glob()\*(C'\fR pattern, otherwise it is interpreted
  553. like a sequence pattern.
  554. .Sp
  555. All glob special characters \f(CW\*(C`%*?[]{}\*(C'\fR must be prefixed
  556. with \*(L"%\*(R". To escape a literal \*(L"%\*(R" you shall use \*(L"%%\*(R".
  557. .Sp
  558. For example the pattern \f(CW\*(C`foo\-%*.jpeg\*(C'\fR will match all the
  559. filenames prefixed by \*(L"foo\-\*(R" and terminating with \*(L".jpeg\*(R", and
  560. \&\f(CW\*(C`foo\-%?%?%?.jpeg\*(C'\fR will match all the filenames prefixed with
  561. \&\*(L"foo\-\*(R", followed by a sequence of three characters, and terminating
  562. with \*(L".jpeg\*(R".
  563. .Sp
  564. This pattern type is deprecated in favor of \fIglob\fR and
  565. \&\fIsequence\fR.
  566. .RE
  567. .RS 4
  568. .Sp
  569. Default value is \fIglob_sequence\fR.
  570. .RE
  571. .IP "\fBpixel_format\fR" 4
  572. .IX Item "pixel_format"
  573. Set the pixel format of the images to read. If not specified the pixel
  574. format is guessed from the first image file in the sequence.
  575. .IP "\fBstart_number\fR" 4
  576. .IX Item "start_number"
  577. Set the index of the file matched by the image file pattern to start
  578. to read from. Default value is 0.
  579. .IP "\fBstart_number_range\fR" 4
  580. .IX Item "start_number_range"
  581. Set the index interval range to check when looking for the first image
  582. file in the sequence, starting from \fIstart_number\fR. Default value
  583. is 5.
  584. .IP "\fBts_from_file\fR" 4
  585. .IX Item "ts_from_file"
  586. If set to 1, will set frame timestamp to modification time of image file. Note
  587. that monotonity of timestamps is not provided: images go in the same order as
  588. without this option. Default value is 0.
  589. .IP "\fBvideo_size\fR" 4
  590. .IX Item "video_size"
  591. Set the video size of the images to read. If not specified the video
  592. size is guessed from the first image file in the sequence.
  593. .PP
  594. \fIExamples\fR
  595. .IX Subsection "Examples"
  596. .IP "\(bu" 4
  597. Use \fBffmpeg\fR for creating a video from the images in the file
  598. sequence \fIimg\-001.jpeg\fR, \fIimg\-002.jpeg\fR, ..., assuming an
  599. input frame rate of 10 frames per second:
  600. .Sp
  601. .Vb 1
  602. \&        ffmpeg -framerate 10 -i 'img-%03d.jpeg' out.mkv
  603. .Ve
  604. .IP "\(bu" 4
  605. As above, but start by reading from a file with index 100 in the sequence:
  606. .Sp
  607. .Vb 1
  608. \&        ffmpeg -framerate 10 -start_number 100 -i 'img-%03d.jpeg' out.mkv
  609. .Ve
  610. .IP "\(bu" 4
  611. Read images matching the \*(L"*.png\*(R" glob pattern , that is all the files
  612. terminating with the \*(L".png\*(R" suffix:
  613. .Sp
  614. .Vb 1
  615. \&        ffmpeg -framerate 10 -pattern_type glob -i "*.png" out.mkv
  616. .Ve
  617. .Sh "mpegts"
  618. .IX Subsection "mpegts"
  619. \&\s-1MPEG\-2\s0 transport stream demuxer.
  620. .IP "\fBfix_teletext_pts\fR" 4
  621. .IX Item "fix_teletext_pts"
  622. Overrides teletext packet \s-1PTS\s0 and \s-1DTS\s0 values with the timestamps calculated
  623. from the \s-1PCR\s0 of the first program which the teletext stream is part of and is
  624. not discarded. Default value is 1, set this option to 0 if you want your
  625. teletext packet \s-1PTS\s0 and \s-1DTS\s0 values untouched.
  626. .Sh "rawvideo"
  627. .IX Subsection "rawvideo"
  628. Raw video demuxer.
  629. .PP
  630. This demuxer allows to read raw video data. Since there is no header
  631. specifying the assumed video parameters, the user must specify them
  632. in order to be able to decode the data correctly.
  633. .PP
  634. This demuxer accepts the following options:
  635. .IP "\fBframerate\fR" 4
  636. .IX Item "framerate"
  637. Set input video frame rate. Default value is 25.
  638. .IP "\fBpixel_format\fR" 4
  639. .IX Item "pixel_format"
  640. Set the input video pixel format. Default value is \f(CW\*(C`yuv420p\*(C'\fR.
  641. .IP "\fBvideo_size\fR" 4
  642. .IX Item "video_size"
  643. Set the input video size. This value must be specified explicitly.
  644. .PP
  645. For example to read a rawvideo file \fIinput.raw\fR with
  646. \&\fBffplay\fR, assuming a pixel format of \f(CW\*(C`rgb24\*(C'\fR, a video
  647. size of \f(CW\*(C`320x240\*(C'\fR, and a frame rate of 10 images per second, use
  648. the command:
  649. .PP
  650. .Vb 1
  651. \&        ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
  652. .Ve
  653. .Sh "sbg"
  654. .IX Subsection "sbg"
  655. SBaGen script demuxer.
  656. .PP
  657. This demuxer reads the script language used by SBaGen
  658. <\fBhttp://uazu.net/sbagen/\fR> to generate binaural beats sessions. A \s-1SBG\s0
  659. script looks like that:
  660. .PP
  661. .Vb 9
  662. \&        -SE
  663. \&        a: 300-2.5/3 440+4.5/0
  664. \&        b: 300-2.5/0 440+4.5/3
  665. \&        off: -
  666. \&        NOW      == a
  667. \&        +0:07:00 == b
  668. \&        +0:14:00 == a
  669. \&        +0:21:00 == b
  670. \&        +0:30:00    off
  671. .Ve
  672. .PP
  673. A \s-1SBG\s0 script can mix absolute and relative timestamps. If the script uses
  674. either only absolute timestamps (including the script start time) or only
  675. relative ones, then its layout is fixed, and the conversion is
  676. straightforward. On the other hand, if the script mixes both kind of
  677. timestamps, then the \fI\s-1NOW\s0\fR reference for relative timestamps will be
  678. taken from the current time of day at the time the script is read, and the
  679. script layout will be frozen according to that reference. That means that if
  680. the script is directly played, the actual times will match the absolute
  681. timestamps up to the sound controller's clock accuracy, but if the user
  682. somehow pauses the playback or seeks, all times will be shifted accordingly.
  683. .Sh "tedcaptions"
  684. .IX Subsection "tedcaptions"
  685. \&\s-1JSON\s0 captions used for <\fBhttp://www.ted.com/\fR>.
  686. .PP
  687. \&\s-1TED\s0 does not provide links to the captions, but they can be guessed from the
  688. page. The file \fItools/bookmarklets.html\fR from the FFmpeg source tree
  689. contains a bookmarklet to expose them.
  690. .PP
  691. This demuxer accepts the following option:
  692. .IP "\fBstart_time\fR" 4
  693. .IX Item "start_time"
  694. Set the start time of the \s-1TED\s0 talk, in milliseconds. The default is 15000
  695. (15s). It is used to sync the captions with the downloadable videos, because
  696. they include a 15s intro.
  697. .PP
  698. Example: convert the captions to a format most players understand:
  699. .PP
  700. .Vb 1
  701. \&        ffmpeg -i http://www.ted.com/talks/subtitles/id/1/lang/en talk1-en.srt
  702. .Ve
  703. .SH "MUXERS"
  704. .IX Header "MUXERS"
  705. Muxers are configured elements in FFmpeg which allow writing
  706. multimedia streams to a particular type of file.
  707. .PP
  708. When you configure your FFmpeg build, all the supported muxers
  709. are enabled by default. You can list all available muxers using the
  710. configure option \f(CW\*(C`\-\-list\-muxers\*(C'\fR.
  711. .PP
  712. You can disable all the muxers with the configure option
  713. \&\f(CW\*(C`\-\-disable\-muxers\*(C'\fR and selectively enable / disable single muxers
  714. with the options \f(CW\*(C`\-\-enable\-muxer=\f(CI\s-1MUXER\s0\f(CW\*(C'\fR /
  715. \&\f(CW\*(C`\-\-disable\-muxer=\f(CI\s-1MUXER\s0\f(CW\*(C'\fR.
  716. .PP
  717. The option \f(CW\*(C`\-formats\*(C'\fR of the ff* tools will display the list of
  718. enabled muxers.
  719. .PP
  720. A description of some of the currently available muxers follows.
  721. .Sh "aiff"
  722. .IX Subsection "aiff"
  723. Audio Interchange File Format muxer.
  724. .PP
  725. It accepts the following options:
  726. .IP "\fBwrite_id3v2\fR" 4
  727. .IX Item "write_id3v2"
  728. Enable ID3v2 tags writing when set to 1. Default is 0 (disabled).
  729. .IP "\fBid3v2_version\fR" 4
  730. .IX Item "id3v2_version"
  731. Select ID3v2 version to write. Currently only version 3 and 4 (aka.
  732. ID3v2.3 and ID3v2.4) are supported. The default is version 4.
  733. .Sh "crc"
  734. .IX Subsection "crc"
  735. \&\s-1CRC\s0 (Cyclic Redundancy Check) testing format.
  736. .PP
  737. This muxer computes and prints the Adler\-32 \s-1CRC\s0 of all the input audio
  738. and video frames. By default audio frames are converted to signed
  739. 16\-bit raw audio and video frames to raw video before computing the
  740. \&\s-1CRC\s0.
  741. .PP
  742. The output of the muxer consists of a single line of the form:
  743. CRC=0x\fI\s-1CRC\s0\fR, where \fI\s-1CRC\s0\fR is a hexadecimal number 0\-padded to
  744. 8 digits containing the \s-1CRC\s0 for all the decoded input frames.
  745. .PP
  746. For example to compute the \s-1CRC\s0 of the input, and store it in the file
  747. \&\fIout.crc\fR:
  748. .PP
  749. .Vb 1
  750. \&        ffmpeg -i INPUT -f crc out.crc
  751. .Ve
  752. .PP
  753. You can print the \s-1CRC\s0 to stdout with the command:
  754. .PP
  755. .Vb 1
  756. \&        ffmpeg -i INPUT -f crc -
  757. .Ve
  758. .PP
  759. You can select the output format of each frame with \fBffmpeg\fR by
  760. specifying the audio and video codec and format. For example to
  761. compute the \s-1CRC\s0 of the input audio converted to \s-1PCM\s0 unsigned 8\-bit
  762. and the input video converted to \s-1MPEG\-2\s0 video, use the command:
  763. .PP
  764. .Vb 1
  765. \&        ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f crc -
  766. .Ve
  767. .PP
  768. See also the framecrc muxer.
  769. .Sh "framecrc"
  770. .IX Subsection "framecrc"
  771. Per-packet \s-1CRC\s0 (Cyclic Redundancy Check) testing format.
  772. .PP
  773. This muxer computes and prints the Adler\-32 \s-1CRC\s0 for each audio
  774. and video packet. By default audio frames are converted to signed
  775. 16\-bit raw audio and video frames to raw video before computing the
  776. \&\s-1CRC\s0.
  777. .PP
  778. The output of the muxer consists of a line for each audio and video
  779. packet of the form:
  780. .PP
  781. .Vb 1
  782. \&        <stream_index>, <packet_dts>, <packet_pts>, <packet_duration>, <packet_size>, 0x<CRC>
  783. .Ve
  784. .PP
  785. \&\fI\s-1CRC\s0\fR is a hexadecimal number 0\-padded to 8 digits containing the
  786. \&\s-1CRC\s0 of the packet.
  787. .PP
  788. For example to compute the \s-1CRC\s0 of the audio and video frames in
  789. \&\fI\s-1INPUT\s0\fR, converted to raw audio and video packets, and store it
  790. in the file \fIout.crc\fR:
  791. .PP
  792. .Vb 1
  793. \&        ffmpeg -i INPUT -f framecrc out.crc
  794. .Ve
  795. .PP
  796. To print the information to stdout, use the command:
  797. .PP
  798. .Vb 1
  799. \&        ffmpeg -i INPUT -f framecrc -
  800. .Ve
  801. .PP
  802. With \fBffmpeg\fR, you can select the output format to which the
  803. audio and video frames are encoded before computing the \s-1CRC\s0 for each
  804. packet by specifying the audio and video codec. For example, to
  805. compute the \s-1CRC\s0 of each decoded input audio frame converted to \s-1PCM\s0
  806. unsigned 8\-bit and of each decoded input video frame converted to
  807. \&\s-1MPEG\-2\s0 video, use the command:
  808. .PP
  809. .Vb 1
  810. \&        ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f framecrc -
  811. .Ve
  812. .PP
  813. See also the crc muxer.
  814. .Sh "framemd5"
  815. .IX Subsection "framemd5"
  816. Per-packet \s-1MD5\s0 testing format.
  817. .PP
  818. This muxer computes and prints the \s-1MD5\s0 hash for each audio
  819. and video packet. By default audio frames are converted to signed
  820. 16\-bit raw audio and video frames to raw video before computing the
  821. hash.
  822. .PP
  823. The output of the muxer consists of a line for each audio and video
  824. packet of the form:
  825. .PP
  826. .Vb 1
  827. \&        <stream_index>, <packet_dts>, <packet_pts>, <packet_duration>, <packet_size>, <MD5>
  828. .Ve
  829. .PP
  830. \&\fI\s-1MD5\s0\fR is a hexadecimal number representing the computed \s-1MD5\s0 hash
  831. for the packet.
  832. .PP
  833. For example to compute the \s-1MD5\s0 of the audio and video frames in
  834. \&\fI\s-1INPUT\s0\fR, converted to raw audio and video packets, and store it
  835. in the file \fIout.md5\fR:
  836. .PP
  837. .Vb 1
  838. \&        ffmpeg -i INPUT -f framemd5 out.md5
  839. .Ve
  840. .PP
  841. To print the information to stdout, use the command:
  842. .PP
  843. .Vb 1
  844. \&        ffmpeg -i INPUT -f framemd5 -
  845. .Ve
  846. .PP
  847. See also the md5 muxer.
  848. .Sh "hls"
  849. .IX Subsection "hls"
  850. Apple \s-1HTTP\s0 Live Streaming muxer that segments MPEG-TS according to
  851. the \s-1HTTP\s0 Live Streaming specification.
  852. .PP
  853. It creates a playlist file and numbered segment files. The output
  854. filename specifies the playlist filename; the segment filenames
  855. receive the same basename as the playlist, a sequential number and
  856. a .ts extension.
  857. .PP
  858. .Vb 1
  859. \&        ffmpeg -i in.nut out.m3u8
  860. .Ve
  861. .IP "\fB\-hls_time\fR \fIseconds\fR" 4
  862. .IX Item "-hls_time seconds"
  863. Set the segment length in seconds.
  864. .IP "\fB\-hls_list_size\fR \fIsize\fR" 4
  865. .IX Item "-hls_list_size size"
  866. Set the maximum number of playlist entries.
  867. .IP "\fB\-hls_wrap\fR \fIwrap\fR" 4
  868. .IX Item "-hls_wrap wrap"
  869. Set the number after which index wraps.
  870. .IP "\fB\-start_number\fR \fInumber\fR" 4
  871. .IX Item "-start_number number"
  872. Start the sequence from \fInumber\fR.
  873. .Sh "ico"
  874. .IX Subsection "ico"
  875. \&\s-1ICO\s0 file muxer.
  876. .PP
  877. Microsoft's icon file format (\s-1ICO\s0) has some strict limitations that should be noted:
  878. .IP "\(bu" 4
  879. Size cannot exceed 256 pixels in any dimension
  880. .IP "\(bu" 4
  881. Only \s-1BMP\s0 and \s-1PNG\s0 images can be stored
  882. .IP "\(bu" 4
  883. If a \s-1BMP\s0 image is used, it must be one of the following pixel formats:
  884. .Sp
  885. .Vb 7
  886. \&        BMP Bit Depth      FFmpeg Pixel Format
  887. \&        1bit               pal8
  888. \&        4bit               pal8
  889. \&        8bit               pal8
  890. \&        16bit              rgb555le
  891. \&        24bit              bgr24
  892. \&        32bit              bgra
  893. .Ve
  894. .IP "\(bu" 4
  895. If a \s-1BMP\s0 image is used, it must use the \s-1BITMAPINFOHEADER\s0 \s-1DIB\s0 header
  896. .IP "\(bu" 4
  897. If a \s-1PNG\s0 image is used, it must use the rgba pixel format
  898. .Sh "image2"
  899. .IX Subsection "image2"
  900. Image file muxer.
  901. .PP
  902. The image file muxer writes video frames to image files.
  903. .PP
  904. The output filenames are specified by a pattern, which can be used to
  905. produce sequentially numbered series of files.
  906. The pattern may contain the string \*(L"%d\*(R" or "%0\fIN\fRd\*(L", this string
  907. specifies the position of the characters representing a numbering in
  908. the filenames. If the form \*(R"%0\fIN\fRd" is used, the string
  909. representing the number in each filename is 0\-padded to \fIN\fR
  910. digits. The literal character '%' can be specified in the pattern with
  911. the string \*(L"%%\*(R".
  912. .PP
  913. If the pattern contains \*(L"%d\*(R" or "%0\fIN\fRd", the first filename of
  914. the file list specified will contain the number 1, all the following
  915. numbers will be sequential.
  916. .PP
  917. The pattern may contain a suffix which is used to automatically
  918. determine the format of the image files to write.
  919. .PP
  920. For example the pattern \*(L"img\-%03d.bmp\*(R" will specify a sequence of
  921. filenames of the form \fIimg\-001.bmp\fR, \fIimg\-002.bmp\fR, ...,
  922. \&\fIimg\-010.bmp\fR, etc.
  923. The pattern \*(L"img%%\-%d.jpg\*(R" will specify a sequence of filenames of the
  924. form \fIimg%\-1.jpg\fR, \fIimg%\-2.jpg\fR, ..., \fIimg%\-10.jpg\fR,
  925. etc.
  926. .PP
  927. The following example shows how to use \fBffmpeg\fR for creating a
  928. sequence of files \fIimg\-001.jpeg\fR, \fIimg\-002.jpeg\fR, ...,
  929. taking one image every second from the input video:
  930. .PP
  931. .Vb 1
  932. \&        ffmpeg -i in.avi -vsync 1 -r 1 -f image2 'img-%03d.jpeg'
  933. .Ve
  934. .PP
  935. Note that with \fBffmpeg\fR, if the format is not specified with the
  936. \&\f(CW\*(C`\-f\*(C'\fR option and the output filename specifies an image file
  937. format, the image2 muxer is automatically selected, so the previous
  938. command can be written as:
  939. .PP
  940. .Vb 1
  941. \&        ffmpeg -i in.avi -vsync 1 -r 1 'img-%03d.jpeg'
  942. .Ve
  943. .PP
  944. Note also that the pattern must not necessarily contain \*(L"%d\*(R" or
  945. "%0\fIN\fRd", for example to create a single image file
  946. \&\fIimg.jpeg\fR from the input video you can employ the command:
  947. .PP
  948. .Vb 1
  949. \&        ffmpeg -i in.avi -f image2 -frames:v 1 img.jpeg
  950. .Ve
  951. .IP "\fBstart_number\fR \fInumber\fR" 4
  952. .IX Item "start_number number"
  953. Start the sequence from \fInumber\fR. Default value is 1. Must be a
  954. non-negative number.
  955. .IP "\fB\-update\fR \fInumber\fR" 4
  956. .IX Item "-update number"
  957. If \fInumber\fR is nonzero, the filename will always be interpreted as just a
  958. filename, not a pattern, and this file will be continuously overwritten with new
  959. images.
  960. .PP
  961. The image muxer supports the .Y.U.V image file format. This format is
  962. special in that that each image frame consists of three files, for
  963. each of the \s-1YUV420P\s0 components. To read or write this image file format,
  964. specify the name of the '.Y' file. The muxer will automatically open the
  965. \&'.U' and '.V' files as required.
  966. .Sh "matroska"
  967. .IX Subsection "matroska"
  968. Matroska container muxer.
  969. .PP
  970. This muxer implements the matroska and webm container specs.
  971. .PP
  972. The recognized metadata settings in this muxer are:
  973. .IP "\fBtitle=\fR\fItitle name\fR" 4
  974. .IX Item "title=title name"
  975. Name provided to a single track
  976. .IP "\fBlanguage=\fR\fIlanguage name\fR" 4
  977. .IX Item "language=language name"
  978. Specifies the language of the track in the Matroska languages form
  979. .IP "\fBstereo_mode=\fR\fImode\fR" 4
  980. .IX Item "stereo_mode=mode"
  981. Stereo 3D video layout of two views in a single video track
  982. .RS 4
  983. .IP "\fBmono\fR" 4
  984. .IX Item "mono"
  985. video is not stereo
  986. .IP "\fBleft_right\fR" 4
  987. .IX Item "left_right"
  988. Both views are arranged side by side, Left-eye view is on the left
  989. .IP "\fBbottom_top\fR" 4
  990. .IX Item "bottom_top"
  991. Both views are arranged in top-bottom orientation, Left-eye view is at bottom
  992. .IP "\fBtop_bottom\fR" 4
  993. .IX Item "top_bottom"
  994. Both views are arranged in top-bottom orientation, Left-eye view is on top
  995. .IP "\fBcheckerboard_rl\fR" 4
  996. .IX Item "checkerboard_rl"
  997. Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first
  998. .IP "\fBcheckerboard_lr\fR" 4
  999. .IX Item "checkerboard_lr"
  1000. Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first
  1001. .IP "\fBrow_interleaved_rl\fR" 4
  1002. .IX Item "row_interleaved_rl"
  1003. Each view is constituted by a row based interleaving, Right-eye view is first row
  1004. .IP "\fBrow_interleaved_lr\fR" 4
  1005. .IX Item "row_interleaved_lr"
  1006. Each view is constituted by a row based interleaving, Left-eye view is first row
  1007. .IP "\fBcol_interleaved_rl\fR" 4
  1008. .IX Item "col_interleaved_rl"
  1009. Both views are arranged in a column based interleaving manner, Right-eye view is first column
  1010. .IP "\fBcol_interleaved_lr\fR" 4
  1011. .IX Item "col_interleaved_lr"
  1012. Both views are arranged in a column based interleaving manner, Left-eye view is first column
  1013. .IP "\fBanaglyph_cyan_red\fR" 4
  1014. .IX Item "anaglyph_cyan_red"
  1015. All frames are in anaglyph format viewable through red-cyan filters
  1016. .IP "\fBright_left\fR" 4
  1017. .IX Item "right_left"
  1018. Both views are arranged side by side, Right-eye view is on the left
  1019. .IP "\fBanaglyph_green_magenta\fR" 4
  1020. .IX Item "anaglyph_green_magenta"
  1021. All frames are in anaglyph format viewable through green-magenta filters
  1022. .IP "\fBblock_lr\fR" 4
  1023. .IX Item "block_lr"
  1024. Both eyes laced in one Block, Left-eye view is first
  1025. .IP "\fBblock_rl\fR" 4
  1026. .IX Item "block_rl"
  1027. Both eyes laced in one Block, Right-eye view is first
  1028. .RE
  1029. .RS 4
  1030. .RE
  1031. .PP
  1032. For example a 3D WebM clip can be created using the following command line:
  1033. .PP
  1034. .Vb 1
  1035. \&        ffmpeg -i sample_left_right_clip.mpg -an -c:v libvpx -metadata stereo_mode=left_right -y stereo_clip.webm
  1036. .Ve
  1037. .PP
  1038. This muxer supports the following options:
  1039. .IP "\fBreserve_index_space\fR" 4
  1040. .IX Item "reserve_index_space"
  1041. By default, this muxer writes the index for seeking (called cues in Matroska
  1042. terms) at the end of the file, because it cannot know in advance how much space
  1043. to leave for the index at the beginning of the file. However for some use cases
  1044. \&\*(-- e.g.  streaming where seeking is possible but slow \*(-- it is useful to put the
  1045. index at the beginning of the file.
  1046. .Sp
  1047. If this option is set to a non-zero value, the muxer will reserve a given amount
  1048. of space in the file header and then try to write the cues there when the muxing
  1049. finishes. If the available space does not suffice, muxing will fail. A safe size
  1050. for most use cases should be about 50kB per hour of video.
  1051. .Sp
  1052. Note that cues are only written if the output is seekable and this option will
  1053. have no effect if it is not.
  1054. .Sh "md5"
  1055. .IX Subsection "md5"
  1056. \&\s-1MD5\s0 testing format.
  1057. .PP
  1058. This muxer computes and prints the \s-1MD5\s0 hash of all the input audio
  1059. and video frames. By default audio frames are converted to signed
  1060. 16\-bit raw audio and video frames to raw video before computing the
  1061. hash.
  1062. .PP
  1063. The output of the muxer consists of a single line of the form:
  1064. MD5=\fI\s-1MD5\s0\fR, where \fI\s-1MD5\s0\fR is a hexadecimal number representing
  1065. the computed \s-1MD5\s0 hash.
  1066. .PP
  1067. For example to compute the \s-1MD5\s0 hash of the input converted to raw
  1068. audio and video, and store it in the file \fIout.md5\fR:
  1069. .PP
  1070. .Vb 1
  1071. \&        ffmpeg -i INPUT -f md5 out.md5
  1072. .Ve
  1073. .PP
  1074. You can print the \s-1MD5\s0 to stdout with the command:
  1075. .PP
  1076. .Vb 1
  1077. \&        ffmpeg -i INPUT -f md5 -
  1078. .Ve
  1079. .PP
  1080. See also the framemd5 muxer.
  1081. .Sh "\s-1MOV/MP4/ISMV\s0"
  1082. .IX Subsection "MOV/MP4/ISMV"
  1083. The mov/mp4/ismv muxer supports fragmentation. Normally, a \s-1MOV/MP4\s0
  1084. file has all the metadata about all packets stored in one location
  1085. (written at the end of the file, it can be moved to the start for
  1086. better playback by adding \fIfaststart\fR to the \fImovflags\fR, or
  1087. using the \fBqt-faststart\fR tool). A fragmented
  1088. file consists of a number of fragments, where packets and metadata
  1089. about these packets are stored together. Writing a fragmented
  1090. file has the advantage that the file is decodable even if the
  1091. writing is interrupted (while a normal \s-1MOV/MP4\s0 is undecodable if
  1092. it is not properly finished), and it requires less memory when writing
  1093. very long files (since writing normal \s-1MOV/MP4\s0 files stores info about
  1094. every single packet in memory until the file is closed). The downside
  1095. is that it is less compatible with other applications.
  1096. .PP
  1097. Fragmentation is enabled by setting one of the AVOptions that define
  1098. how to cut the file into fragments:
  1099. .IP "\fB\-moov_size\fR \fIbytes\fR" 4
  1100. .IX Item "-moov_size bytes"
  1101. Reserves space for the moov atom at the beginning of the file instead of placing the
  1102. moov atom at the end. If the space reserved is insufficient, muxing will fail.
  1103. .IP "\fB\-movflags frag_keyframe\fR" 4
  1104. .IX Item "-movflags frag_keyframe"
  1105. Start a new fragment at each video keyframe.
  1106. .IP "\fB\-frag_duration\fR \fIduration\fR" 4
  1107. .IX Item "-frag_duration duration"
  1108. Create fragments that are \fIduration\fR microseconds long.
  1109. .IP "\fB\-frag_size\fR \fIsize\fR" 4
  1110. .IX Item "-frag_size size"
  1111. Create fragments that contain up to \fIsize\fR bytes of payload data.
  1112. .IP "\fB\-movflags frag_custom\fR" 4
  1113. .IX Item "-movflags frag_custom"
  1114. Allow the caller to manually choose when to cut fragments, by
  1115. calling \f(CW\*(C`av_write_frame(ctx, NULL)\*(C'\fR to write a fragment with
  1116. the packets written so far. (This is only useful with other
  1117. applications integrating libavformat, not from \fBffmpeg\fR.)
  1118. .IP "\fB\-min_frag_duration\fR \fIduration\fR" 4
  1119. .IX Item "-min_frag_duration duration"
  1120. Don't create fragments that are shorter than \fIduration\fR microseconds long.
  1121. .PP
  1122. If more than one condition is specified, fragments are cut when
  1123. one of the specified conditions is fulfilled. The exception to this is
  1124. \&\f(CW\*(C`\-min_frag_duration\*(C'\fR, which has to be fulfilled for any of the other
  1125. conditions to apply.
  1126. .PP
  1127. Additionally, the way the output file is written can be adjusted
  1128. through a few other options:
  1129. .IP "\fB\-movflags empty_moov\fR" 4
  1130. .IX Item "-movflags empty_moov"
  1131. Write an initial moov atom directly at the start of the file, without
  1132. describing any samples in it. Generally, an mdat/moov pair is written
  1133. at the start of the file, as a normal \s-1MOV/MP4\s0 file, containing only
  1134. a short portion of the file. With this option set, there is no initial
  1135. mdat atom, and the moov atom only describes the tracks but has
  1136. a zero duration.
  1137. .Sp
  1138. Files written with this option set do not work in QuickTime.
  1139. This option is implicitly set when writing ismv (Smooth Streaming) files.
  1140. .IP "\fB\-movflags separate_moof\fR" 4
  1141. .IX Item "-movflags separate_moof"
  1142. Write a separate moof (movie fragment) atom for each track. Normally,
  1143. packets for all tracks are written in a moof atom (which is slightly
  1144. more efficient), but with this option set, the muxer writes one moof/mdat
  1145. pair for each track, making it easier to separate tracks.
  1146. .Sp
  1147. This option is implicitly set when writing ismv (Smooth Streaming) files.
  1148. .IP "\fB\-movflags faststart\fR" 4
  1149. .IX Item "-movflags faststart"
  1150. Run a second pass moving the index (moov atom) to the beginning of the file.
  1151. This operation can take a while, and will not work in various situations such
  1152. as fragmented output, thus it is not enabled by default.
  1153. .IP "\fB\-movflags rtphint\fR" 4
  1154. .IX Item "-movflags rtphint"
  1155. Add \s-1RTP\s0 hinting tracks to the output file.
  1156. .PP
  1157. Smooth Streaming content can be pushed in real time to a publishing
  1158. point on \s-1IIS\s0 with this muxer. Example:
  1159. .PP
  1160. .Vb 1
  1161. \&        ffmpeg -re <<normal input/transcoding options>> -movflags isml+frag_keyframe -f ismv http://server/publishingpoint.isml/Streams(Encoder1)
  1162. .Ve
  1163. .Sh "mp3"
  1164. .IX Subsection "mp3"
  1165. The \s-1MP3\s0 muxer writes a raw \s-1MP3\s0 stream with an ID3v2 header at the beginning and
  1166. optionally an ID3v1 tag at the end. ID3v2.3 and ID3v2.4 are supported, the
  1167. \&\f(CW\*(C`id3v2_version\*(C'\fR option controls which one is used. The legacy ID3v1 tag is
  1168. not written by default, but may be enabled with the \f(CW\*(C`write_id3v1\*(C'\fR option.
  1169. .PP
  1170. For seekable output the muxer also writes a Xing frame at the beginning, which
  1171. contains the number of frames in the file. It is useful for computing duration
  1172. of \s-1VBR\s0 files.
  1173. .PP
  1174. The muxer supports writing ID3v2 attached pictures (\s-1APIC\s0 frames). The pictures
  1175. are supplied to the muxer in form of a video stream with a single packet. There
  1176. can be any number of those streams, each will correspond to a single \s-1APIC\s0 frame.
  1177. The stream metadata tags \fItitle\fR and \fIcomment\fR map to \s-1APIC\s0
  1178. \&\fIdescription\fR and \fIpicture type\fR respectively. See
  1179. <\fBhttp://id3.org/id3v2.4.0\-frames\fR> for allowed picture types.
  1180. .PP
  1181. Note that the \s-1APIC\s0 frames must be written at the beginning, so the muxer will
  1182. buffer the audio frames until it gets all the pictures. It is therefore advised
  1183. to provide the pictures as soon as possible to avoid excessive buffering.
  1184. .PP
  1185. Examples:
  1186. .PP
  1187. Write an mp3 with an ID3v2.3 header and an ID3v1 footer:
  1188. .PP
  1189. .Vb 1
  1190. \&        ffmpeg -i INPUT -id3v2_version 3 -write_id3v1 1 out.mp3
  1191. .Ve
  1192. .PP
  1193. To attach a picture to an mp3 file select both the audio and the picture stream
  1194. with \f(CW\*(C`map\*(C'\fR:
  1195. .PP
  1196. .Vb 2
  1197. \&        ffmpeg -i input.mp3 -i cover.png -c copy -map 0 -map 1
  1198. \&        -metadata:s:v title="Album cover" -metadata:s:v comment="Cover (Front)" out.mp3
  1199. .Ve
  1200. .Sh "mpegts"
  1201. .IX Subsection "mpegts"
  1202. \&\s-1MPEG\s0 transport stream muxer.
  1203. .PP
  1204. This muxer implements \s-1ISO\s0 13818\-1 and part of \s-1ETSI\s0 \s-1EN\s0 300 468.
  1205. .PP
  1206. The muxer options are:
  1207. .IP "\fB\-mpegts_original_network_id\fR \fInumber\fR" 4
  1208. .IX Item "-mpegts_original_network_id number"
  1209. Set the original_network_id (default 0x0001). This is unique identifier
  1210. of a network in \s-1DVB\s0. Its main use is in the unique identification of a
  1211. service through the path Original_Network_ID, Transport_Stream_ID.
  1212. .IP "\fB\-mpegts_transport_stream_id\fR \fInumber\fR" 4
  1213. .IX Item "-mpegts_transport_stream_id number"
  1214. Set the transport_stream_id (default 0x0001). This identifies a
  1215. transponder in \s-1DVB\s0.
  1216. .IP "\fB\-mpegts_service_id\fR \fInumber\fR" 4
  1217. .IX Item "-mpegts_service_id number"
  1218. Set the service_id (default 0x0001) also known as program in \s-1DVB\s0.
  1219. .IP "\fB\-mpegts_pmt_start_pid\fR \fInumber\fR" 4
  1220. .IX Item "-mpegts_pmt_start_pid number"
  1221. Set the first \s-1PID\s0 for \s-1PMT\s0 (default 0x1000, max 0x1f00).
  1222. .IP "\fB\-mpegts_start_pid\fR \fInumber\fR" 4
  1223. .IX Item "-mpegts_start_pid number"
  1224. Set the first \s-1PID\s0 for data packets (default 0x0100, max 0x0f00).
  1225. .IP "\fB\-mpegts_m2ts_mode\fR \fInumber\fR" 4
  1226. .IX Item "-mpegts_m2ts_mode number"
  1227. Enable m2ts mode if set to 1. Default value is \-1 which disables m2ts mode.
  1228. .IP "\fB\-muxrate\fR \fInumber\fR" 4
  1229. .IX Item "-muxrate number"
  1230. Set muxrate.
  1231. .IP "\fB\-pes_payload_size\fR \fInumber\fR" 4
  1232. .IX Item "-pes_payload_size number"
  1233. Set minimum \s-1PES\s0 packet payload in bytes.
  1234. .IP "\fB\-mpegts_flags\fR \fIflags\fR" 4
  1235. .IX Item "-mpegts_flags flags"
  1236. Set flags (see below).
  1237. .IP "\fB\-mpegts_copyts\fR \fInumber\fR" 4
  1238. .IX Item "-mpegts_copyts number"
  1239. Preserve original timestamps, if value is set to 1. Default value is \-1, which
  1240. results in shifting timestamps so that they start from 0.
  1241. .IP "\fB\-tables_version\fR \fInumber\fR" 4
  1242. .IX Item "-tables_version number"
  1243. Set \s-1PAT\s0, \s-1PMT\s0 and \s-1SDT\s0 version (default 0, valid values are from 0 to 31, inclusively).
  1244. This option allows updating stream structure so that standard consumer may
  1245. detect the change. To do so, reopen output AVFormatContext (in case of \s-1API\s0
  1246. usage) or restart ffmpeg instance, cyclically changing tables_version value:
  1247. .Sp
  1248. .Vb 7
  1249. \&        ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udp://1.1.1.1:1111
  1250. \&        ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
  1251. \&        ...
  1252. \&        ffmpeg -i source3.ts -codec copy -f mpegts -tables_version 31 udp://1.1.1.1:1111
  1253. \&        ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udp://1.1.1.1:1111
  1254. \&        ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
  1255. \&        ...
  1256. .Ve
  1257. .PP
  1258. Option mpegts_flags may take a set of such flags:
  1259. .IP "\fBresend_headers\fR" 4
  1260. .IX Item "resend_headers"
  1261. Reemit \s-1PAT/PMT\s0 before writing the next packet.
  1262. .IP "\fBlatm\fR" 4
  1263. .IX Item "latm"
  1264. Use \s-1LATM\s0 packetization for \s-1AAC\s0.
  1265. .PP
  1266. The recognized metadata settings in mpegts muxer are \f(CW\*(C`service_provider\*(C'\fR
  1267. and \f(CW\*(C`service_name\*(C'\fR. If they are not set the default for
  1268. \&\f(CW\*(C`service_provider\*(C'\fR is \*(L"FFmpeg\*(R" and the default for
  1269. \&\f(CW\*(C`service_name\*(C'\fR is \*(L"Service01\*(R".
  1270. .PP
  1271. .Vb 9
  1272. \&        ffmpeg -i file.mpg -c copy \e
  1273. \&             -mpegts_original_network_id 0x1122 \e
  1274. \&             -mpegts_transport_stream_id 0x3344 \e
  1275. \&             -mpegts_service_id 0x5566 \e
  1276. \&             -mpegts_pmt_start_pid 0x1500 \e
  1277. \&             -mpegts_start_pid 0x150 \e
  1278. \&             -metadata service_provider="Some provider" \e
  1279. \&             -metadata service_name="Some Channel" \e
  1280. \&             -y out.ts
  1281. .Ve
  1282. .Sh "null"
  1283. .IX Subsection "null"
  1284. Null muxer.
  1285. .PP
  1286. This muxer does not generate any output file, it is mainly useful for
  1287. testing or benchmarking purposes.
  1288. .PP
  1289. For example to benchmark decoding with \fBffmpeg\fR you can use the
  1290. command:
  1291. .PP
  1292. .Vb 1
  1293. \&        ffmpeg -benchmark -i INPUT -f null out.null
  1294. .Ve
  1295. .PP
  1296. Note that the above command does not read or write the \fIout.null\fR
  1297. file, but specifying the output file is required by the \fBffmpeg\fR
  1298. syntax.
  1299. .PP
  1300. Alternatively you can write the command as:
  1301. .PP
  1302. .Vb 1
  1303. \&        ffmpeg -benchmark -i INPUT -f null -
  1304. .Ve
  1305. .Sh "ogg"
  1306. .IX Subsection "ogg"
  1307. Ogg container muxer.
  1308. .IP "\fB\-page_duration\fR \fIduration\fR" 4
  1309. .IX Item "-page_duration duration"
  1310. Preferred page duration, in microseconds. The muxer will attempt to create
  1311. pages that are approximately \fIduration\fR microseconds long. This allows the
  1312. user to compromise between seek granularity and container overhead. The default
  1313. is 1 second. A value of 0 will fill all segments, making pages as large as
  1314. possible. A value of 1 will effectively use 1 packet-per-page in most
  1315. situations, giving a small seek granularity at the cost of additional container
  1316. overhead.
  1317. .Sh "segment, stream_segment, ssegment"
  1318. .IX Subsection "segment, stream_segment, ssegment"
  1319. Basic stream segmenter.
  1320. .PP
  1321. The segmenter muxer outputs streams to a number of separate files of nearly
  1322. fixed duration. Output filename pattern can be set in a fashion similar to
  1323. image2.
  1324. .PP
  1325. \&\f(CW\*(C`stream_segment\*(C'\fR is a variant of the muxer used to write to
  1326. streaming output formats, i.e. which do not require global headers,
  1327. and is recommended for outputting e.g. to \s-1MPEG\s0 transport stream segments.
  1328. \&\f(CW\*(C`ssegment\*(C'\fR is a shorter alias for \f(CW\*(C`stream_segment\*(C'\fR.
  1329. .PP
  1330. Every segment starts with a keyframe of the selected reference stream,
  1331. which is set through the \fBreference_stream\fR option.
  1332. .PP
  1333. Note that if you want accurate splitting for a video file, you need to
  1334. make the input key frames correspond to the exact splitting times
  1335. expected by the segmenter, or the segment muxer will start the new
  1336. segment with the key frame found next after the specified start
  1337. time.
  1338. .PP
  1339. The segment muxer works best with a single constant frame rate video.
  1340. .PP
  1341. Optionally it can generate a list of the created segments, by setting
  1342. the option \fIsegment_list\fR. The list type is specified by the
  1343. \&\fIsegment_list_type\fR option.
  1344. .PP
  1345. The segment muxer supports the following options:
  1346. .IP "\fBreference_stream\fR \fIspecifier\fR" 4
  1347. .IX Item "reference_stream specifier"
  1348. Set the reference stream, as specified by the string \fIspecifier\fR.
  1349. If \fIspecifier\fR is set to \f(CW\*(C`auto\*(C'\fR, the reference is choosen
  1350. automatically. Otherwise it must be a stream specifier (see the ``Stream
  1351. specifiers'' chapter in the ffmpeg manual) which specifies the
  1352. reference stream. The default value is \f(CW\*(C`auto\*(C'\fR.
  1353. .IP "\fBsegment_format\fR \fIformat\fR" 4
  1354. .IX Item "segment_format format"
  1355. Override the inner container format, by default it is guessed by the filename
  1356. extension.
  1357. .IP "\fBsegment_list\fR \fIname\fR" 4
  1358. .IX Item "segment_list name"
  1359. Generate also a listfile named \fIname\fR. If not specified no
  1360. listfile is generated.
  1361. .IP "\fBsegment_list_flags\fR \fIflags\fR" 4
  1362. .IX Item "segment_list_flags flags"
  1363. Set flags affecting the segment list generation.
  1364. .Sp
  1365. It currently supports the following flags:
  1366. .RS 4
  1367. .IP "\fBcache\fR" 4
  1368. .IX Item "cache"
  1369. Allow caching (only affects M3U8 list files).
  1370. .IP "\fBlive\fR" 4
  1371. .IX Item "live"
  1372. Allow live-friendly file generation.
  1373. .RE
  1374. .RS 4
  1375. .Sp
  1376. Default value is \f(CW\*(C`samp\*(C'\fR.
  1377. .RE
  1378. .IP "\fBsegment_list_size\fR \fIsize\fR" 4
  1379. .IX Item "segment_list_size size"
  1380. Update the list file so that it contains at most the last \fIsize\fR
  1381. segments. If 0 the list file will contain all the segments. Default
  1382. value is 0.
  1383. .IP "\fBsegment_list_type\fR \fItype\fR" 4
  1384. .IX Item "segment_list_type type"
  1385. Specify the format for the segment list file.
  1386. .Sp
  1387. The following values are recognized:
  1388. .RS 4
  1389. .IP "\fBflat\fR" 4
  1390. .IX Item "flat"
  1391. Generate a flat list for the created segments, one segment per line.
  1392. .IP "\fBcsv, ext\fR" 4
  1393. .IX Item "csv, ext"
  1394. Generate a list for the created segments, one segment per line,
  1395. each line matching the format (comma\-separated values):
  1396. .Sp
  1397. .Vb 1
  1398. \&        <segment_filename>,<segment_start_time>,<segment_end_time>
  1399. .Ve
  1400. .Sp
  1401. \&\fIsegment_filename\fR is the name of the output file generated by the
  1402. muxer according to the provided pattern. \s-1CSV\s0 escaping (according to
  1403. \&\s-1RFC4180\s0) is applied if required.
  1404. .Sp
  1405. \&\fIsegment_start_time\fR and \fIsegment_end_time\fR specify
  1406. the segment start and end time expressed in seconds.
  1407. .Sp
  1408. A list file with the suffix \f(CW".csv"\fR or \f(CW".ext"\fR will
  1409. auto-select this format.
  1410. .Sp
  1411. \&\fBext\fR is deprecated in favor or \fBcsv\fR.
  1412. .IP "\fBffconcat\fR" 4
  1413. .IX Item "ffconcat"
  1414. Generate an ffconcat file for the created segments. The resulting file
  1415. can be read using the FFmpeg concat demuxer.
  1416. .Sp
  1417. A list file with the suffix \f(CW".ffcat"\fR or \f(CW".ffconcat"\fR will
  1418. auto-select this format.
  1419. .IP "\fBm3u8\fR" 4
  1420. .IX Item "m3u8"
  1421. Generate an extended M3U8 file, version 3, compliant with
  1422. <\fBhttp://tools.ietf.org/id/draft\-pantos\-http\-live\-streaming\fR>.
  1423. .Sp
  1424. A list file with the suffix \f(CW".m3u8"\fR will auto-select this format.
  1425. .RE
  1426. .RS 4
  1427. .Sp
  1428. If not specified the type is guessed from the list file name suffix.
  1429. .RE
  1430. .IP "\fBsegment_time\fR \fItime\fR" 4
  1431. .IX Item "segment_time time"
  1432. Set segment duration to \fItime\fR, the value must be a duration
  1433. specification. Default value is \*(L"2\*(R". See also the
  1434. \&\fBsegment_times\fR option.
  1435. .Sp
  1436. Note that splitting may not be accurate, unless you force the
  1437. reference stream key-frames at the given time. See the introductory
  1438. notice and the examples below.
  1439. .IP "\fBsegment_time_delta\fR \fIdelta\fR" 4
  1440. .IX Item "segment_time_delta delta"
  1441. Specify the accuracy time when selecting the start time for a
  1442. segment, expressed as a duration specification. Default value is \*(L"0\*(R".
  1443. .Sp
  1444. When delta is specified a key-frame will start a new segment if its
  1445. \&\s-1PTS\s0 satisfies the relation:
  1446. .Sp
  1447. .Vb 1
  1448. \&        PTS >= start_time - time_delta
  1449. .Ve
  1450. .Sp
  1451. This option is useful when splitting video content, which is always
  1452. split at \s-1GOP\s0 boundaries, in case a key frame is found just before the
  1453. specified split time.
  1454. .Sp
  1455. In particular may be used in combination with the \fIffmpeg\fR option
  1456. \&\fIforce_key_frames\fR. The key frame times specified by
  1457. \&\fIforce_key_frames\fR may not be set accurately because of rounding
  1458. issues, with the consequence that a key frame time may result set just
  1459. before the specified time. For constant frame rate videos a value of
  1460. 1/2*\fIframe_rate\fR should address the worst case mismatch between
  1461. the specified time and the time set by \fIforce_key_frames\fR.
  1462. .IP "\fBsegment_times\fR \fItimes\fR" 4
  1463. .IX Item "segment_times times"
  1464. Specify a list of split points. \fItimes\fR contains a list of comma
  1465. separated duration specifications, in increasing order. See also
  1466. the \fBsegment_time\fR option.
  1467. .IP "\fBsegment_frames\fR \fIframes\fR" 4
  1468. .IX Item "segment_frames frames"
  1469. Specify a list of split video frame numbers. \fIframes\fR contains a
  1470. list of comma separated integer numbers, in increasing order.
  1471. .Sp
  1472. This option specifies to start a new segment whenever a reference
  1473. stream key frame is found and the sequential number (starting from 0)
  1474. of the frame is greater or equal to the next value in the list.
  1475. .IP "\fBsegment_wrap\fR \fIlimit\fR" 4
  1476. .IX Item "segment_wrap limit"
  1477. Wrap around segment index once it reaches \fIlimit\fR.
  1478. .IP "\fBsegment_start_number\fR \fInumber\fR" 4
  1479. .IX Item "segment_start_number number"
  1480. Set the sequence number of the first segment. Defaults to \f(CW0\fR.
  1481. .IP "\fBreset_timestamps\fR \fI1|0\fR" 4
  1482. .IX Item "reset_timestamps 1|0"
  1483. Reset timestamps at the begin of each segment, so that each segment
  1484. will start with near-zero timestamps. It is meant to ease the playback
  1485. of the generated segments. May not work with some combinations of
  1486. muxers/codecs. It is set to \f(CW0\fR by default.
  1487. .IP "\fBinitial_offset\fR \fIoffset\fR" 4
  1488. .IX Item "initial_offset offset"
  1489. Specify timestamp offset to apply to the output packet timestamps. The
  1490. argument must be a time duration specification, and defaults to 0.
  1491. .PP
  1492. \fIExamples\fR
  1493. .IX Subsection "Examples"
  1494. .IP "\(bu" 4
  1495. To remux the content of file \fIin.mkv\fR to a list of segments
  1496. \&\fIout\-000.nut\fR, \fIout\-001.nut\fR, etc., and write the list of
  1497. generated segments to \fIout.list\fR:
  1498. .Sp
  1499. .Vb 1
  1500. \&        ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.list out%03d.nut
  1501. .Ve
  1502. .IP "\(bu" 4
  1503. As the example above, but segment the input file according to the split
  1504. points specified by the \fIsegment_times\fR option:
  1505. .Sp
  1506. .Vb 1
  1507. \&        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
  1508. .Ve
  1509. .IP "\(bu" 4
  1510. As the example above, but use the \fBffmpeg\fR \fBforce_key_frames\fR
  1511. option to force key frames in the input at the specified location, together
  1512. with the segment option \fBsegment_time_delta\fR to account for
  1513. possible roundings operated when setting key frame times.
  1514. .Sp
  1515. .Vb 2
  1516. \&        ffmpeg -i in.mkv -force_key_frames 1,2,3,5,8,13,21 -codec:v mpeg4 -codec:a pcm_s16le -map 0 \e
  1517. \&        -f segment -segment_list out.csv -segment_times 1,2,3,5,8,13,21 -segment_time_delta 0.05 out%03d.nut
  1518. .Ve
  1519. .Sp
  1520. In order to force key frames on the input file, transcoding is
  1521. required.
  1522. .IP "\(bu" 4
  1523. Segment the input file by splitting the input file according to the
  1524. frame numbers sequence specified with the \fBsegment_frames\fR option:
  1525. .Sp
  1526. .Vb 1
  1527. \&        ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.csv -segment_frames 100,200,300,500,800 out%03d.nut
  1528. .Ve
  1529. .IP "\(bu" 4
  1530. To convert the \fIin.mkv\fR to \s-1TS\s0 segments using the \f(CW\*(C`libx264\*(C'\fR
  1531. and \f(CW\*(C`libfaac\*(C'\fR encoders:
  1532. .Sp
  1533. .Vb 1
  1534. \&        ffmpeg -i in.mkv -map 0 -codec:v libx264 -codec:a libfaac -f ssegment -segment_list out.list out%03d.ts
  1535. .Ve
  1536. .IP "\(bu" 4
  1537. Segment the input file, and create an M3U8 live playlist (can be used
  1538. as live \s-1HLS\s0 source):
  1539. .Sp
  1540. .Vb 2
  1541. \&        ffmpeg -re -i in.mkv -codec copy -map 0 -f segment -segment_list playlist.m3u8 \e
  1542. \&        -segment_list_flags +live -segment_time 10 out%03d.mkv
  1543. .Ve
  1544. .Sh "tee"
  1545. .IX Subsection "tee"
  1546. The tee muxer can be used to write the same data to several files or any
  1547. other kind of muxer. It can be used, for example, to both stream a video to
  1548. the network and save it to disk at the same time.
  1549. .PP
  1550. It is different from specifying several outputs to the \fBffmpeg\fR
  1551. command-line tool because the audio and video data will be encoded only once
  1552. with the tee muxer; encoding can be a very expensive process. It is not
  1553. useful when using the libavformat \s-1API\s0 directly because it is then possible
  1554. to feed the same packets to several muxers directly.
  1555. .PP
  1556. The slave outputs are specified in the file name given to the muxer,
  1557. separated by '|'. If any of the slave name contains the '|' separator,
  1558. leading or trailing spaces or any special character, it must be
  1559. escaped (see the ``Quoting and escaping'' section in the ffmpeg-utils
  1560. manual).
  1561. .PP
  1562. Muxer options can be specified for each slave by prepending them as a list of
  1563. \&\fIkey\fR=\fIvalue\fR pairs separated by ':', between square brackets. If
  1564. the options values contain a special character or the ':' separator, they
  1565. must be escaped; note that this is a second level escaping.
  1566. .PP
  1567. The following special options are also recognized:
  1568. .IP "\fBf\fR" 4
  1569. .IX Item "f"
  1570. Specify the format name. Useful if it cannot be guessed from the
  1571. output name suffix.
  1572. .IP "\fBbsfs[/\fR\fIspec\fR\fB]\fR" 4
  1573. .IX Item "bsfs[/spec]"
  1574. Specify a list of bitstream filters to apply to the specified
  1575. output. It is possible to specify to which streams a given bitstream
  1576. filter applies, by appending a stream specifier to the option
  1577. separated by \f(CW\*(C`/\*(C'\fR. If the stream specifier is not specified, the
  1578. bistream filters will be applied to all streams in the output.
  1579. .Sp
  1580. Several bitstream filters can be specified, separated by \*(L",\*(R".
  1581. .IP "\fBselect\fR" 4
  1582. .IX Item "select"
  1583. Select the streams that should be mapped to the slave output,
  1584. specified by a stream specifier. If not specified, this defaults to
  1585. all the input streams.
  1586. .PP
  1587. Some examples follow.
  1588. .IP "\(bu" 4
  1589. Encode something and both archive it in a WebM file and stream it
  1590. as MPEG-TS over \s-1UDP\s0 (the streams need to be explicitly mapped):
  1591. .Sp
  1592. .Vb 2
  1593. \&        ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
  1594. \&          "archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/"
  1595. .Ve
  1596. .IP "\(bu" 4
  1597. Use \fBffmpeg\fR to encode the input, and send the output
  1598. to three different destinations. The \f(CW\*(C`dump_extra\*(C'\fR bitstream
  1599. filter is used to add extradata information to all the output video
  1600. keyframes packets, as requested by the MPEG-TS format. The select
  1601. option is applied to \fIout.aac\fR in order to make it contain only
  1602. audio packets.
  1603. .Sp
  1604. .Vb 2
  1605. \&        ffmpeg -i ... -map 0 -flags +global_header -c:v libx264 -c:a aac -strict experimental
  1606. \&               -f tee "[bsfs/v=dump_extra]out.ts|[movflags=+faststart]out.mp4|[select=a]out.aac"
  1607. .Ve
  1608. .PP
  1609. Note: some codecs may need different options depending on the output format;
  1610. the auto-detection of this can not work with the tee muxer. The main example
  1611. is the \fBglobal_header\fR flag.
  1612. .SH "METADATA"
  1613. .IX Header "METADATA"
  1614. FFmpeg is able to dump metadata from media files into a simple UTF\-8\-encoded
  1615. INI-like text file and then load it back using the metadata muxer/demuxer.
  1616. .PP
  1617. The file format is as follows:
  1618. .IP "1." 4
  1619. A file consists of a header and a number of metadata tags divided into sections,
  1620. each on its own line.
  1621. .IP "2." 4
  1622. The header is a ';FFMETADATA' string, followed by a version number (now 1).
  1623. .IP "3." 4
  1624. Metadata tags are of the form 'key=value'
  1625. .IP "4." 4
  1626. Immediately after header follows global metadata
  1627. .IP "5." 4
  1628. After global metadata there may be sections with per\-stream/per\-chapter
  1629. metadata.
  1630. .IP "6." 4
  1631. A section starts with the section name in uppercase (i.e. \s-1STREAM\s0 or \s-1CHAPTER\s0) in
  1632. brackets ('[', ']') and ends with next section or end of file.
  1633. .IP "7." 4
  1634. At the beginning of a chapter section there may be an optional timebase to be
  1635. used for start/end values. It must be in form 'TIMEBASE=num/den', where num and
  1636. den are integers. If the timebase is missing then start/end times are assumed to
  1637. be in milliseconds.
  1638. Next a chapter section must contain chapter start and end times in form
  1639. \&'START=num', 'END=num', where num is a positive integer.
  1640. .IP "8." 4
  1641. Empty lines and lines starting with ';' or '#' are ignored.
  1642. .IP "9." 4
  1643. Metadata keys or values containing special characters ('=', ';', '#', '\e' and a
  1644. newline) must be escaped with a backslash '\e'.
  1645. .IP "10." 4
  1646. .IX Item "10."
  1647. Note that whitespace in metadata (e.g. foo = bar) is considered to be a part of
  1648. the tag (in the example above key is 'foo ', value is ' bar').
  1649. .PP
  1650. A ffmetadata file might look like this:
  1651. .PP
  1652. .Vb 4
  1653. \&        ;FFMETADATA1
  1654. \&        title=bike\e\eshed
  1655. \&        ;this is a comment
  1656. \&        artist=FFmpeg troll team
  1657. .Ve
  1658. .PP
  1659. .Vb 9
  1660. \&        [CHAPTER]
  1661. \&        TIMEBASE=1/1000
  1662. \&        START=0
  1663. \&        #chapter ends at 0:01:00
  1664. \&        END=60000
  1665. \&        title=chapter \e#1
  1666. \&        [STREAM]
  1667. \&        title=multi\e
  1668. \&        line
  1669. .Ve
  1670. .PP
  1671. By using the ffmetadata muxer and demuxer it is possible to extract
  1672. metadata from an input file to an ffmetadata file, and then transcode
  1673. the file into an output file with the edited ffmetadata file.
  1674. .PP
  1675. Extracting an ffmetadata file with \fIffmpeg\fR goes as follows:
  1676. .PP
  1677. .Vb 1
  1678. \&        ffmpeg -i INPUT -f ffmetadata FFMETADATAFILE
  1679. .Ve
  1680. .PP
  1681. Reinserting edited metadata information from the \s-1FFMETADATAFILE\s0 file can
  1682. be done as:
  1683. .PP
  1684. .Vb 1
  1685. \&        ffmpeg -i INPUT -i FFMETADATAFILE -map_metadata 1 -codec copy OUTPUT
  1686. .Ve
  1687. .SH "SEE ALSO"
  1688. .IX Header "SEE ALSO"
  1689. \&\fIffmpeg\fR\|(1), \fIffplay\fR\|(1), \fIffprobe\fR\|(1), \fIffserver\fR\|(1), \fIlibavformat\fR\|(3)
  1690. .SH "AUTHORS"
  1691. .IX Header "AUTHORS"
  1692. The FFmpeg developers.
  1693. .PP
  1694. For details about the authorship, see the Git history of the project
  1695. (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
  1696. \&\fBgit log\fR in the FFmpeg source directory, or browsing the
  1697. online repository at <\fBhttp://source.ffmpeg.org\fR>.
  1698. .PP
  1699. Maintainers for the specific components are listed in the file
  1700. \&\fI\s-1MAINTAINERS\s0\fR in the source code tree.
  1701.