Subversion Repositories Kolibri OS

Rev

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 " " " " " "
  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 enable detecting 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 "\fBfastseek\fR" 4
  181. .IX Item "fastseek"
  182. Enable fast, but inaccurate seeks for some formats.
  183. .IP "\fBgenpts\fR" 4
  184. .IX Item "genpts"
  185. Generate \s-1PTS\s0.
  186. .IP "\fBnofillin\fR" 4
  187. .IX Item "nofillin"
  188. Do not fill in missing values that can be exactly calculated.
  189. .IP "\fBnoparse\fR" 4
  190. .IX Item "noparse"
  191. Disable AVParsers, this needs \f(CW\*(C`+nofillin\*(C'\fR too.
  192. .IP "\fBigndts\fR" 4
  193. .IX Item "igndts"
  194. Ignore \s-1DTS\s0.
  195. .IP "\fBdiscardcorrupt\fR" 4
  196. .IX Item "discardcorrupt"
  197. Discard corrupted frames.
  198. .IP "\fBsortdts\fR" 4
  199. .IX Item "sortdts"
  200. Try to interleave output packets by \s-1DTS\s0.
  201. .IP "\fBkeepside\fR" 4
  202. .IX Item "keepside"
  203. Do not merge side data.
  204. .IP "\fBlatm\fR" 4
  205. .IX Item "latm"
  206. Enable \s-1RTP\s0 \s-1MP4A\-LATM\s0 payload.
  207. .IP "\fBnobuffer\fR" 4
  208. .IX Item "nobuffer"
  209. Reduce the latency introduced by optional buffering
  210. .IP "\fBbitexact\fR" 4
  211. .IX Item "bitexact"
  212. Only write platform\-, build\- and time-independent data.
  213. This ensures that file and data checksums are reproducible and match between
  214. platforms. Its primary use is for regression testing.
  215. .RE
  216. .RS 4
  217. .RE
  218. .IP "\fBseek2any\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4
  219. .IX Item "seek2any integer (input)"
  220. Allow seeking to non-keyframes on demuxer level when supported if set to 1.
  221. Default is 0.
  222. .IP "\fBanalyzeduration\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4
  223. .IX Item "analyzeduration integer (input)"
  224. Specify how many microseconds are analyzed to probe the input. A
  225. higher value will enable detecting more accurate information, but will
  226. increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
  227. .IP "\fBcryptokey\fR \fIhexadecimal string\fR \fB(\fR\fIinput\fR\fB)\fR" 4
  228. .IX Item "cryptokey hexadecimal string (input)"
  229. Set decryption key.
  230. .IP "\fBindexmem\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4
  231. .IX Item "indexmem integer (input)"
  232. Set max memory used for timestamp index (per stream).
  233. .IP "\fBrtbufsize\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4
  234. .IX Item "rtbufsize integer (input)"
  235. Set max memory used for buffering real-time frames.
  236. .IP "\fBfdebug\fR \fIflags\fR \fB(\fR\fIinput/output\fR\fB)\fR" 4
  237. .IX Item "fdebug flags (input/output)"
  238. Print specific debug info.
  239. .Sp
  240. Possible values:
  241. .RS 4
  242. .IP "\fBts\fR" 4
  243. .IX Item "ts"
  244. .RE
  245. .RS 4
  246. .RE
  247. .PD 0
  248. .IP "\fBmax_delay\fR \fIinteger\fR \fB(\fR\fIinput/output\fR\fB)\fR" 4
  249. .IX Item "max_delay integer (input/output)"
  250. .PD
  251. Set maximum muxing or demuxing delay in microseconds.
  252. .IP "\fBfpsprobesize\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4
  253. .IX Item "fpsprobesize integer (input)"
  254. Set number of frames used to probe fps.
  255. .IP "\fBaudio_preload\fR \fIinteger\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
  256. .IX Item "audio_preload integer (output)"
  257. Set microseconds by which audio packets should be interleaved earlier.
  258. .IP "\fBchunk_duration\fR \fIinteger\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
  259. .IX Item "chunk_duration integer (output)"
  260. Set microseconds for each chunk.
  261. .IP "\fBchunk_size\fR \fIinteger\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
  262. .IX Item "chunk_size integer (output)"
  263. Set size in bytes for each chunk.
  264. .IP "\fBerr_detect, f_err_detect\fR \fIflags\fR \fB(\fR\fIinput\fR\fB)\fR" 4
  265. .IX Item "err_detect, f_err_detect flags (input)"
  266. Set error detection flags. \f(CW\*(C`f_err_detect\*(C'\fR is deprecated and
  267. should be used only via the \fBffmpeg\fR tool.
  268. .Sp
  269. Possible values:
  270. .RS 4
  271. .IP "\fBcrccheck\fR" 4
  272. .IX Item "crccheck"
  273. Verify embedded CRCs.
  274. .IP "\fBbitstream\fR" 4
  275. .IX Item "bitstream"
  276. Detect bitstream specification deviations.
  277. .IP "\fBbuffer\fR" 4
  278. .IX Item "buffer"
  279. Detect improper bitstream length.
  280. .IP "\fBexplode\fR" 4
  281. .IX Item "explode"
  282. Abort decoding on minor error detection.
  283. .IP "\fBcareful\fR" 4
  284. .IX Item "careful"
  285. Consider things that violate the spec and have not been seen in the
  286. wild as errors.
  287. .IP "\fBcompliant\fR" 4
  288. .IX Item "compliant"
  289. Consider all spec non compliancies as errors.
  290. .IP "\fBaggressive\fR" 4
  291. .IX Item "aggressive"
  292. Consider things that a sane encoder should not do as an error.
  293. .RE
  294. .RS 4
  295. .RE
  296. .IP "\fBmax_interleave_delta\fR \fIinteger\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
  297. .IX Item "max_interleave_delta integer (output)"
  298. Set maximum buffering duration for interleaving. The duration is
  299. expressed in microseconds, and defaults to 1000000 (1 second).
  300. .Sp
  301. To ensure all the streams are interleaved correctly, libavformat will
  302. wait until it has at least one packet for each stream before actually
  303. writing any packets to the output file. When some streams are
  304. \&\*(L"sparse\*(R" (i.e. there are large gaps between successive packets), this
  305. can result in excessive buffering.
  306. .Sp
  307. This field specifies the maximum difference between the timestamps of the
  308. first and the last packet in the muxing queue, above which libavformat
  309. will output a packet regardless of whether it has queued a packet for all
  310. the streams.
  311. .Sp
  312. If set to 0, libavformat will continue buffering packets until it has
  313. a packet for each stream, regardless of the maximum timestamp
  314. difference between the buffered packets.
  315. .IP "\fBuse_wallclock_as_timestamps\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4
  316. .IX Item "use_wallclock_as_timestamps integer (input)"
  317. Use wallclock as timestamps.
  318. .IP "\fBavoid_negative_ts\fR \fIinteger\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
  319. .IX Item "avoid_negative_ts integer (output)"
  320. Possible values:
  321. .RS 4
  322. .IP "\fBmake_non_negative\fR" 4
  323. .IX Item "make_non_negative"
  324. Shift timestamps to make them non\-negative.
  325. Also note that this affects only leading negative timestamps, and not
  326. non-monotonic negative timestamps.
  327. .IP "\fBmake_zero\fR" 4
  328. .IX Item "make_zero"
  329. Shift timestamps so that the first timestamp is 0.
  330. .IP "\fBauto (default)\fR" 4
  331. .IX Item "auto (default)"
  332. Enables shifting when required by the target format.
  333. .IP "\fBdisabled\fR" 4
  334. .IX Item "disabled"
  335. Disables shifting of timestamp.
  336. .RE
  337. .RS 4
  338. .Sp
  339. When shifting is enabled, all output timestamps are shifted by the
  340. same amount. Audio, video, and subtitles desynching and relative
  341. timestamp differences are preserved compared to how they would have
  342. been without shifting.
  343. .RE
  344. .IP "\fBskip_initial_bytes\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4
  345. .IX Item "skip_initial_bytes integer (input)"
  346. Set number of bytes to skip before reading header and frames if set to 1.
  347. Default is 0.
  348. .IP "\fBcorrect_ts_overflow\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4
  349. .IX Item "correct_ts_overflow integer (input)"
  350. Correct single timestamp overflows if set to 1. Default is 1.
  351. .IP "\fBflush_packets\fR \fIinteger\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
  352. .IX Item "flush_packets integer (output)"
  353. Flush the underlying I/O stream after each packet. Default 1 enables it, and
  354. has the effect of reducing the latency; 0 disables it and may slightly
  355. increase performance in some cases.
  356. .IP "\fBoutput_ts_offset\fR \fIoffset\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
  357. .IX Item "output_ts_offset offset (output)"
  358. Set the output time offset.
  359. .Sp
  360. \&\fIoffset\fR must be a time duration specification,
  361. see \fBthe Time duration section in the \f(BIffmpeg\-utils\fB\|(1) manual\fR.
  362. .Sp
  363. The offset is added by the muxer to the output timestamps.
  364. .Sp
  365. Specifying a positive offset means that the corresponding streams are
  366. delayed bt the time duration specified in \fIoffset\fR. Default value
  367. is \f(CW0\fR (meaning that no offset is applied).
  368. .IP "\fBformat_whitelist\fR \fIlist\fR \fB(\fR\fIinput\fR\fB)\fR" 4
  369. .IX Item "format_whitelist list (input)"
  370. \&\*(L",\*(R" separated List of allowed demuxers. By default all are allowed.
  371. .IP "\fBdump_separator\fR \fIstring\fR \fB(\fR\fIinput\fR\fB)\fR" 4
  372. .IX Item "dump_separator string (input)"
  373. Separator used to separate the fields printed on the command line about the
  374. Stream parameters.
  375. For example to separate the fields with newlines and indention:
  376. .Sp
  377. .Vb 2
  378. \&        ffprobe -dump_separator "
  379. \&                                  "  -i ~/videos/matrixbench_mpeg2.mpg
  380. .Ve
  381. .Sh "Format stream specifiers"
  382. .IX Subsection "Format stream specifiers"
  383. Format stream specifiers allow selection of one or more streams that
  384. match specific properties.
  385. .PP
  386. Possible forms of stream specifiers are:
  387. .IP "\fIstream_index\fR" 4
  388. .IX Item "stream_index"
  389. Matches the stream with this index.
  390. .IP "\fIstream_type\fR\fB[:\fR\fIstream_index\fR\fB]\fR" 4
  391. .IX Item "stream_type[:stream_index]"
  392. \&\fIstream_type\fR is one of following: 'v' for video, 'a' for audio,
  393. \&'s' for subtitle, 'd' for data, and 't' for attachments. If
  394. \&\fIstream_index\fR is given, then it matches the stream number
  395. \&\fIstream_index\fR of this type. Otherwise, it matches all streams of
  396. this type.
  397. .IP "\fBp:\fR\fIprogram_id\fR\fB[:\fR\fIstream_index\fR\fB]\fR" 4
  398. .IX Item "p:program_id[:stream_index]"
  399. If \fIstream_index\fR is given, then it matches the stream with number
  400. \&\fIstream_index\fR in the program with the id
  401. \&\fIprogram_id\fR. Otherwise, it matches all streams in the program.
  402. .IP "\fB#\fR\fIstream_id\fR" 4
  403. .IX Item "#stream_id"
  404. Matches the stream by a format-specific \s-1ID\s0.
  405. .PP
  406. The exact semantics of stream specifiers is defined by the
  407. \&\f(CW\*(C`avformat_match_stream_specifier()\*(C'\fR function declared in the
  408. \&\fIlibavformat/avformat.h\fR header.
  409. .SH "DEMUXERS"
  410. .IX Header "DEMUXERS"
  411. Demuxers are configured elements in FFmpeg that can read the
  412. multimedia streams from a particular type of file.
  413. .PP
  414. When you configure your FFmpeg build, all the supported demuxers
  415. are enabled by default. You can list all available ones using the
  416. configure option \f(CW\*(C`\-\-list\-demuxers\*(C'\fR.
  417. .PP
  418. You can disable all the demuxers using the configure option
  419. \&\f(CW\*(C`\-\-disable\-demuxers\*(C'\fR, and selectively enable a single demuxer with
  420. the option \f(CW\*(C`\-\-enable\-demuxer=\f(CI\s-1DEMUXER\s0\f(CW\*(C'\fR, or disable it
  421. with the option \f(CW\*(C`\-\-disable\-demuxer=\f(CI\s-1DEMUXER\s0\f(CW\*(C'\fR.
  422. .PP
  423. The option \f(CW\*(C`\-formats\*(C'\fR of the ff* tools will display the list of
  424. enabled demuxers.
  425. .PP
  426. The description of some of the currently available demuxers follows.
  427. .Sh "aa"
  428. .IX Subsection "aa"
  429. Audible Format 2, 3, and 4 demuxer.
  430. .PP
  431. This demuxer is used to demux Audible Format 2, 3, and 4 (.aa) files.
  432. .Sh "applehttp"
  433. .IX Subsection "applehttp"
  434. Apple \s-1HTTP\s0 Live Streaming demuxer.
  435. .PP
  436. This demuxer presents all AVStreams from all variant streams.
  437. The id field is set to the bitrate variant index number. By setting
  438. the discard flags on AVStreams (by pressing 'a' or 'v' in ffplay),
  439. the caller can decide which variant streams to actually receive.
  440. The total bitrate of the variant that the stream belongs to is
  441. available in a metadata key named \*(L"variant_bitrate\*(R".
  442. .Sh "apng"
  443. .IX Subsection "apng"
  444. Animated Portable Network Graphics demuxer.
  445. .PP
  446. This demuxer is used to demux \s-1APNG\s0 files.
  447. All headers, but the \s-1PNG\s0 signature, up to (but not including) the first
  448. fcTL chunk are transmitted as extradata.
  449. Frames are then split as being all the chunks between two fcTL ones, or
  450. between the last fcTL and \s-1IEND\s0 chunks.
  451. .IP "\fB\-ignore_loop\fR \fIbool\fR" 4
  452. .IX Item "-ignore_loop bool"
  453. Ignore the loop variable in the file if set.
  454. .IP "\fB\-max_fps\fR \fIint\fR" 4
  455. .IX Item "-max_fps int"
  456. Maximum framerate in frames per second (0 for no limit).
  457. .IP "\fB\-default_fps\fR \fIint\fR" 4
  458. .IX Item "-default_fps int"
  459. Default framerate in frames per second when none is specified in the file
  460. (0 meaning as fast as possible).
  461. .Sh "asf"
  462. .IX Subsection "asf"
  463. Advanced Systems Format demuxer.
  464. .PP
  465. This demuxer is used to demux \s-1ASF\s0 files and \s-1MMS\s0 network streams.
  466. .IP "\fB\-no_resync_search\fR \fIbool\fR" 4
  467. .IX Item "-no_resync_search bool"
  468. Do not try to resynchronize by looking for a certain optional start code.
  469. .Sh "concat"
  470. .IX Subsection "concat"
  471. Virtual concatenation script demuxer.
  472. .PP
  473. This demuxer reads a list of files and other directives from a text file and
  474. demuxes them one after the other, as if all their packet had been muxed
  475. together.
  476. .PP
  477. The timestamps in the files are adjusted so that the first file starts at 0
  478. and each next file starts where the previous one finishes. Note that it is
  479. done globally and may cause gaps if all streams do not have exactly the same
  480. length.
  481. .PP
  482. All files must have the same streams (same codecs, same time base, etc.).
  483. .PP
  484. The duration of each file is used to adjust the timestamps of the next file:
  485. if the duration is incorrect (because it was computed using the bit-rate or
  486. because the file is truncated, for example), it can cause artifacts. The
  487. \&\f(CW\*(C`duration\*(C'\fR directive can be used to override the duration stored in
  488. each file.
  489. .PP
  490. \fISyntax\fR
  491. .IX Subsection "Syntax"
  492. .PP
  493. The script is a text file in extended\-ASCII, with one directive per line.
  494. Empty lines, leading spaces and lines starting with '#' are ignored. The
  495. following directive is recognized:
  496. .ie n .IP "\fB\fB""file \f(BIpath\f(CB""\fB\fR" 4
  497. .el .IP "\fB\f(CBfile \f(CBpath\f(CB\fB\fR" 4
  498. .IX Item "file path"
  499. Path to a file to read; special characters and spaces must be escaped with
  500. backslash or single quotes.
  501. .Sp
  502. All subsequent file-related directives apply to that file.
  503. .ie n .IP "\fB\fB""ffconcat version 1.0""\fB\fR" 4
  504. .el .IP "\fB\f(CBffconcat version 1.0\fB\fR" 4
  505. .IX Item "ffconcat version 1.0"
  506. Identify the script type and version. It also sets the \fBsafe\fR option
  507. to 1 if it was to its default \-1.
  508. .Sp
  509. To make FFmpeg recognize the format automatically, this directive must
  510. appears exactly as is (no extra space or byte\-order\-mark) on the very first
  511. line of the script.
  512. .ie n .IP "\fB\fB""duration \f(BIdur\f(CB""\fB\fR" 4
  513. .el .IP "\fB\f(CBduration \f(CBdur\f(CB\fB\fR" 4
  514. .IX Item "duration dur"
  515. Duration of the file. This information can be specified from the file;
  516. specifying it here may be more efficient or help if the information from the
  517. file is not available or accurate.
  518. .Sp
  519. If the duration is set for all files, then it is possible to seek in the
  520. whole concatenated video.
  521. .ie n .IP "\fB\fB""inpoint \f(BItimestamp\f(CB""\fB\fR" 4
  522. .el .IP "\fB\f(CBinpoint \f(CBtimestamp\f(CB\fB\fR" 4
  523. .IX Item "inpoint timestamp"
  524. In point of the file. When the demuxer opens the file it instantly seeks to the
  525. specified timestamp. Seeking is done so that all streams can be presented
  526. successfully at In point.
  527. .Sp
  528. This directive works best with intra frame codecs, because for non-intra frame
  529. ones you will usually get extra packets before the actual In point and the
  530. decoded content will most likely contain frames before In point too.
  531. .Sp
  532. For each file, packets before the file In point will have timestamps less than
  533. the calculated start timestamp of the file (negative in case of the first
  534. file), and the duration of the files (if not specified by the \f(CW\*(C`duration\*(C'\fR
  535. directive) will be reduced based on their specified In point.
  536. .Sp
  537. Because of potential packets before the specified In point, packet timestamps
  538. may overlap between two concatenated files.
  539. .ie n .IP "\fB\fB""outpoint \f(BItimestamp\f(CB""\fB\fR" 4
  540. .el .IP "\fB\f(CBoutpoint \f(CBtimestamp\f(CB\fB\fR" 4
  541. .IX Item "outpoint timestamp"
  542. Out point of the file. When the demuxer reaches the specified decoding
  543. timestamp in any of the streams, it handles it as an end of file condition and
  544. skips the current and all the remaining packets from all streams.
  545. .Sp
  546. Out point is exclusive, which means that the demuxer will not output packets
  547. with a decoding timestamp greater or equal to Out point.
  548. .Sp
  549. This directive works best with intra frame codecs and formats where all streams
  550. are tightly interleaved. For non-intra frame codecs you will usually get
  551. additional packets with presentation timestamp after Out point therefore the
  552. decoded content will most likely contain frames after Out point too. If your
  553. streams are not tightly interleaved you may not get all the packets from all
  554. streams before Out point and you may only will be able to decode the earliest
  555. stream until Out point.
  556. .Sp
  557. The duration of the files (if not specified by the \f(CW\*(C`duration\*(C'\fR
  558. directive) will be reduced based on their specified Out point.
  559. .ie n .IP "\fB\fB""file_packet_metadata \f(BIkey=value\f(CB""\fB\fR" 4
  560. .el .IP "\fB\f(CBfile_packet_metadata \f(CBkey=value\f(CB\fB\fR" 4
  561. .IX Item "file_packet_metadata key=value"
  562. Metadata of the packets of the file. The specified metadata will be set for
  563. each file packet. You can specify this directive multiple times to add multiple
  564. metadata entries.
  565. .ie n .IP "\fB\fB""stream""\fB\fR" 4
  566. .el .IP "\fB\f(CBstream\fB\fR" 4
  567. .IX Item "stream"
  568. Introduce a stream in the virtual file.
  569. All subsequent stream-related directives apply to the last introduced
  570. stream.
  571. Some streams properties must be set in order to allow identifying the
  572. matching streams in the subfiles.
  573. If no streams are defined in the script, the streams from the first file are
  574. copied.
  575. .ie n .IP "\fB\fB""exact_stream_id \f(BIid\f(CB""\fB\fR" 4
  576. .el .IP "\fB\f(CBexact_stream_id \f(CBid\f(CB\fB\fR" 4
  577. .IX Item "exact_stream_id id"
  578. Set the id of the stream.
  579. If this directive is given, the string with the corresponding id in the
  580. subfiles will be used.
  581. This is especially useful for MPEG-PS (\s-1VOB\s0) files, where the order of the
  582. streams is not reliable.
  583. .PP
  584. \fIOptions\fR
  585. .IX Subsection "Options"
  586. .PP
  587. This demuxer accepts the following option:
  588. .IP "\fBsafe\fR" 4
  589. .IX Item "safe"
  590. If set to 1, reject unsafe file paths. A file path is considered safe if it
  591. does not contain a protocol specification and is relative and all components
  592. only contain characters from the portable character set (letters, digits,
  593. period, underscore and hyphen) and have no period at the beginning of a
  594. component.
  595. .Sp
  596. If set to 0, any file name is accepted.
  597. .Sp
  598. The default is \-1, it is equivalent to 1 if the format was automatically
  599. probed and 0 otherwise.
  600. .IP "\fBauto_convert\fR" 4
  601. .IX Item "auto_convert"
  602. If set to 1, try to perform automatic conversions on packet data to make the
  603. streams concatenable.
  604. The default is 1.
  605. .Sp
  606. Currently, the only conversion is adding the h264_mp4toannexb bitstream
  607. filter to H.264 streams in \s-1MP4\s0 format. This is necessary in particular if
  608. there are resolution changes.
  609. .Sh "flv"
  610. .IX Subsection "flv"
  611. Adobe Flash Video Format demuxer.
  612. .PP
  613. This demuxer is used to demux \s-1FLV\s0 files and \s-1RTMP\s0 network streams.
  614. .IP "\fB\-flv_metadata\fR \fIbool\fR" 4
  615. .IX Item "-flv_metadata bool"
  616. Allocate the streams according to the onMetaData array content.
  617. .Sh "libgme"
  618. .IX Subsection "libgme"
  619. The Game Music Emu library is a collection of video game music file emulators.
  620. .PP
  621. See <\fBhttp://code.google.com/p/game\-music\-emu/\fR> for more information.
  622. .PP
  623. Some files have multiple tracks. The demuxer will pick the first track by
  624. default. The \fBtrack_index\fR option can be used to select a different
  625. track. Track indexes start at 0. The demuxer exports the number of tracks as
  626. \&\fItracks\fR meta data entry.
  627. .PP
  628. For very large files, the \fBmax_size\fR option may have to be adjusted.
  629. .Sh "libquvi"
  630. .IX Subsection "libquvi"
  631. Play media from Internet services using the quvi project.
  632. .PP
  633. The demuxer accepts a \fBformat\fR option to request a specific quality. It
  634. is by default set to \fIbest\fR.
  635. .PP
  636. See <\fBhttp://quvi.sourceforge.net/\fR> for more information.
  637. .PP
  638. FFmpeg needs to be built with \f(CW\*(C`\-\-enable\-libquvi\*(C'\fR for this demuxer to be
  639. enabled.
  640. .Sh "gif"
  641. .IX Subsection "gif"
  642. Animated \s-1GIF\s0 demuxer.
  643. .PP
  644. It accepts the following options:
  645. .IP "\fBmin_delay\fR" 4
  646. .IX Item "min_delay"
  647. Set the minimum valid delay between frames in hundredths of seconds.
  648. Range is 0 to 6000. Default value is 2.
  649. .IP "\fBmax_gif_delay\fR" 4
  650. .IX Item "max_gif_delay"
  651. Set the maximum valid delay between frames in hundredth of seconds.
  652. Range is 0 to 65535. Default value is 65535 (nearly eleven minutes),
  653. the maximum value allowed by the specification.
  654. .IP "\fBdefault_delay\fR" 4
  655. .IX Item "default_delay"
  656. Set the default delay between frames in hundredths of seconds.
  657. Range is 0 to 6000. Default value is 10.
  658. .IP "\fBignore_loop\fR" 4
  659. .IX Item "ignore_loop"
  660. \&\s-1GIF\s0 files can contain information to loop a certain number of times (or
  661. infinitely). If \fBignore_loop\fR is set to 1, then the loop setting
  662. from the input will be ignored and looping will not occur. If set to 0,
  663. then looping will occur and will cycle the number of times according to
  664. the \s-1GIF\s0. Default value is 1.
  665. .PP
  666. For example, with the overlay filter, place an infinitely looping \s-1GIF\s0
  667. over another video:
  668. .PP
  669. .Vb 1
  670. \&        ffmpeg -i input.mp4 -ignore_loop 0 -i input.gif -filter_complex overlay=shortest=1 out.mkv
  671. .Ve
  672. .PP
  673. Note that in the above example the shortest option for overlay filter is
  674. used to end the output video at the length of the shortest input file,
  675. which in this case is \fIinput.mp4\fR as the \s-1GIF\s0 in this example loops
  676. infinitely.
  677. .Sh "image2"
  678. .IX Subsection "image2"
  679. Image file demuxer.
  680. .PP
  681. This demuxer reads from a list of image files specified by a pattern.
  682. The syntax and meaning of the pattern is specified by the
  683. option \fIpattern_type\fR.
  684. .PP
  685. The pattern may contain a suffix which is used to automatically
  686. determine the format of the images contained in the files.
  687. .PP
  688. The size, the pixel format, and the format of each image must be the
  689. same for all the files in the sequence.
  690. .PP
  691. This demuxer accepts the following options:
  692. .IP "\fBframerate\fR" 4
  693. .IX Item "framerate"
  694. Set the frame rate for the video stream. It defaults to 25.
  695. .IP "\fBloop\fR" 4
  696. .IX Item "loop"
  697. If set to 1, loop over the input. Default value is 0.
  698. .IP "\fBpattern_type\fR" 4
  699. .IX Item "pattern_type"
  700. Select the pattern type used to interpret the provided filename.
  701. .Sp
  702. \&\fIpattern_type\fR accepts one of the following values.
  703. .RS 4
  704. .IP "\fBnone\fR" 4
  705. .IX Item "none"
  706. Disable pattern matching, therefore the video will only contain the specified
  707. image. You should use this option if you do not want to create sequences from
  708. multiple images and your filenames may contain special pattern characters.
  709. .IP "\fBsequence\fR" 4
  710. .IX Item "sequence"
  711. Select a sequence pattern type, used to specify a sequence of files
  712. indexed by sequential numbers.
  713. .Sp
  714. A sequence pattern may contain the string \*(L"%d\*(R" or "%0\fIN\fRd\*(L", which
  715. specifies the position of the characters representing a sequential
  716. number in each filename matched by the pattern. If the form
  717. \&\*(R"%d0\fIN\fRd" is used, the string representing the number in each
  718. filename is 0\-padded and \fIN\fR is the total number of 0\-padded
  719. digits representing the number. The literal character '%' can be
  720. specified in the pattern with the string \*(L"%%\*(R".
  721. .Sp
  722. If the sequence pattern contains \*(L"%d\*(R" or "%0\fIN\fRd", the first filename of
  723. the file list specified by the pattern must contain a number
  724. inclusively contained between \fIstart_number\fR and
  725. \&\fIstart_number\fR+\fIstart_number_range\fR\-1, and all the following
  726. numbers must be sequential.
  727. .Sp
  728. For example the pattern \*(L"img\-%03d.bmp\*(R" will match a sequence of
  729. filenames of the form \fIimg\-001.bmp\fR, \fIimg\-002.bmp\fR, ...,
  730. \&\fIimg\-010.bmp\fR, etc.; the pattern \*(L"i%%m%%g\-%d.jpg\*(R" will match a
  731. sequence of filenames of the form \fIi%m%g\-1.jpg\fR,
  732. \&\fIi%m%g\-2.jpg\fR, ..., \fIi%m%g\-10.jpg\fR, etc.
  733. .Sp
  734. Note that the pattern must not necessarily contain \*(L"%d\*(R" or
  735. "%0\fIN\fRd", for example to convert a single image file
  736. \&\fIimg.jpeg\fR you can employ the command:
  737. .Sp
  738. .Vb 1
  739. \&        ffmpeg -i img.jpeg img.png
  740. .Ve
  741. .IP "\fBglob\fR" 4
  742. .IX Item "glob"
  743. Select a glob wildcard pattern type.
  744. .Sp
  745. The pattern is interpreted like a \f(CW\*(C`glob()\*(C'\fR pattern. This is only
  746. selectable if libavformat was compiled with globbing support.
  747. .IP "\fBglob_sequence\fR \fI(deprecated, will be removed)\fR" 4
  748. .IX Item "glob_sequence (deprecated, will be removed)"
  749. Select a mixed glob wildcard/sequence pattern.
  750. .Sp
  751. If your version of libavformat was compiled with globbing support, and
  752. the provided pattern contains at least one glob meta character among
  753. \&\f(CW\*(C`%*?[]{}\*(C'\fR that is preceded by an unescaped \*(L"%\*(R", the pattern is
  754. interpreted like a \f(CW\*(C`glob()\*(C'\fR pattern, otherwise it is interpreted
  755. like a sequence pattern.
  756. .Sp
  757. All glob special characters \f(CW\*(C`%*?[]{}\*(C'\fR must be prefixed
  758. with \*(L"%\*(R". To escape a literal \*(L"%\*(R" you shall use \*(L"%%\*(R".
  759. .Sp
  760. For example the pattern \f(CW\*(C`foo\-%*.jpeg\*(C'\fR will match all the
  761. filenames prefixed by \*(L"foo\-\*(R" and terminating with \*(L".jpeg\*(R", and
  762. \&\f(CW\*(C`foo\-%?%?%?.jpeg\*(C'\fR will match all the filenames prefixed with
  763. \&\*(L"foo\-\*(R", followed by a sequence of three characters, and terminating
  764. with \*(L".jpeg\*(R".
  765. .Sp
  766. This pattern type is deprecated in favor of \fIglob\fR and
  767. \&\fIsequence\fR.
  768. .RE
  769. .RS 4
  770. .Sp
  771. Default value is \fIglob_sequence\fR.
  772. .RE
  773. .IP "\fBpixel_format\fR" 4
  774. .IX Item "pixel_format"
  775. Set the pixel format of the images to read. If not specified the pixel
  776. format is guessed from the first image file in the sequence.
  777. .IP "\fBstart_number\fR" 4
  778. .IX Item "start_number"
  779. Set the index of the file matched by the image file pattern to start
  780. to read from. Default value is 0.
  781. .IP "\fBstart_number_range\fR" 4
  782. .IX Item "start_number_range"
  783. Set the index interval range to check when looking for the first image
  784. file in the sequence, starting from \fIstart_number\fR. Default value
  785. is 5.
  786. .IP "\fBts_from_file\fR" 4
  787. .IX Item "ts_from_file"
  788. If set to 1, will set frame timestamp to modification time of image file. Note
  789. that monotonity of timestamps is not provided: images go in the same order as
  790. without this option. Default value is 0.
  791. If set to 2, will set frame timestamp to the modification time of the image file in
  792. nanosecond precision.
  793. .IP "\fBvideo_size\fR" 4
  794. .IX Item "video_size"
  795. Set the video size of the images to read. If not specified the video
  796. size is guessed from the first image file in the sequence.
  797. .PP
  798. \fIExamples\fR
  799. .IX Subsection "Examples"
  800. .IP "\(bu" 4
  801. Use \fBffmpeg\fR for creating a video from the images in the file
  802. sequence \fIimg\-001.jpeg\fR, \fIimg\-002.jpeg\fR, ..., assuming an
  803. input frame rate of 10 frames per second:
  804. .Sp
  805. .Vb 1
  806. \&        ffmpeg -framerate 10 -i 'img-%03d.jpeg' out.mkv
  807. .Ve
  808. .IP "\(bu" 4
  809. As above, but start by reading from a file with index 100 in the sequence:
  810. .Sp
  811. .Vb 1
  812. \&        ffmpeg -framerate 10 -start_number 100 -i 'img-%03d.jpeg' out.mkv
  813. .Ve
  814. .IP "\(bu" 4
  815. Read images matching the \*(L"*.png\*(R" glob pattern , that is all the files
  816. terminating with the \*(L".png\*(R" suffix:
  817. .Sp
  818. .Vb 1
  819. \&        ffmpeg -framerate 10 -pattern_type glob -i "*.png" out.mkv
  820. .Ve
  821. .Sh "mpegts"
  822. .IX Subsection "mpegts"
  823. \&\s-1MPEG\-2\s0 transport stream demuxer.
  824. .PP
  825. This demuxer accepts the following options:
  826. .IP "\fBresync_size\fR" 4
  827. .IX Item "resync_size"
  828. Set size limit for looking up a new synchronization. Default value is
  829. 65536.
  830. .IP "\fBfix_teletext_pts\fR" 4
  831. .IX Item "fix_teletext_pts"
  832. Override teletext packet \s-1PTS\s0 and \s-1DTS\s0 values with the timestamps calculated
  833. from the \s-1PCR\s0 of the first program which the teletext stream is part of and is
  834. not discarded. Default value is 1, set this option to 0 if you want your
  835. teletext packet \s-1PTS\s0 and \s-1DTS\s0 values untouched.
  836. .IP "\fBts_packetsize\fR" 4
  837. .IX Item "ts_packetsize"
  838. Output option carrying the raw packet size in bytes.
  839. Show the detected raw packet size, cannot be set by the user.
  840. .IP "\fBscan_all_pmts\fR" 4
  841. .IX Item "scan_all_pmts"
  842. Scan and combine all PMTs. The value is an integer with value from \-1
  843. to 1 (\-1 means automatic setting, 1 means enabled, 0 means
  844. disabled). Default value is \-1.
  845. .Sh "rawvideo"
  846. .IX Subsection "rawvideo"
  847. Raw video demuxer.
  848. .PP
  849. This demuxer allows one to read raw video data. Since there is no header
  850. specifying the assumed video parameters, the user must specify them
  851. in order to be able to decode the data correctly.
  852. .PP
  853. This demuxer accepts the following options:
  854. .IP "\fBframerate\fR" 4
  855. .IX Item "framerate"
  856. Set input video frame rate. Default value is 25.
  857. .IP "\fBpixel_format\fR" 4
  858. .IX Item "pixel_format"
  859. Set the input video pixel format. Default value is \f(CW\*(C`yuv420p\*(C'\fR.
  860. .IP "\fBvideo_size\fR" 4
  861. .IX Item "video_size"
  862. Set the input video size. This value must be specified explicitly.
  863. .PP
  864. For example to read a rawvideo file \fIinput.raw\fR with
  865. \&\fBffplay\fR, assuming a pixel format of \f(CW\*(C`rgb24\*(C'\fR, a video
  866. size of \f(CW\*(C`320x240\*(C'\fR, and a frame rate of 10 images per second, use
  867. the command:
  868. .PP
  869. .Vb 1
  870. \&        ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
  871. .Ve
  872. .Sh "sbg"
  873. .IX Subsection "sbg"
  874. SBaGen script demuxer.
  875. .PP
  876. This demuxer reads the script language used by SBaGen
  877. <\fBhttp://uazu.net/sbagen/\fR> to generate binaural beats sessions. A \s-1SBG\s0
  878. script looks like that:
  879. .PP
  880. .Vb 9
  881. \&        -SE
  882. \&        a: 300-2.5/3 440+4.5/0
  883. \&        b: 300-2.5/0 440+4.5/3
  884. \&        off: -
  885. \&        NOW      == a
  886. \&        +0:07:00 == b
  887. \&        +0:14:00 == a
  888. \&        +0:21:00 == b
  889. \&        +0:30:00    off
  890. .Ve
  891. .PP
  892. A \s-1SBG\s0 script can mix absolute and relative timestamps. If the script uses
  893. either only absolute timestamps (including the script start time) or only
  894. relative ones, then its layout is fixed, and the conversion is
  895. straightforward. On the other hand, if the script mixes both kind of
  896. timestamps, then the \fI\s-1NOW\s0\fR reference for relative timestamps will be
  897. taken from the current time of day at the time the script is read, and the
  898. script layout will be frozen according to that reference. That means that if
  899. the script is directly played, the actual times will match the absolute
  900. timestamps up to the sound controller's clock accuracy, but if the user
  901. somehow pauses the playback or seeks, all times will be shifted accordingly.
  902. .Sh "tedcaptions"
  903. .IX Subsection "tedcaptions"
  904. \&\s-1JSON\s0 captions used for <\fBhttp://www.ted.com/\fR>.
  905. .PP
  906. \&\s-1TED\s0 does not provide links to the captions, but they can be guessed from the
  907. page. The file \fItools/bookmarklets.html\fR from the FFmpeg source tree
  908. contains a bookmarklet to expose them.
  909. .PP
  910. This demuxer accepts the following option:
  911. .IP "\fBstart_time\fR" 4
  912. .IX Item "start_time"
  913. Set the start time of the \s-1TED\s0 talk, in milliseconds. The default is 15000
  914. (15s). It is used to sync the captions with the downloadable videos, because
  915. they include a 15s intro.
  916. .PP
  917. Example: convert the captions to a format most players understand:
  918. .PP
  919. .Vb 1
  920. \&        ffmpeg -i http://www.ted.com/talks/subtitles/id/1/lang/en talk1-en.srt
  921. .Ve
  922. .SH "MUXERS"
  923. .IX Header "MUXERS"
  924. Muxers are configured elements in FFmpeg which allow writing
  925. multimedia streams to a particular type of file.
  926. .PP
  927. When you configure your FFmpeg build, all the supported muxers
  928. are enabled by default. You can list all available muxers using the
  929. configure option \f(CW\*(C`\-\-list\-muxers\*(C'\fR.
  930. .PP
  931. You can disable all the muxers with the configure option
  932. \&\f(CW\*(C`\-\-disable\-muxers\*(C'\fR and selectively enable / disable single muxers
  933. with the options \f(CW\*(C`\-\-enable\-muxer=\f(CI\s-1MUXER\s0\f(CW\*(C'\fR /
  934. \&\f(CW\*(C`\-\-disable\-muxer=\f(CI\s-1MUXER\s0\f(CW\*(C'\fR.
  935. .PP
  936. The option \f(CW\*(C`\-formats\*(C'\fR of the ff* tools will display the list of
  937. enabled muxers.
  938. .PP
  939. A description of some of the currently available muxers follows.
  940. .Sh "aiff"
  941. .IX Subsection "aiff"
  942. Audio Interchange File Format muxer.
  943. .PP
  944. \fIOptions\fR
  945. .IX Subsection "Options"
  946. .PP
  947. It accepts the following options:
  948. .IP "\fBwrite_id3v2\fR" 4
  949. .IX Item "write_id3v2"
  950. Enable ID3v2 tags writing when set to 1. Default is 0 (disabled).
  951. .IP "\fBid3v2_version\fR" 4
  952. .IX Item "id3v2_version"
  953. Select ID3v2 version to write. Currently only version 3 and 4 (aka.
  954. ID3v2.3 and ID3v2.4) are supported. The default is version 4.
  955. .Sh "crc"
  956. .IX Subsection "crc"
  957. \&\s-1CRC\s0 (Cyclic Redundancy Check) testing format.
  958. .PP
  959. This muxer computes and prints the Adler\-32 \s-1CRC\s0 of all the input audio
  960. and video frames. By default audio frames are converted to signed
  961. 16\-bit raw audio and video frames to raw video before computing the
  962. \&\s-1CRC\s0.
  963. .PP
  964. The output of the muxer consists of a single line of the form:
  965. CRC=0x\fI\s-1CRC\s0\fR, where \fI\s-1CRC\s0\fR is a hexadecimal number 0\-padded to
  966. 8 digits containing the \s-1CRC\s0 for all the decoded input frames.
  967. .PP
  968. See also the \fBframecrc\fR muxer.
  969. .PP
  970. \fIExamples\fR
  971. .IX Subsection "Examples"
  972. .PP
  973. For example to compute the \s-1CRC\s0 of the input, and store it in the file
  974. \&\fIout.crc\fR:
  975. .PP
  976. .Vb 1
  977. \&        ffmpeg -i INPUT -f crc out.crc
  978. .Ve
  979. .PP
  980. You can print the \s-1CRC\s0 to stdout with the command:
  981. .PP
  982. .Vb 1
  983. \&        ffmpeg -i INPUT -f crc -
  984. .Ve
  985. .PP
  986. You can select the output format of each frame with \fBffmpeg\fR by
  987. specifying the audio and video codec and format. For example to
  988. compute the \s-1CRC\s0 of the input audio converted to \s-1PCM\s0 unsigned 8\-bit
  989. and the input video converted to \s-1MPEG\-2\s0 video, use the command:
  990. .PP
  991. .Vb 1
  992. \&        ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f crc -
  993. .Ve
  994. .Sh "framecrc"
  995. .IX Subsection "framecrc"
  996. Per-packet \s-1CRC\s0 (Cyclic Redundancy Check) testing format.
  997. .PP
  998. This muxer computes and prints the Adler\-32 \s-1CRC\s0 for each audio
  999. and video packet. By default audio frames are converted to signed
  1000. 16\-bit raw audio and video frames to raw video before computing the
  1001. \&\s-1CRC\s0.
  1002. .PP
  1003. The output of the muxer consists of a line for each audio and video
  1004. packet of the form:
  1005. .PP
  1006. .Vb 1
  1007. \&        <stream_index>, <packet_dts>, <packet_pts>, <packet_duration>, <packet_size>, 0x<CRC>
  1008. .Ve
  1009. .PP
  1010. \&\fI\s-1CRC\s0\fR is a hexadecimal number 0\-padded to 8 digits containing the
  1011. \&\s-1CRC\s0 of the packet.
  1012. .PP
  1013. \fIExamples\fR
  1014. .IX Subsection "Examples"
  1015. .PP
  1016. For example to compute the \s-1CRC\s0 of the audio and video frames in
  1017. \&\fI\s-1INPUT\s0\fR, converted to raw audio and video packets, and store it
  1018. in the file \fIout.crc\fR:
  1019. .PP
  1020. .Vb 1
  1021. \&        ffmpeg -i INPUT -f framecrc out.crc
  1022. .Ve
  1023. .PP
  1024. To print the information to stdout, use the command:
  1025. .PP
  1026. .Vb 1
  1027. \&        ffmpeg -i INPUT -f framecrc -
  1028. .Ve
  1029. .PP
  1030. With \fBffmpeg\fR, you can select the output format to which the
  1031. audio and video frames are encoded before computing the \s-1CRC\s0 for each
  1032. packet by specifying the audio and video codec. For example, to
  1033. compute the \s-1CRC\s0 of each decoded input audio frame converted to \s-1PCM\s0
  1034. unsigned 8\-bit and of each decoded input video frame converted to
  1035. \&\s-1MPEG\-2\s0 video, use the command:
  1036. .PP
  1037. .Vb 1
  1038. \&        ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f framecrc -
  1039. .Ve
  1040. .PP
  1041. See also the \fBcrc\fR muxer.
  1042. .Sh "framemd5"
  1043. .IX Subsection "framemd5"
  1044. Per-packet \s-1MD5\s0 testing format.
  1045. .PP
  1046. This muxer computes and prints the \s-1MD5\s0 hash for each audio
  1047. and video packet. By default audio frames are converted to signed
  1048. 16\-bit raw audio and video frames to raw video before computing the
  1049. hash.
  1050. .PP
  1051. The output of the muxer consists of a line for each audio and video
  1052. packet of the form:
  1053. .PP
  1054. .Vb 1
  1055. \&        <stream_index>, <packet_dts>, <packet_pts>, <packet_duration>, <packet_size>, <MD5>
  1056. .Ve
  1057. .PP
  1058. \&\fI\s-1MD5\s0\fR is a hexadecimal number representing the computed \s-1MD5\s0 hash
  1059. for the packet.
  1060. .PP
  1061. \fIExamples\fR
  1062. .IX Subsection "Examples"
  1063. .PP
  1064. For example to compute the \s-1MD5\s0 of the audio and video frames in
  1065. \&\fI\s-1INPUT\s0\fR, converted to raw audio and video packets, and store it
  1066. in the file \fIout.md5\fR:
  1067. .PP
  1068. .Vb 1
  1069. \&        ffmpeg -i INPUT -f framemd5 out.md5
  1070. .Ve
  1071. .PP
  1072. To print the information to stdout, use the command:
  1073. .PP
  1074. .Vb 1
  1075. \&        ffmpeg -i INPUT -f framemd5 -
  1076. .Ve
  1077. .PP
  1078. See also the \fBmd5\fR muxer.
  1079. .Sh "gif"
  1080. .IX Subsection "gif"
  1081. Animated \s-1GIF\s0 muxer.
  1082. .PP
  1083. It accepts the following options:
  1084. .IP "\fBloop\fR" 4
  1085. .IX Item "loop"
  1086. Set the number of times to loop the output. Use \f(CW\*(C`\-1\*(C'\fR for no loop, \f(CW0\fR
  1087. for looping indefinitely (default).
  1088. .IP "\fBfinal_delay\fR" 4
  1089. .IX Item "final_delay"
  1090. Force the delay (expressed in centiseconds) after the last frame. Each frame
  1091. ends with a delay until the next frame. The default is \f(CW\*(C`\-1\*(C'\fR, which is a
  1092. special value to tell the muxer to re-use the previous delay. In case of a
  1093. loop, you might want to customize this value to mark a pause for instance.
  1094. .PP
  1095. For example, to encode a gif looping 10 times, with a 5 seconds delay between
  1096. the loops:
  1097. .PP
  1098. .Vb 1
  1099. \&        ffmpeg -i INPUT -loop 10 -final_delay 500 out.gif
  1100. .Ve
  1101. .PP
  1102. Note 1: if you wish to extract the frames in separate \s-1GIF\s0 files, you need to
  1103. force the \fBimage2\fR muxer:
  1104. .PP
  1105. .Vb 1
  1106. \&        ffmpeg -i INPUT -c:v gif -f image2 "out%d.gif"
  1107. .Ve
  1108. .PP
  1109. Note 2: the \s-1GIF\s0 format has a very small time base: the delay between two frames
  1110. can not be smaller than one centi second.
  1111. .Sh "hls"
  1112. .IX Subsection "hls"
  1113. Apple \s-1HTTP\s0 Live Streaming muxer that segments MPEG-TS according to
  1114. the \s-1HTTP\s0 Live Streaming (\s-1HLS\s0) specification.
  1115. .PP
  1116. It creates a playlist file, and one or more segment files. The output filename
  1117. specifies the playlist filename.
  1118. .PP
  1119. By default, the muxer creates a file for each segment produced. These files
  1120. have the same name as the playlist, followed by a sequential number and a
  1121. \&.ts extension.
  1122. .PP
  1123. For example, to convert an input file with \fBffmpeg\fR:
  1124. .PP
  1125. .Vb 1
  1126. \&        ffmpeg -i in.nut out.m3u8
  1127. .Ve
  1128. .PP
  1129. This example will produce the playlist, \fIout.m3u8\fR, and segment files:
  1130. \&\fIout0.ts\fR, \fIout1.ts\fR, \fIout2.ts\fR, etc.
  1131. .PP
  1132. See also the \fBsegment\fR muxer, which provides a more generic and
  1133. flexible implementation of a segmenter, and can be used to perform \s-1HLS\s0
  1134. segmentation.
  1135. .PP
  1136. \fIOptions\fR
  1137. .IX Subsection "Options"
  1138. .PP
  1139. This muxer supports the following options:
  1140. .IP "\fBhls_time\fR \fIseconds\fR" 4
  1141. .IX Item "hls_time seconds"
  1142. Set the segment length in seconds. Default value is 2.
  1143. .IP "\fBhls_list_size\fR \fIsize\fR" 4
  1144. .IX Item "hls_list_size size"
  1145. Set the maximum number of playlist entries. If set to 0 the list file
  1146. will contain all the segments. Default value is 5.
  1147. .IP "\fBhls_ts_options\fR \fIoptions_list\fR" 4
  1148. .IX Item "hls_ts_options options_list"
  1149. Set output format options using a :\-separated list of key=value
  1150. parameters. Values containing \f(CW\*(C`:\*(C'\fR special characters must be
  1151. escaped.
  1152. .IP "\fBhls_wrap\fR \fIwrap\fR" 4
  1153. .IX Item "hls_wrap wrap"
  1154. Set the number after which the segment filename number (the number
  1155. specified in each segment file) wraps. If set to 0 the number will be
  1156. never wrapped. Default value is 0.
  1157. .Sp
  1158. This option is useful to avoid to fill the disk with many segment
  1159. files, and limits the maximum number of segment files written to disk
  1160. to \fIwrap\fR.
  1161. .IP "\fBstart_number\fR \fInumber\fR" 4
  1162. .IX Item "start_number number"
  1163. Start the playlist sequence number from \fInumber\fR. Default value is
  1164. 0.
  1165. .IP "\fBhls_allow_cache\fR \fIallowcache\fR" 4
  1166. .IX Item "hls_allow_cache allowcache"
  1167. Explicitly set whether the client \s-1MAY\s0 (1) or \s-1MUST\s0 \s-1NOT\s0 (0) cache media segments.
  1168. .IP "\fBhls_base_url\fR \fIbaseurl\fR" 4
  1169. .IX Item "hls_base_url baseurl"
  1170. Append \fIbaseurl\fR to every entry in the playlist.
  1171. Useful to generate playlists with absolute paths.
  1172. .Sp
  1173. Note that the playlist sequence number must be unique for each segment
  1174. and it is not to be confused with the segment filename sequence number
  1175. which can be cyclic, for example if the \fBwrap\fR option is
  1176. specified.
  1177. .IP "\fBhls_segment_filename\fR \fIfilename\fR" 4
  1178. .IX Item "hls_segment_filename filename"
  1179. Set the segment filename. Unless hls_flags single_file is set \fIfilename\fR
  1180. is used as a string format with the segment number:
  1181. .Sp
  1182. .Vb 1
  1183. \&        ffmpeg in.nut -hls_segment_filename 'file%03d.ts' out.m3u8
  1184. .Ve
  1185. .Sp
  1186. This example will produce the playlist, \fIout.m3u8\fR, and segment files:
  1187. \&\fIfile000.ts\fR, \fIfile001.ts\fR, \fIfile002.ts\fR, etc.
  1188. .IP "\fBhls_key_info_file\fR \fIkey_info_file\fR" 4
  1189. .IX Item "hls_key_info_file key_info_file"
  1190. Use the information in \fIkey_info_file\fR for segment encryption. The first
  1191. line of \fIkey_info_file\fR specifies the key \s-1URI\s0 written to the playlist. The
  1192. key \s-1URL\s0 is used to access the encryption key during playback. The second line
  1193. specifies the path to the key file used to obtain the key during the encryption
  1194. process. The key file is read as a single packed array of 16 octets in binary
  1195. format. The optional third line specifies the initialization vector (\s-1IV\s0) as a
  1196. hexadecimal string to be used instead of the segment sequence number (default)
  1197. for encryption. Changes to \fIkey_info_file\fR will result in segment
  1198. encryption with the new key/IV and an entry in the playlist for the new key
  1199. \&\s-1URI/IV\s0.
  1200. .Sp
  1201. Key info file format:
  1202. .Sp
  1203. .Vb 3
  1204. \&        <key URI>
  1205. \&        <key file path>
  1206. \&        <IV> (optional)
  1207. .Ve
  1208. .Sp
  1209. Example key URIs:
  1210. .Sp
  1211. .Vb 3
  1212. \&        http://server/file.key
  1213. \&        /path/to/file.key
  1214. \&        file.key
  1215. .Ve
  1216. .Sp
  1217. Example key file paths:
  1218. .Sp
  1219. .Vb 2
  1220. \&        file.key
  1221. \&        /path/to/file.key
  1222. .Ve
  1223. .Sp
  1224. Example \s-1IV:\s0
  1225. .Sp
  1226. .Vb 1
  1227. \&        0123456789ABCDEF0123456789ABCDEF
  1228. .Ve
  1229. .Sp
  1230. Key info file example:
  1231. .Sp
  1232. .Vb 3
  1233. \&        http://server/file.key
  1234. \&        /path/to/file.key
  1235. \&        0123456789ABCDEF0123456789ABCDEF
  1236. .Ve
  1237. .Sp
  1238. Example shell script:
  1239. .Sp
  1240. .Vb 8
  1241. \&        #!/bin/sh
  1242. \&        BASE_URL=${1:-'.'}
  1243. \&        openssl rand 16 > file.key
  1244. \&        echo $BASE_URL/file.key > file.keyinfo
  1245. \&        echo file.key >> file.keyinfo
  1246. \&        echo $(openssl rand -hex 16) >> file.keyinfo
  1247. \&        ffmpeg -f lavfi -re -i testsrc -c:v h264 -hls_flags delete_segments \e
  1248. \&          -hls_key_info_file file.keyinfo out.m3u8
  1249. .Ve
  1250. .IP "\fBhls_flags single_file\fR" 4
  1251. .IX Item "hls_flags single_file"
  1252. If this flag is set, the muxer will store all segments in a single MPEG-TS
  1253. file, and will use byte ranges in the playlist. \s-1HLS\s0 playlists generated with
  1254. this way will have the version number 4.
  1255. For example:
  1256. .Sp
  1257. .Vb 1
  1258. \&        ffmpeg -i in.nut -hls_flags single_file out.m3u8
  1259. .Ve
  1260. .Sp
  1261. Will produce the playlist, \fIout.m3u8\fR, and a single segment file,
  1262. \&\fIout.ts\fR.
  1263. .IP "\fBhls_flags delete_segments\fR" 4
  1264. .IX Item "hls_flags delete_segments"
  1265. Segment files removed from the playlist are deleted after a period of time
  1266. equal to the duration of the segment plus the duration of the playlist.
  1267. .Sh "ico"
  1268. .IX Subsection "ico"
  1269. \&\s-1ICO\s0 file muxer.
  1270. .PP
  1271. Microsoft's icon file format (\s-1ICO\s0) has some strict limitations that should be noted:
  1272. .IP "\(bu" 4
  1273. Size cannot exceed 256 pixels in any dimension
  1274. .IP "\(bu" 4
  1275. Only \s-1BMP\s0 and \s-1PNG\s0 images can be stored
  1276. .IP "\(bu" 4
  1277. If a \s-1BMP\s0 image is used, it must be one of the following pixel formats:
  1278. .Sp
  1279. .Vb 7
  1280. \&        BMP Bit Depth      FFmpeg Pixel Format
  1281. \&        1bit               pal8
  1282. \&        4bit               pal8
  1283. \&        8bit               pal8
  1284. \&        16bit              rgb555le
  1285. \&        24bit              bgr24
  1286. \&        32bit              bgra
  1287. .Ve
  1288. .IP "\(bu" 4
  1289. If a \s-1BMP\s0 image is used, it must use the \s-1BITMAPINFOHEADER\s0 \s-1DIB\s0 header
  1290. .IP "\(bu" 4
  1291. If a \s-1PNG\s0 image is used, it must use the rgba pixel format
  1292. .Sh "image2"
  1293. .IX Subsection "image2"
  1294. Image file muxer.
  1295. .PP
  1296. The image file muxer writes video frames to image files.
  1297. .PP
  1298. The output filenames are specified by a pattern, which can be used to
  1299. produce sequentially numbered series of files.
  1300. The pattern may contain the string \*(L"%d\*(R" or "%0\fIN\fRd\*(L", this string
  1301. specifies the position of the characters representing a numbering in
  1302. the filenames. If the form \*(R"%0\fIN\fRd" is used, the string
  1303. representing the number in each filename is 0\-padded to \fIN\fR
  1304. digits. The literal character '%' can be specified in the pattern with
  1305. the string \*(L"%%\*(R".
  1306. .PP
  1307. If the pattern contains \*(L"%d\*(R" or "%0\fIN\fRd", the first filename of
  1308. the file list specified will contain the number 1, all the following
  1309. numbers will be sequential.
  1310. .PP
  1311. The pattern may contain a suffix which is used to automatically
  1312. determine the format of the image files to write.
  1313. .PP
  1314. For example the pattern \*(L"img\-%03d.bmp\*(R" will specify a sequence of
  1315. filenames of the form \fIimg\-001.bmp\fR, \fIimg\-002.bmp\fR, ...,
  1316. \&\fIimg\-010.bmp\fR, etc.
  1317. The pattern \*(L"img%%\-%d.jpg\*(R" will specify a sequence of filenames of the
  1318. form \fIimg%\-1.jpg\fR, \fIimg%\-2.jpg\fR, ..., \fIimg%\-10.jpg\fR,
  1319. etc.
  1320. .PP
  1321. \fIExamples\fR
  1322. .IX Subsection "Examples"
  1323. .PP
  1324. The following example shows how to use \fBffmpeg\fR for creating a
  1325. sequence of files \fIimg\-001.jpeg\fR, \fIimg\-002.jpeg\fR, ...,
  1326. taking one image every second from the input video:
  1327. .PP
  1328. .Vb 1
  1329. \&        ffmpeg -i in.avi -vsync 1 -r 1 -f image2 'img-%03d.jpeg'
  1330. .Ve
  1331. .PP
  1332. Note that with \fBffmpeg\fR, if the format is not specified with the
  1333. \&\f(CW\*(C`\-f\*(C'\fR option and the output filename specifies an image file
  1334. format, the image2 muxer is automatically selected, so the previous
  1335. command can be written as:
  1336. .PP
  1337. .Vb 1
  1338. \&        ffmpeg -i in.avi -vsync 1 -r 1 'img-%03d.jpeg'
  1339. .Ve
  1340. .PP
  1341. Note also that the pattern must not necessarily contain \*(L"%d\*(R" or
  1342. "%0\fIN\fRd", for example to create a single image file
  1343. \&\fIimg.jpeg\fR from the input video you can employ the command:
  1344. .PP
  1345. .Vb 1
  1346. \&        ffmpeg -i in.avi -f image2 -frames:v 1 img.jpeg
  1347. .Ve
  1348. .PP
  1349. The \fBstrftime\fR option allows you to expand the filename with
  1350. date and time information. Check the documentation of
  1351. the \f(CW\*(C`strftime()\*(C'\fR function for the syntax.
  1352. .PP
  1353. For example to generate image files from the \f(CW\*(C`strftime()\*(C'\fR
  1354. \&\*(L"%Y\-%m\-%d_%H\-%M\-%S\*(R" pattern, the following \fBffmpeg\fR command
  1355. can be used:
  1356. .PP
  1357. .Vb 1
  1358. \&        ffmpeg -f v4l2 -r 1 -i /dev/video0 -f image2 -strftime 1 "%Y-%m-%d_%H-%M-%S.jpg"
  1359. .Ve
  1360. .PP
  1361. \fIOptions\fR
  1362. .IX Subsection "Options"
  1363. .IP "\fBstart_number\fR" 4
  1364. .IX Item "start_number"
  1365. Start the sequence from the specified number. Default value is 0.
  1366. .IP "\fBupdate\fR" 4
  1367. .IX Item "update"
  1368. If set to 1, the filename will always be interpreted as just a
  1369. filename, not a pattern, and the corresponding file will be continuously
  1370. overwritten with new images. Default value is 0.
  1371. .IP "\fBstrftime\fR" 4
  1372. .IX Item "strftime"
  1373. If set to 1, expand the filename with date and time information from
  1374. \&\f(CW\*(C`strftime()\*(C'\fR. Default value is 0.
  1375. .PP
  1376. The image muxer supports the .Y.U.V image file format. This format is
  1377. special in that that each image frame consists of three files, for
  1378. each of the \s-1YUV420P\s0 components. To read or write this image file format,
  1379. specify the name of the '.Y' file. The muxer will automatically open the
  1380. \&'.U' and '.V' files as required.
  1381. .Sh "matroska"
  1382. .IX Subsection "matroska"
  1383. Matroska container muxer.
  1384. .PP
  1385. This muxer implements the matroska and webm container specs.
  1386. .PP
  1387. \fIMetadata\fR
  1388. .IX Subsection "Metadata"
  1389. .PP
  1390. The recognized metadata settings in this muxer are:
  1391. .IP "\fBtitle\fR" 4
  1392. .IX Item "title"
  1393. Set title name provided to a single track.
  1394. .IP "\fBlanguage\fR" 4
  1395. .IX Item "language"
  1396. Specify the language of the track in the Matroska languages form.
  1397. .Sp
  1398. The language can be either the 3 letters bibliographic \s-1ISO\-639\-2\s0 (\s-1ISO\s0
  1399. 639\-2/B) form (like \*(L"fre\*(R" for French), or a language code mixed with a
  1400. country code for specialities in languages (like \*(L"fre\-ca\*(R" for Canadian
  1401. French).
  1402. .IP "\fBstereo_mode\fR" 4
  1403. .IX Item "stereo_mode"
  1404. Set stereo 3D video layout of two views in a single video track.
  1405. .Sp
  1406. The following values are recognized:
  1407. .RS 4
  1408. .IP "\fBmono\fR" 4
  1409. .IX Item "mono"
  1410. video is not stereo
  1411. .IP "\fBleft_right\fR" 4
  1412. .IX Item "left_right"
  1413. Both views are arranged side by side, Left-eye view is on the left
  1414. .IP "\fBbottom_top\fR" 4
  1415. .IX Item "bottom_top"
  1416. Both views are arranged in top-bottom orientation, Left-eye view is at bottom
  1417. .IP "\fBtop_bottom\fR" 4
  1418. .IX Item "top_bottom"
  1419. Both views are arranged in top-bottom orientation, Left-eye view is on top
  1420. .IP "\fBcheckerboard_rl\fR" 4
  1421. .IX Item "checkerboard_rl"
  1422. Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first
  1423. .IP "\fBcheckerboard_lr\fR" 4
  1424. .IX Item "checkerboard_lr"
  1425. Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first
  1426. .IP "\fBrow_interleaved_rl\fR" 4
  1427. .IX Item "row_interleaved_rl"
  1428. Each view is constituted by a row based interleaving, Right-eye view is first row
  1429. .IP "\fBrow_interleaved_lr\fR" 4
  1430. .IX Item "row_interleaved_lr"
  1431. Each view is constituted by a row based interleaving, Left-eye view is first row
  1432. .IP "\fBcol_interleaved_rl\fR" 4
  1433. .IX Item "col_interleaved_rl"
  1434. Both views are arranged in a column based interleaving manner, Right-eye view is first column
  1435. .IP "\fBcol_interleaved_lr\fR" 4
  1436. .IX Item "col_interleaved_lr"
  1437. Both views are arranged in a column based interleaving manner, Left-eye view is first column
  1438. .IP "\fBanaglyph_cyan_red\fR" 4
  1439. .IX Item "anaglyph_cyan_red"
  1440. All frames are in anaglyph format viewable through red-cyan filters
  1441. .IP "\fBright_left\fR" 4
  1442. .IX Item "right_left"
  1443. Both views are arranged side by side, Right-eye view is on the left
  1444. .IP "\fBanaglyph_green_magenta\fR" 4
  1445. .IX Item "anaglyph_green_magenta"
  1446. All frames are in anaglyph format viewable through green-magenta filters
  1447. .IP "\fBblock_lr\fR" 4
  1448. .IX Item "block_lr"
  1449. Both eyes laced in one Block, Left-eye view is first
  1450. .IP "\fBblock_rl\fR" 4
  1451. .IX Item "block_rl"
  1452. Both eyes laced in one Block, Right-eye view is first
  1453. .RE
  1454. .RS 4
  1455. .RE
  1456. .PP
  1457. For example a 3D WebM clip can be created using the following command line:
  1458. .PP
  1459. .Vb 1
  1460. \&        ffmpeg -i sample_left_right_clip.mpg -an -c:v libvpx -metadata stereo_mode=left_right -y stereo_clip.webm
  1461. .Ve
  1462. .PP
  1463. \fIOptions\fR
  1464. .IX Subsection "Options"
  1465. .PP
  1466. This muxer supports the following options:
  1467. .IP "\fBreserve_index_space\fR" 4
  1468. .IX Item "reserve_index_space"
  1469. By default, this muxer writes the index for seeking (called cues in Matroska
  1470. terms) at the end of the file, because it cannot know in advance how much space
  1471. to leave for the index at the beginning of the file. However for some use cases
  1472. \&\*(-- e.g.  streaming where seeking is possible but slow \*(-- it is useful to put the
  1473. index at the beginning of the file.
  1474. .Sp
  1475. If this option is set to a non-zero value, the muxer will reserve a given amount
  1476. of space in the file header and then try to write the cues there when the muxing
  1477. finishes. If the available space does not suffice, muxing will fail. A safe size
  1478. for most use cases should be about 50kB per hour of video.
  1479. .Sp
  1480. Note that cues are only written if the output is seekable and this option will
  1481. have no effect if it is not.
  1482. .Sh "md5"
  1483. .IX Subsection "md5"
  1484. \&\s-1MD5\s0 testing format.
  1485. .PP
  1486. This muxer computes and prints the \s-1MD5\s0 hash of all the input audio
  1487. and video frames. By default audio frames are converted to signed
  1488. 16\-bit raw audio and video frames to raw video before computing the
  1489. hash.
  1490. .PP
  1491. The output of the muxer consists of a single line of the form:
  1492. MD5=\fI\s-1MD5\s0\fR, where \fI\s-1MD5\s0\fR is a hexadecimal number representing
  1493. the computed \s-1MD5\s0 hash.
  1494. .PP
  1495. For example to compute the \s-1MD5\s0 hash of the input converted to raw
  1496. audio and video, and store it in the file \fIout.md5\fR:
  1497. .PP
  1498. .Vb 1
  1499. \&        ffmpeg -i INPUT -f md5 out.md5
  1500. .Ve
  1501. .PP
  1502. You can print the \s-1MD5\s0 to stdout with the command:
  1503. .PP
  1504. .Vb 1
  1505. \&        ffmpeg -i INPUT -f md5 -
  1506. .Ve
  1507. .PP
  1508. See also the \fBframemd5\fR muxer.
  1509. .Sh "mov, mp4, ismv"
  1510. .IX Subsection "mov, mp4, ismv"
  1511. \&\s-1MOV/MP4/ISMV\s0 (Smooth Streaming) muxer.
  1512. .PP
  1513. The mov/mp4/ismv muxer supports fragmentation. Normally, a \s-1MOV/MP4\s0
  1514. file has all the metadata about all packets stored in one location
  1515. (written at the end of the file, it can be moved to the start for
  1516. better playback by adding \fIfaststart\fR to the \fImovflags\fR, or
  1517. using the \fBqt-faststart\fR tool). A fragmented
  1518. file consists of a number of fragments, where packets and metadata
  1519. about these packets are stored together. Writing a fragmented
  1520. file has the advantage that the file is decodable even if the
  1521. writing is interrupted (while a normal \s-1MOV/MP4\s0 is undecodable if
  1522. it is not properly finished), and it requires less memory when writing
  1523. very long files (since writing normal \s-1MOV/MP4\s0 files stores info about
  1524. every single packet in memory until the file is closed). The downside
  1525. is that it is less compatible with other applications.
  1526. .PP
  1527. \fIOptions\fR
  1528. .IX Subsection "Options"
  1529. .PP
  1530. Fragmentation is enabled by setting one of the AVOptions that define
  1531. how to cut the file into fragments:
  1532. .IP "\fB\-moov_size\fR \fIbytes\fR" 4
  1533. .IX Item "-moov_size bytes"
  1534. Reserves space for the moov atom at the beginning of the file instead of placing the
  1535. moov atom at the end. If the space reserved is insufficient, muxing will fail.
  1536. .IP "\fB\-movflags frag_keyframe\fR" 4
  1537. .IX Item "-movflags frag_keyframe"
  1538. Start a new fragment at each video keyframe.
  1539. .IP "\fB\-frag_duration\fR \fIduration\fR" 4
  1540. .IX Item "-frag_duration duration"
  1541. Create fragments that are \fIduration\fR microseconds long.
  1542. .IP "\fB\-frag_size\fR \fIsize\fR" 4
  1543. .IX Item "-frag_size size"
  1544. Create fragments that contain up to \fIsize\fR bytes of payload data.
  1545. .IP "\fB\-movflags frag_custom\fR" 4
  1546. .IX Item "-movflags frag_custom"
  1547. Allow the caller to manually choose when to cut fragments, by
  1548. calling \f(CW\*(C`av_write_frame(ctx, NULL)\*(C'\fR to write a fragment with
  1549. the packets written so far. (This is only useful with other
  1550. applications integrating libavformat, not from \fBffmpeg\fR.)
  1551. .IP "\fB\-min_frag_duration\fR \fIduration\fR" 4
  1552. .IX Item "-min_frag_duration duration"
  1553. Don't create fragments that are shorter than \fIduration\fR microseconds long.
  1554. .PP
  1555. If more than one condition is specified, fragments are cut when
  1556. one of the specified conditions is fulfilled. The exception to this is
  1557. \&\f(CW\*(C`\-min_frag_duration\*(C'\fR, which has to be fulfilled for any of the other
  1558. conditions to apply.
  1559. .PP
  1560. Additionally, the way the output file is written can be adjusted
  1561. through a few other options:
  1562. .IP "\fB\-movflags empty_moov\fR" 4
  1563. .IX Item "-movflags empty_moov"
  1564. Write an initial moov atom directly at the start of the file, without
  1565. describing any samples in it. Generally, an mdat/moov pair is written
  1566. at the start of the file, as a normal \s-1MOV/MP4\s0 file, containing only
  1567. a short portion of the file. With this option set, there is no initial
  1568. mdat atom, and the moov atom only describes the tracks but has
  1569. a zero duration.
  1570. .Sp
  1571. This option is implicitly set when writing ismv (Smooth Streaming) files.
  1572. .IP "\fB\-movflags separate_moof\fR" 4
  1573. .IX Item "-movflags separate_moof"
  1574. Write a separate moof (movie fragment) atom for each track. Normally,
  1575. packets for all tracks are written in a moof atom (which is slightly
  1576. more efficient), but with this option set, the muxer writes one moof/mdat
  1577. pair for each track, making it easier to separate tracks.
  1578. .Sp
  1579. This option is implicitly set when writing ismv (Smooth Streaming) files.
  1580. .IP "\fB\-movflags faststart\fR" 4
  1581. .IX Item "-movflags faststart"
  1582. Run a second pass moving the index (moov atom) to the beginning of the file.
  1583. This operation can take a while, and will not work in various situations such
  1584. as fragmented output, thus it is not enabled by default.
  1585. .IP "\fB\-movflags rtphint\fR" 4
  1586. .IX Item "-movflags rtphint"
  1587. Add \s-1RTP\s0 hinting tracks to the output file.
  1588. .IP "\fB\-movflags disable_chpl\fR" 4
  1589. .IX Item "-movflags disable_chpl"
  1590. Disable Nero chapter markers (chpl atom).  Normally, both Nero chapters
  1591. and a QuickTime chapter track are written to the file. With this option
  1592. set, only the QuickTime chapter track will be written. Nero chapters can
  1593. cause failures when the file is reprocessed with certain tagging programs, like
  1594. mp3Tag 2.61a and iTunes 11.3, most likely other versions are affected as well.
  1595. .IP "\fB\-movflags omit_tfhd_offset\fR" 4
  1596. .IX Item "-movflags omit_tfhd_offset"
  1597. Do not write any absolute base_data_offset in tfhd atoms. This avoids
  1598. tying fragments to absolute byte positions in the file/streams.
  1599. .IP "\fB\-movflags default_base_moof\fR" 4
  1600. .IX Item "-movflags default_base_moof"
  1601. Similarly to the omit_tfhd_offset, this flag avoids writing the
  1602. absolute base_data_offset field in tfhd atoms, but does so by using
  1603. the new default-base-is-moof flag instead. This flag is new from
  1604. 14496\-12:2012. This may make the fragments easier to parse in certain
  1605. circumstances (avoiding basing track fragment location calculations
  1606. on the implicit end of the previous track fragment).
  1607. .PP
  1608. \fIExample\fR
  1609. .IX Subsection "Example"
  1610. .PP
  1611. Smooth Streaming content can be pushed in real time to a publishing
  1612. point on \s-1IIS\s0 with this muxer. Example:
  1613. .PP
  1614. .Vb 1
  1615. \&        ffmpeg -re <<normal input/transcoding options>> -movflags isml+frag_keyframe -f ismv http://server/publishingpoint.isml/Streams(Encoder1)
  1616. .Ve
  1617. .PP
  1618. \fIAudible \s-1AAX\s0\fR
  1619. .IX Subsection "Audible AAX"
  1620. .PP
  1621. Audible \s-1AAX\s0 files are encrypted M4B files, and they can be decrypted by specifying a 4 byte activation secret.
  1622. .PP
  1623. .Vb 1
  1624. \&        ffmpeg -activation_bytes 1CEB00DA -i test.aax -vn -c:a copy output.mp4
  1625. .Ve
  1626. .Sh "mp3"
  1627. .IX Subsection "mp3"
  1628. The \s-1MP3\s0 muxer writes a raw \s-1MP3\s0 stream with the following optional features:
  1629. .IP "\(bu" 4
  1630. An ID3v2 metadata header at the beginning (enabled by default). Versions 2.3 and
  1631. 2.4 are supported, the \f(CW\*(C`id3v2_version\*(C'\fR private option controls which one is
  1632. used (3 or 4). Setting \f(CW\*(C`id3v2_version\*(C'\fR to 0 disables the ID3v2 header
  1633. completely.
  1634. .Sp
  1635. The muxer supports writing attached pictures (\s-1APIC\s0 frames) to the ID3v2 header.
  1636. The pictures are supplied to the muxer in form of a video stream with a single
  1637. packet. There can be any number of those streams, each will correspond to a
  1638. single \s-1APIC\s0 frame.  The stream metadata tags \fItitle\fR and \fIcomment\fR map
  1639. to \s-1APIC\s0 \fIdescription\fR and \fIpicture type\fR respectively. See
  1640. <\fBhttp://id3.org/id3v2.4.0\-frames\fR> for allowed picture types.
  1641. .Sp
  1642. Note that the \s-1APIC\s0 frames must be written at the beginning, so the muxer will
  1643. buffer the audio frames until it gets all the pictures. It is therefore advised
  1644. to provide the pictures as soon as possible to avoid excessive buffering.
  1645. .IP "\(bu" 4
  1646. A Xing/LAME frame right after the ID3v2 header (if present). It is enabled by
  1647. default, but will be written only if the output is seekable. The
  1648. \&\f(CW\*(C`write_xing\*(C'\fR private option can be used to disable it.  The frame contains
  1649. various information that may be useful to the decoder, like the audio duration
  1650. or encoder delay.
  1651. .IP "\(bu" 4
  1652. A legacy ID3v1 tag at the end of the file (disabled by default). It may be
  1653. enabled with the \f(CW\*(C`write_id3v1\*(C'\fR private option, but as its capabilities are
  1654. very limited, its usage is not recommended.
  1655. .PP
  1656. Examples:
  1657. .PP
  1658. Write an mp3 with an ID3v2.3 header and an ID3v1 footer:
  1659. .PP
  1660. .Vb 1
  1661. \&        ffmpeg -i INPUT -id3v2_version 3 -write_id3v1 1 out.mp3
  1662. .Ve
  1663. .PP
  1664. To attach a picture to an mp3 file select both the audio and the picture stream
  1665. with \f(CW\*(C`map\*(C'\fR:
  1666. .PP
  1667. .Vb 2
  1668. \&        ffmpeg -i input.mp3 -i cover.png -c copy -map 0 -map 1
  1669. \&        -metadata:s:v title="Album cover" -metadata:s:v comment="Cover (Front)" out.mp3
  1670. .Ve
  1671. .PP
  1672. Write a \*(L"clean\*(R" \s-1MP3\s0 without any extra features:
  1673. .PP
  1674. .Vb 1
  1675. \&        ffmpeg -i input.wav -write_xing 0 -id3v2_version 0 out.mp3
  1676. .Ve
  1677. .Sh "mpegts"
  1678. .IX Subsection "mpegts"
  1679. \&\s-1MPEG\s0 transport stream muxer.
  1680. .PP
  1681. This muxer implements \s-1ISO\s0 13818\-1 and part of \s-1ETSI\s0 \s-1EN\s0 300 468.
  1682. .PP
  1683. The recognized metadata settings in mpegts muxer are \f(CW\*(C`service_provider\*(C'\fR
  1684. and \f(CW\*(C`service_name\*(C'\fR. If they are not set the default for
  1685. \&\f(CW\*(C`service_provider\*(C'\fR is \*(L"FFmpeg\*(R" and the default for
  1686. \&\f(CW\*(C`service_name\*(C'\fR is \*(L"Service01\*(R".
  1687. .PP
  1688. \fIOptions\fR
  1689. .IX Subsection "Options"
  1690. .PP
  1691. The muxer options are:
  1692. .IP "\fB\-mpegts_original_network_id\fR \fInumber\fR" 4
  1693. .IX Item "-mpegts_original_network_id number"
  1694. Set the original_network_id (default 0x0001). This is unique identifier
  1695. of a network in \s-1DVB\s0. Its main use is in the unique identification of a
  1696. service through the path Original_Network_ID, Transport_Stream_ID.
  1697. .IP "\fB\-mpegts_transport_stream_id\fR \fInumber\fR" 4
  1698. .IX Item "-mpegts_transport_stream_id number"
  1699. Set the transport_stream_id (default 0x0001). This identifies a
  1700. transponder in \s-1DVB\s0.
  1701. .IP "\fB\-mpegts_service_id\fR \fInumber\fR" 4
  1702. .IX Item "-mpegts_service_id number"
  1703. Set the service_id (default 0x0001) also known as program in \s-1DVB\s0.
  1704. .IP "\fB\-mpegts_service_type\fR \fInumber\fR" 4
  1705. .IX Item "-mpegts_service_type number"
  1706. Set the program service_type (default \fIdigital_tv\fR), see below
  1707. a list of pre defined values.
  1708. .IP "\fB\-mpegts_pmt_start_pid\fR \fInumber\fR" 4
  1709. .IX Item "-mpegts_pmt_start_pid number"
  1710. Set the first \s-1PID\s0 for \s-1PMT\s0 (default 0x1000, max 0x1f00).
  1711. .IP "\fB\-mpegts_start_pid\fR \fInumber\fR" 4
  1712. .IX Item "-mpegts_start_pid number"
  1713. Set the first \s-1PID\s0 for data packets (default 0x0100, max 0x0f00).
  1714. .IP "\fB\-mpegts_m2ts_mode\fR \fInumber\fR" 4
  1715. .IX Item "-mpegts_m2ts_mode number"
  1716. Enable m2ts mode if set to 1. Default value is \-1 which disables m2ts mode.
  1717. .IP "\fB\-muxrate\fR \fInumber\fR" 4
  1718. .IX Item "-muxrate number"
  1719. Set a constant muxrate (default \s-1VBR\s0).
  1720. .IP "\fB\-pcr_period\fR \fInumer\fR" 4
  1721. .IX Item "-pcr_period numer"
  1722. Override the default \s-1PCR\s0 retransmission time (default 20ms), ignored
  1723. if variable muxrate is selected.
  1724. .IP "\fBpat_period\fR \fInumber\fR" 4
  1725. .IX Item "pat_period number"
  1726. Maximal time in seconds between \s-1PAT/PMT\s0 tables.
  1727. .IP "\fBsdt_period\fR \fInumber\fR" 4
  1728. .IX Item "sdt_period number"
  1729. Maximal time in seconds between \s-1SDT\s0 tables.
  1730. .IP "\fB\-pes_payload_size\fR \fInumber\fR" 4
  1731. .IX Item "-pes_payload_size number"
  1732. Set minimum \s-1PES\s0 packet payload in bytes.
  1733. .IP "\fB\-mpegts_flags\fR \fIflags\fR" 4
  1734. .IX Item "-mpegts_flags flags"
  1735. Set flags (see below).
  1736. .IP "\fB\-mpegts_copyts\fR \fInumber\fR" 4
  1737. .IX Item "-mpegts_copyts number"
  1738. Preserve original timestamps, if value is set to 1. Default value is \-1, which
  1739. results in shifting timestamps so that they start from 0.
  1740. .IP "\fB\-tables_version\fR \fInumber\fR" 4
  1741. .IX Item "-tables_version number"
  1742. Set \s-1PAT\s0, \s-1PMT\s0 and \s-1SDT\s0 version (default 0, valid values are from 0 to 31, inclusively).
  1743. This option allows updating stream structure so that standard consumer may
  1744. detect the change. To do so, reopen output AVFormatContext (in case of \s-1API\s0
  1745. usage) or restart ffmpeg instance, cyclically changing tables_version value:
  1746. .Sp
  1747. .Vb 7
  1748. \&        ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udp://1.1.1.1:1111
  1749. \&        ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
  1750. \&        ...
  1751. \&        ffmpeg -i source3.ts -codec copy -f mpegts -tables_version 31 udp://1.1.1.1:1111
  1752. \&        ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udp://1.1.1.1:1111
  1753. \&        ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
  1754. \&        ...
  1755. .Ve
  1756. .PP
  1757. Option mpegts_service_type accepts the following values:
  1758. .IP "\fBhex_value\fR" 4
  1759. .IX Item "hex_value"
  1760. Any hexdecimal value between 0x01 to 0xff as defined in \s-1ETSI\s0 300 468.
  1761. .IP "\fBdigital_tv\fR" 4
  1762. .IX Item "digital_tv"
  1763. Digital \s-1TV\s0 service.
  1764. .IP "\fBdigital_radio\fR" 4
  1765. .IX Item "digital_radio"
  1766. Digital Radio service.
  1767. .IP "\fBteletext\fR" 4
  1768. .IX Item "teletext"
  1769. Teletext service.
  1770. .IP "\fBadvanced_codec_digital_radio\fR" 4
  1771. .IX Item "advanced_codec_digital_radio"
  1772. Advanced Codec Digital Radio service.
  1773. .IP "\fBmpeg2_digital_hdtv\fR" 4
  1774. .IX Item "mpeg2_digital_hdtv"
  1775. \&\s-1MPEG2\s0 Digital \s-1HDTV\s0 service.
  1776. .IP "\fBadvanced_codec_digital_sdtv\fR" 4
  1777. .IX Item "advanced_codec_digital_sdtv"
  1778. Advanced Codec Digital \s-1SDTV\s0 service.
  1779. .IP "\fBadvanced_codec_digital_hdtv\fR" 4
  1780. .IX Item "advanced_codec_digital_hdtv"
  1781. Advanced Codec Digital \s-1HDTV\s0 service.
  1782. .PP
  1783. Option mpegts_flags may take a set of such flags:
  1784. .IP "\fBresend_headers\fR" 4
  1785. .IX Item "resend_headers"
  1786. Reemit \s-1PAT/PMT\s0 before writing the next packet.
  1787. .IP "\fBlatm\fR" 4
  1788. .IX Item "latm"
  1789. Use \s-1LATM\s0 packetization for \s-1AAC\s0.
  1790. .IP "\fBpat_pmt_at_frames\fR" 4
  1791. .IX Item "pat_pmt_at_frames"
  1792. Reemit \s-1PAT\s0 and \s-1PMT\s0 at each video frame.
  1793. .PP
  1794. \fIExample\fR
  1795. .IX Subsection "Example"
  1796. .PP
  1797. .Vb 9
  1798. \&        ffmpeg -i file.mpg -c copy \e
  1799. \&             -mpegts_original_network_id 0x1122 \e
  1800. \&             -mpegts_transport_stream_id 0x3344 \e
  1801. \&             -mpegts_service_id 0x5566 \e
  1802. \&             -mpegts_pmt_start_pid 0x1500 \e
  1803. \&             -mpegts_start_pid 0x150 \e
  1804. \&             -metadata service_provider="Some provider" \e
  1805. \&             -metadata service_name="Some Channel" \e
  1806. \&             -y out.ts
  1807. .Ve
  1808. .Sh "mxf, mxf_d10"
  1809. .IX Subsection "mxf, mxf_d10"
  1810. \&\s-1MXF\s0 muxer.
  1811. .PP
  1812. \fIOptions\fR
  1813. .IX Subsection "Options"
  1814. .PP
  1815. The muxer options are:
  1816. .IP "\fBstore_user_comments\fR \fIbool\fR" 4
  1817. .IX Item "store_user_comments bool"
  1818. Set if user comments should be stored if available or never.
  1819. \&\s-1IRT\s0 D\-10 does not allow user comments. The default is thus to write them for
  1820. mxf but not for mxf_d10
  1821. .Sh "null"
  1822. .IX Subsection "null"
  1823. Null muxer.
  1824. .PP
  1825. This muxer does not generate any output file, it is mainly useful for
  1826. testing or benchmarking purposes.
  1827. .PP
  1828. For example to benchmark decoding with \fBffmpeg\fR you can use the
  1829. command:
  1830. .PP
  1831. .Vb 1
  1832. \&        ffmpeg -benchmark -i INPUT -f null out.null
  1833. .Ve
  1834. .PP
  1835. Note that the above command does not read or write the \fIout.null\fR
  1836. file, but specifying the output file is required by the \fBffmpeg\fR
  1837. syntax.
  1838. .PP
  1839. Alternatively you can write the command as:
  1840. .PP
  1841. .Vb 1
  1842. \&        ffmpeg -benchmark -i INPUT -f null -
  1843. .Ve
  1844. .Sh "nut"
  1845. .IX Subsection "nut"
  1846. .IP "\fB\-syncpoints\fR \fIflags\fR" 4
  1847. .IX Item "-syncpoints flags"
  1848. Change the syncpoint usage in nut:
  1849. .RS 4
  1850. .IP "\fIdefault\fR \fBuse the normal low-overhead seeking aids.\fR" 4
  1851. .IX Item "default use the normal low-overhead seeking aids."
  1852. .PD 0
  1853. .IP "\fInone\fR \fBdo not use the syncpoints at all, reducing the overhead but making the stream non\-seekable;\fR" 4
  1854. .IX Item "none do not use the syncpoints at all, reducing the overhead but making the stream non-seekable;"
  1855. .PD
  1856. .Vb 5
  1857. \&    Use of this option is not recommended, as the resulting files are very damage
  1858. \&    sensitive and seeking is not possible. Also in general the overhead from
  1859. \&    syncpoints is negligible. Note, -C<write_index> 0 can be used to disable
  1860. \&    all growing data tables, allowing to mux endless streams with limited memory
  1861. \&    and without these disadvantages.
  1862. .Ve
  1863. .IP "\fItimestamped\fR \fBextend the syncpoint with a wallclock field.\fR" 4
  1864. .IX Item "timestamped extend the syncpoint with a wallclock field."
  1865. .RE
  1866. .RS 4
  1867. .Sp
  1868. The \fInone\fR and \fItimestamped\fR flags are experimental.
  1869. .RE
  1870. .IP "\fB\-write_index\fR \fIbool\fR" 4
  1871. .IX Item "-write_index bool"
  1872. Write index at the end, the default is to write an index.
  1873. .PP
  1874. .Vb 1
  1875. \&        ffmpeg -i INPUT -f_strict experimental -syncpoints none - | processor
  1876. .Ve
  1877. .Sh "ogg"
  1878. .IX Subsection "ogg"
  1879. Ogg container muxer.
  1880. .IP "\fB\-page_duration\fR \fIduration\fR" 4
  1881. .IX Item "-page_duration duration"
  1882. Preferred page duration, in microseconds. The muxer will attempt to create
  1883. pages that are approximately \fIduration\fR microseconds long. This allows the
  1884. user to compromise between seek granularity and container overhead. The default
  1885. is 1 second. A value of 0 will fill all segments, making pages as large as
  1886. possible. A value of 1 will effectively use 1 packet-per-page in most
  1887. situations, giving a small seek granularity at the cost of additional container
  1888. overhead.
  1889. .IP "\fB\-serial_offset\fR \fIvalue\fR" 4
  1890. .IX Item "-serial_offset value"
  1891. Serial value from which to set the streams serial number.
  1892. Setting it to different and sufficiently large values ensures that the produced
  1893. ogg files can be safely chained.
  1894. .Sh "segment, stream_segment, ssegment"
  1895. .IX Subsection "segment, stream_segment, ssegment"
  1896. Basic stream segmenter.
  1897. .PP
  1898. This muxer outputs streams to a number of separate files of nearly
  1899. fixed duration. Output filename pattern can be set in a fashion
  1900. similar to \fBimage2\fR, or by using a \f(CW\*(C`strftime\*(C'\fR template if
  1901. the \fBstrftime\fR option is enabled.
  1902. .PP
  1903. \&\f(CW\*(C`stream_segment\*(C'\fR is a variant of the muxer used to write to
  1904. streaming output formats, i.e. which do not require global headers,
  1905. and is recommended for outputting e.g. to \s-1MPEG\s0 transport stream segments.
  1906. \&\f(CW\*(C`ssegment\*(C'\fR is a shorter alias for \f(CW\*(C`stream_segment\*(C'\fR.
  1907. .PP
  1908. Every segment starts with a keyframe of the selected reference stream,
  1909. which is set through the \fBreference_stream\fR option.
  1910. .PP
  1911. Note that if you want accurate splitting for a video file, you need to
  1912. make the input key frames correspond to the exact splitting times
  1913. expected by the segmenter, or the segment muxer will start the new
  1914. segment with the key frame found next after the specified start
  1915. time.
  1916. .PP
  1917. The segment muxer works best with a single constant frame rate video.
  1918. .PP
  1919. Optionally it can generate a list of the created segments, by setting
  1920. the option \fIsegment_list\fR. The list type is specified by the
  1921. \&\fIsegment_list_type\fR option. The entry filenames in the segment
  1922. list are set by default to the basename of the corresponding segment
  1923. files.
  1924. .PP
  1925. See also the \fBhls\fR muxer, which provides a more specific
  1926. implementation for \s-1HLS\s0 segmentation.
  1927. .PP
  1928. \fIOptions\fR
  1929. .IX Subsection "Options"
  1930. .PP
  1931. The segment muxer supports the following options:
  1932. .IP "\fBreference_stream\fR \fIspecifier\fR" 4
  1933. .IX Item "reference_stream specifier"
  1934. Set the reference stream, as specified by the string \fIspecifier\fR.
  1935. If \fIspecifier\fR is set to \f(CW\*(C`auto\*(C'\fR, the reference is chosen
  1936. automatically. Otherwise it must be a stream specifier (see the ``Stream
  1937. specifiers'' chapter in the ffmpeg manual) which specifies the
  1938. reference stream. The default value is \f(CW\*(C`auto\*(C'\fR.
  1939. .IP "\fBsegment_format\fR \fIformat\fR" 4
  1940. .IX Item "segment_format format"
  1941. Override the inner container format, by default it is guessed by the filename
  1942. extension.
  1943. .IP "\fBsegment_format_options\fR \fIoptions_list\fR" 4
  1944. .IX Item "segment_format_options options_list"
  1945. Set output format options using a :\-separated list of key=value
  1946. parameters. Values containing the \f(CW\*(C`:\*(C'\fR special character must be
  1947. escaped.
  1948. .IP "\fBsegment_list\fR \fIname\fR" 4
  1949. .IX Item "segment_list name"
  1950. Generate also a listfile named \fIname\fR. If not specified no
  1951. listfile is generated.
  1952. .IP "\fBsegment_list_flags\fR \fIflags\fR" 4
  1953. .IX Item "segment_list_flags flags"
  1954. Set flags affecting the segment list generation.
  1955. .Sp
  1956. It currently supports the following flags:
  1957. .RS 4
  1958. .IP "\fBcache\fR" 4
  1959. .IX Item "cache"
  1960. Allow caching (only affects M3U8 list files).
  1961. .IP "\fBlive\fR" 4
  1962. .IX Item "live"
  1963. Allow live-friendly file generation.
  1964. .RE
  1965. .RS 4
  1966. .RE
  1967. .IP "\fBsegment_list_size\fR \fIsize\fR" 4
  1968. .IX Item "segment_list_size size"
  1969. Update the list file so that it contains at most \fIsize\fR
  1970. segments. If 0 the list file will contain all the segments. Default
  1971. value is 0.
  1972. .IP "\fBsegment_list_entry_prefix\fR \fIprefix\fR" 4
  1973. .IX Item "segment_list_entry_prefix prefix"
  1974. Prepend \fIprefix\fR to each entry. Useful to generate absolute paths.
  1975. By default no prefix is applied.
  1976. .IP "\fBsegment_list_type\fR \fItype\fR" 4
  1977. .IX Item "segment_list_type type"
  1978. Select the listing format.
  1979. .Sp
  1980. The following values are recognized:
  1981. .RS 4
  1982. .IP "\fBflat\fR" 4
  1983. .IX Item "flat"
  1984. Generate a flat list for the created segments, one segment per line.
  1985. .IP "\fBcsv, ext\fR" 4
  1986. .IX Item "csv, ext"
  1987. Generate a list for the created segments, one segment per line,
  1988. each line matching the format (comma\-separated values):
  1989. .Sp
  1990. .Vb 1
  1991. \&        <segment_filename>,<segment_start_time>,<segment_end_time>
  1992. .Ve
  1993. .Sp
  1994. \&\fIsegment_filename\fR is the name of the output file generated by the
  1995. muxer according to the provided pattern. \s-1CSV\s0 escaping (according to
  1996. \&\s-1RFC4180\s0) is applied if required.
  1997. .Sp
  1998. \&\fIsegment_start_time\fR and \fIsegment_end_time\fR specify
  1999. the segment start and end time expressed in seconds.
  2000. .Sp
  2001. A list file with the suffix \f(CW".csv"\fR or \f(CW".ext"\fR will
  2002. auto-select this format.
  2003. .Sp
  2004. \&\fBext\fR is deprecated in favor or \fBcsv\fR.
  2005. .IP "\fBffconcat\fR" 4
  2006. .IX Item "ffconcat"
  2007. Generate an ffconcat file for the created segments. The resulting file
  2008. can be read using the FFmpeg \fBconcat\fR demuxer.
  2009. .Sp
  2010. A list file with the suffix \f(CW".ffcat"\fR or \f(CW".ffconcat"\fR will
  2011. auto-select this format.
  2012. .IP "\fBm3u8\fR" 4
  2013. .IX Item "m3u8"
  2014. Generate an extended M3U8 file, version 3, compliant with
  2015. <\fBhttp://tools.ietf.org/id/draft\-pantos\-http\-live\-streaming\fR>.
  2016. .Sp
  2017. A list file with the suffix \f(CW".m3u8"\fR will auto-select this format.
  2018. .RE
  2019. .RS 4
  2020. .Sp
  2021. If not specified the type is guessed from the list file name suffix.
  2022. .RE
  2023. .IP "\fBsegment_time\fR \fItime\fR" 4
  2024. .IX Item "segment_time time"
  2025. Set segment duration to \fItime\fR, the value must be a duration
  2026. specification. Default value is \*(L"2\*(R". See also the
  2027. \&\fBsegment_times\fR option.
  2028. .Sp
  2029. Note that splitting may not be accurate, unless you force the
  2030. reference stream key-frames at the given time. See the introductory
  2031. notice and the examples below.
  2032. .IP "\fBsegment_atclocktime\fR \fI1|0\fR" 4
  2033. .IX Item "segment_atclocktime 1|0"
  2034. If set to \*(L"1\*(R" split at regular clock time intervals starting from 00:00
  2035. o'clock. The \fItime\fR value specified in \fBsegment_time\fR is
  2036. used for setting the length of the splitting interval.
  2037. .Sp
  2038. For example with \fBsegment_time\fR set to \*(L"900\*(R" this makes it possible
  2039. to create files at 12:00 o'clock, 12:15, 12:30, etc.
  2040. .Sp
  2041. Default value is \*(L"0\*(R".
  2042. .IP "\fBsegment_time_delta\fR \fIdelta\fR" 4
  2043. .IX Item "segment_time_delta delta"
  2044. Specify the accuracy time when selecting the start time for a
  2045. segment, expressed as a duration specification. Default value is \*(L"0\*(R".
  2046. .Sp
  2047. When delta is specified a key-frame will start a new segment if its
  2048. \&\s-1PTS\s0 satisfies the relation:
  2049. .Sp
  2050. .Vb 1
  2051. \&        PTS >= start_time - time_delta
  2052. .Ve
  2053. .Sp
  2054. This option is useful when splitting video content, which is always
  2055. split at \s-1GOP\s0 boundaries, in case a key frame is found just before the
  2056. specified split time.
  2057. .Sp
  2058. In particular may be used in combination with the \fIffmpeg\fR option
  2059. \&\fIforce_key_frames\fR. The key frame times specified by
  2060. \&\fIforce_key_frames\fR may not be set accurately because of rounding
  2061. issues, with the consequence that a key frame time may result set just
  2062. before the specified time. For constant frame rate videos a value of
  2063. 1/(2*\fIframe_rate\fR) should address the worst case mismatch between
  2064. the specified time and the time set by \fIforce_key_frames\fR.
  2065. .IP "\fBsegment_times\fR \fItimes\fR" 4
  2066. .IX Item "segment_times times"
  2067. Specify a list of split points. \fItimes\fR contains a list of comma
  2068. separated duration specifications, in increasing order. See also
  2069. the \fBsegment_time\fR option.
  2070. .IP "\fBsegment_frames\fR \fIframes\fR" 4
  2071. .IX Item "segment_frames frames"
  2072. Specify a list of split video frame numbers. \fIframes\fR contains a
  2073. list of comma separated integer numbers, in increasing order.
  2074. .Sp
  2075. This option specifies to start a new segment whenever a reference
  2076. stream key frame is found and the sequential number (starting from 0)
  2077. of the frame is greater or equal to the next value in the list.
  2078. .IP "\fBsegment_wrap\fR \fIlimit\fR" 4
  2079. .IX Item "segment_wrap limit"
  2080. Wrap around segment index once it reaches \fIlimit\fR.
  2081. .IP "\fBsegment_start_number\fR \fInumber\fR" 4
  2082. .IX Item "segment_start_number number"
  2083. Set the sequence number of the first segment. Defaults to \f(CW0\fR.
  2084. .IP "\fBstrftime\fR \fI1|0\fR" 4
  2085. .IX Item "strftime 1|0"
  2086. Use the \f(CW\*(C`strftime\*(C'\fR function to define the name of the new
  2087. segments to write. If this is selected, the output segment name must
  2088. contain a \f(CW\*(C`strftime\*(C'\fR function template. Default value is
  2089. \&\f(CW0\fR.
  2090. .IP "\fBbreak_non_keyframes\fR \fI1|0\fR" 4
  2091. .IX Item "break_non_keyframes 1|0"
  2092. If enabled, allow segments to start on frames other than keyframes. This
  2093. improves behavior on some players when the time between keyframes is
  2094. inconsistent, but may make things worse on others, and can cause some oddities
  2095. during seeking. Defaults to \f(CW0\fR.
  2096. .IP "\fBreset_timestamps\fR \fI1|0\fR" 4
  2097. .IX Item "reset_timestamps 1|0"
  2098. Reset timestamps at the begin of each segment, so that each segment
  2099. will start with near-zero timestamps. It is meant to ease the playback
  2100. of the generated segments. May not work with some combinations of
  2101. muxers/codecs. It is set to \f(CW0\fR by default.
  2102. .IP "\fBinitial_offset\fR \fIoffset\fR" 4
  2103. .IX Item "initial_offset offset"
  2104. Specify timestamp offset to apply to the output packet timestamps. The
  2105. argument must be a time duration specification, and defaults to 0.
  2106. .PP
  2107. \fIExamples\fR
  2108. .IX Subsection "Examples"
  2109. .IP "\(bu" 4
  2110. Remux the content of file \fIin.mkv\fR to a list of segments
  2111. \&\fIout\-000.nut\fR, \fIout\-001.nut\fR, etc., and write the list of
  2112. generated segments to \fIout.list\fR:
  2113. .Sp
  2114. .Vb 1
  2115. \&        ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.list out%03d.nut
  2116. .Ve
  2117. .IP "\(bu" 4
  2118. Segment input and set output format options for the output segments:
  2119. .Sp
  2120. .Vb 1
  2121. \&        ffmpeg -i in.mkv -f segment -segment_time 10 -segment_format_options movflags=+faststart out%03d.mp4
  2122. .Ve
  2123. .IP "\(bu" 4
  2124. Segment the input file according to the split points specified by the
  2125. \&\fIsegment_times\fR option:
  2126. .Sp
  2127. .Vb 1
  2128. \&        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
  2129. .Ve
  2130. .IP "\(bu" 4
  2131. Use the \fBffmpeg\fR \fBforce_key_frames\fR
  2132. option to force key frames in the input at the specified location, together
  2133. with the segment option \fBsegment_time_delta\fR to account for
  2134. possible roundings operated when setting key frame times.
  2135. .Sp
  2136. .Vb 2
  2137. \&        ffmpeg -i in.mkv -force_key_frames 1,2,3,5,8,13,21 -codec:v mpeg4 -codec:a pcm_s16le -map 0 \e
  2138. \&        -f segment -segment_list out.csv -segment_times 1,2,3,5,8,13,21 -segment_time_delta 0.05 out%03d.nut
  2139. .Ve
  2140. .Sp
  2141. In order to force key frames on the input file, transcoding is
  2142. required.
  2143. .IP "\(bu" 4
  2144. Segment the input file by splitting the input file according to the
  2145. frame numbers sequence specified with the \fBsegment_frames\fR option:
  2146. .Sp
  2147. .Vb 1
  2148. \&        ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.csv -segment_frames 100,200,300,500,800 out%03d.nut
  2149. .Ve
  2150. .IP "\(bu" 4
  2151. Convert the \fIin.mkv\fR to \s-1TS\s0 segments using the \f(CW\*(C`libx264\*(C'\fR
  2152. and \f(CW\*(C`libfaac\*(C'\fR encoders:
  2153. .Sp
  2154. .Vb 1
  2155. \&        ffmpeg -i in.mkv -map 0 -codec:v libx264 -codec:a libfaac -f ssegment -segment_list out.list out%03d.ts
  2156. .Ve
  2157. .IP "\(bu" 4
  2158. Segment the input file, and create an M3U8 live playlist (can be used
  2159. as live \s-1HLS\s0 source):
  2160. .Sp
  2161. .Vb 2
  2162. \&        ffmpeg -re -i in.mkv -codec copy -map 0 -f segment -segment_list playlist.m3u8 \e
  2163. \&        -segment_list_flags +live -segment_time 10 out%03d.mkv
  2164. .Ve
  2165. .Sh "smoothstreaming"
  2166. .IX Subsection "smoothstreaming"
  2167. Smooth Streaming muxer generates a set of files (Manifest, chunks) suitable for serving with conventional web server.
  2168. .IP "\fBwindow_size\fR" 4
  2169. .IX Item "window_size"
  2170. Specify the number of fragments kept in the manifest. Default 0 (keep all).
  2171. .IP "\fBextra_window_size\fR" 4
  2172. .IX Item "extra_window_size"
  2173. Specify the number of fragments kept outside of the manifest before removing from disk. Default 5.
  2174. .IP "\fBlookahead_count\fR" 4
  2175. .IX Item "lookahead_count"
  2176. Specify the number of lookahead fragments. Default 2.
  2177. .IP "\fBmin_frag_duration\fR" 4
  2178. .IX Item "min_frag_duration"
  2179. Specify the minimum fragment duration (in microseconds). Default 5000000.
  2180. .IP "\fBremove_at_exit\fR" 4
  2181. .IX Item "remove_at_exit"
  2182. Specify whether to remove all fragments when finished. Default 0 (do not remove).
  2183. .Sh "tee"
  2184. .IX Subsection "tee"
  2185. The tee muxer can be used to write the same data to several files or any
  2186. other kind of muxer. It can be used, for example, to both stream a video to
  2187. the network and save it to disk at the same time.
  2188. .PP
  2189. It is different from specifying several outputs to the \fBffmpeg\fR
  2190. command-line tool because the audio and video data will be encoded only once
  2191. with the tee muxer; encoding can be a very expensive process. It is not
  2192. useful when using the libavformat \s-1API\s0 directly because it is then possible
  2193. to feed the same packets to several muxers directly.
  2194. .PP
  2195. The slave outputs are specified in the file name given to the muxer,
  2196. separated by '|'. If any of the slave name contains the '|' separator,
  2197. leading or trailing spaces or any special character, it must be
  2198. escaped (see \fBthe \*(L"Quoting and escaping\*(R"
  2199. section in the \f(BIffmpeg\-utils\fB\|(1) manual\fR).
  2200. .PP
  2201. Muxer options can be specified for each slave by prepending them as a list of
  2202. \&\fIkey\fR=\fIvalue\fR pairs separated by ':', between square brackets. If
  2203. the options values contain a special character or the ':' separator, they
  2204. must be escaped; note that this is a second level escaping.
  2205. .PP
  2206. The following special options are also recognized:
  2207. .IP "\fBf\fR" 4
  2208. .IX Item "f"
  2209. Specify the format name. Useful if it cannot be guessed from the
  2210. output name suffix.
  2211. .IP "\fBbsfs[/\fR\fIspec\fR\fB]\fR" 4
  2212. .IX Item "bsfs[/spec]"
  2213. Specify a list of bitstream filters to apply to the specified
  2214. output.
  2215. .Sp
  2216. It is possible to specify to which streams a given bitstream filter
  2217. applies, by appending a stream specifier to the option separated by
  2218. \&\f(CW\*(C`/\*(C'\fR. \fIspec\fR must be a stream specifier (see \fBFormat
  2219. stream specifiers\fR).  If the stream specifier is not specified, the
  2220. bitstream filters will be applied to all streams in the output.
  2221. .Sp
  2222. Several bitstream filters can be specified, separated by \*(L",\*(R".
  2223. .IP "\fBselect\fR" 4
  2224. .IX Item "select"
  2225. Select the streams that should be mapped to the slave output,
  2226. specified by a stream specifier. If not specified, this defaults to
  2227. all the input streams.
  2228. .PP
  2229. \fIExamples\fR
  2230. .IX Subsection "Examples"
  2231. .IP "\(bu" 4
  2232. Encode something and both archive it in a WebM file and stream it
  2233. as MPEG-TS over \s-1UDP\s0 (the streams need to be explicitly mapped):
  2234. .Sp
  2235. .Vb 2
  2236. \&        ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
  2237. \&          "archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/"
  2238. .Ve
  2239. .IP "\(bu" 4
  2240. Use \fBffmpeg\fR to encode the input, and send the output
  2241. to three different destinations. The \f(CW\*(C`dump_extra\*(C'\fR bitstream
  2242. filter is used to add extradata information to all the output video
  2243. keyframes packets, as requested by the MPEG-TS format. The select
  2244. option is applied to \fIout.aac\fR in order to make it contain only
  2245. audio packets.
  2246. .Sp
  2247. .Vb 2
  2248. \&        ffmpeg -i ... -map 0 -flags +global_header -c:v libx264 -c:a aac -strict experimental
  2249. \&               -f tee "[bsfs/v=dump_extra]out.ts|[movflags=+faststart]out.mp4|[select=a]out.aac"
  2250. .Ve
  2251. .IP "\(bu" 4
  2252. As below, but select only stream \f(CW\*(C`a:1\*(C'\fR for the audio output. Note
  2253. that a second level escaping must be performed, as \*(L":\*(R" is a special
  2254. character used to separate options.
  2255. .Sp
  2256. .Vb 2
  2257. \&        ffmpeg -i ... -map 0 -flags +global_header -c:v libx264 -c:a aac -strict experimental
  2258. \&               -f tee "[bsfs/v=dump_extra]out.ts|[movflags=+faststart]out.mp4|[select=\e'a:1\e']out.aac"
  2259. .Ve
  2260. .PP
  2261. Note: some codecs may need different options depending on the output format;
  2262. the auto-detection of this can not work with the tee muxer. The main example
  2263. is the \fBglobal_header\fR flag.
  2264. .Sh "webm_dash_manifest"
  2265. .IX Subsection "webm_dash_manifest"
  2266. WebM \s-1DASH\s0 Manifest muxer.
  2267. .PP
  2268. This muxer implements the WebM \s-1DASH\s0 Manifest specification to generate the \s-1DASH\s0
  2269. manifest \s-1XML\s0. It also supports manifest generation for \s-1DASH\s0 live streams.
  2270. .PP
  2271. For more information see:
  2272. .IP "\(bu" 4
  2273. WebM \s-1DASH\s0 Specification: <\fBhttps://sites.google.com/a/webmproject.org/wiki/adaptive\-streaming/webm\-dash\-specification\fR>
  2274. .IP "\(bu" 4
  2275. \&\s-1ISO\s0 \s-1DASH\s0 Specification: <\fBhttp://standards.iso.org/ittf/PubliclyAvailableStandards/c065274_ISO_IEC_23009\-1_2014.zip\fR>
  2276. .PP
  2277. \fIOptions\fR
  2278. .IX Subsection "Options"
  2279. .PP
  2280. This muxer supports the following options:
  2281. .IP "\fBadaptation_sets\fR" 4
  2282. .IX Item "adaptation_sets"
  2283. This option has the following syntax: \*(L"id=x,streams=a,b,c id=y,streams=d,e\*(R" where x and y are the
  2284. unique identifiers of the adaptation sets and a,b,c,d and e are the indices of the corresponding
  2285. audio and video streams. Any number of adaptation sets can be added using this option.
  2286. .IP "\fBlive\fR" 4
  2287. .IX Item "live"
  2288. Set this to 1 to create a live stream \s-1DASH\s0 Manifest. Default: 0.
  2289. .IP "\fBchunk_start_index\fR" 4
  2290. .IX Item "chunk_start_index"
  2291. Start index of the first chunk. This will go in the \fBstartNumber\fR attribute
  2292. of the \fBSegmentTemplate\fR element in the manifest. Default: 0.
  2293. .IP "\fBchunk_duration_ms\fR" 4
  2294. .IX Item "chunk_duration_ms"
  2295. Duration of each chunk in milliseconds. This will go in the \fBduration\fR
  2296. attribute of the \fBSegmentTemplate\fR element in the manifest. Default: 1000.
  2297. .IP "\fButc_timing_url\fR" 4
  2298. .IX Item "utc_timing_url"
  2299. \&\s-1URL\s0 of the page that will return the \s-1UTC\s0 timestamp in \s-1ISO\s0 format. This will go
  2300. in the \fBvalue\fR attribute of the \fBUTCTiming\fR element in the manifest.
  2301. Default: None.
  2302. .IP "\fBtime_shift_buffer_depth\fR" 4
  2303. .IX Item "time_shift_buffer_depth"
  2304. Smallest time (in seconds) shifting buffer for which any Representation is
  2305. guaranteed to be available. This will go in the \fBtimeShiftBufferDepth\fR
  2306. attribute of the \fB\s-1MPD\s0\fR element. Default: 60.
  2307. .IP "\fBminimum_update_period\fR" 4
  2308. .IX Item "minimum_update_period"
  2309. Minimum update period (in seconds) of the manifest. This will go in the
  2310. \&\fBminimumUpdatePeriod\fR attribute of the \fB\s-1MPD\s0\fR element. Default: 0.
  2311. .PP
  2312. \fIExample\fR
  2313. .IX Subsection "Example"
  2314. .PP
  2315. .Vb 9
  2316. \&        ffmpeg -f webm_dash_manifest -i video1.webm \e
  2317. \&               -f webm_dash_manifest -i video2.webm \e
  2318. \&               -f webm_dash_manifest -i audio1.webm \e
  2319. \&               -f webm_dash_manifest -i audio2.webm \e
  2320. \&               -map 0 -map 1 -map 2 -map 3 \e
  2321. \&               -c copy \e
  2322. \&               -f webm_dash_manifest \e
  2323. \&               -adaptation_sets "id=0,streams=0,1 id=1,streams=2,3" \e
  2324. \&               manifest.xml
  2325. .Ve
  2326. .Sh "webm_chunk"
  2327. .IX Subsection "webm_chunk"
  2328. WebM Live Chunk Muxer.
  2329. .PP
  2330. This muxer writes out WebM headers and chunks as separate files which can be
  2331. consumed by clients that support WebM Live streams via \s-1DASH\s0.
  2332. .PP
  2333. \fIOptions\fR
  2334. .IX Subsection "Options"
  2335. .PP
  2336. This muxer supports the following options:
  2337. .IP "\fBchunk_start_index\fR" 4
  2338. .IX Item "chunk_start_index"
  2339. Index of the first chunk (defaults to 0).
  2340. .IP "\fBheader\fR" 4
  2341. .IX Item "header"
  2342. Filename of the header where the initialization data will be written.
  2343. .IP "\fBaudio_chunk_duration\fR" 4
  2344. .IX Item "audio_chunk_duration"
  2345. Duration of each audio chunk in milliseconds (defaults to 5000).
  2346. .PP
  2347. \fIExample\fR
  2348. .IX Subsection "Example"
  2349. .PP
  2350. .Vb 17
  2351. \&        ffmpeg -f v4l2 -i /dev/video0 \e
  2352. \&               -f alsa -i hw:0 \e
  2353. \&               -map 0:0 \e
  2354. \&               -c:v libvpx-vp9 \e
  2355. \&               -s 640x360 -keyint_min 30 -g 30 \e
  2356. \&               -f webm_chunk \e
  2357. \&               -header webm_live_video_360.hdr \e
  2358. \&               -chunk_start_index 1 \e
  2359. \&               webm_live_video_360_%d.chk \e
  2360. \&               -map 1:0 \e
  2361. \&               -c:a libvorbis \e
  2362. \&               -b:a 128k \e
  2363. \&               -f webm_chunk \e
  2364. \&               -header webm_live_audio_128.hdr \e
  2365. \&               -chunk_start_index 1 \e
  2366. \&               -audio_chunk_duration 1000 \e
  2367. \&               webm_live_audio_128_%d.chk
  2368. .Ve
  2369. .SH "METADATA"
  2370. .IX Header "METADATA"
  2371. FFmpeg is able to dump metadata from media files into a simple UTF\-8\-encoded
  2372. INI-like text file and then load it back using the metadata muxer/demuxer.
  2373. .PP
  2374. The file format is as follows:
  2375. .IP "1." 4
  2376. A file consists of a header and a number of metadata tags divided into sections,
  2377. each on its own line.
  2378. .IP "2." 4
  2379. The header is a \fB;FFMETADATA\fR string, followed by a version number (now 1).
  2380. .IP "3." 4
  2381. Metadata tags are of the form \fBkey=value\fR
  2382. .IP "4." 4
  2383. Immediately after header follows global metadata
  2384. .IP "5." 4
  2385. After global metadata there may be sections with per\-stream/per\-chapter
  2386. metadata.
  2387. .IP "6." 4
  2388. A section starts with the section name in uppercase (i.e. \s-1STREAM\s0 or \s-1CHAPTER\s0) in
  2389. brackets (\fB[\fR, \fB]\fR) and ends with next section or end of file.
  2390. .IP "7." 4
  2391. At the beginning of a chapter section there may be an optional timebase to be
  2392. used for start/end values. It must be in form
  2393. \&\fBTIMEBASE=\fR\fInum\fR\fB/\fR\fIden\fR, where \fInum\fR and \fIden\fR are
  2394. integers. If the timebase is missing then start/end times are assumed to
  2395. be in milliseconds.
  2396. .Sp
  2397. Next a chapter section must contain chapter start and end times in form
  2398. \&\fBSTART=\fR\fInum\fR, \fBEND=\fR\fInum\fR, where \fInum\fR is a positive
  2399. integer.
  2400. .IP "8." 4
  2401. Empty lines and lines starting with \fB;\fR or \fB#\fR are ignored.
  2402. .IP "9." 4
  2403. Metadata keys or values containing special characters (\fB=\fR, \fB;\fR,
  2404. \&\fB#\fR, \fB\e\fR and a newline) must be escaped with a backslash \fB\e\fR.
  2405. .IP "10." 4
  2406. .IX Item "10."
  2407. Note that whitespace in metadata (e.g. \fBfoo = bar\fR) is considered to be
  2408. a part of the tag (in the example above key is \fBfoo\fR , value is
  2409.  \fBbar\fR).
  2410. .PP
  2411. A ffmetadata file might look like this:
  2412. .PP
  2413. .Vb 4
  2414. \&        ;FFMETADATA1
  2415. \&        title=bike\e\eshed
  2416. \&        ;this is a comment
  2417. \&        artist=FFmpeg troll team
  2418. .Ve
  2419. .PP
  2420. .Vb 9
  2421. \&        [CHAPTER]
  2422. \&        TIMEBASE=1/1000
  2423. \&        START=0
  2424. \&        #chapter ends at 0:01:00
  2425. \&        END=60000
  2426. \&        title=chapter \e#1
  2427. \&        [STREAM]
  2428. \&        title=multi\e
  2429. \&        line
  2430. .Ve
  2431. .PP
  2432. By using the ffmetadata muxer and demuxer it is possible to extract
  2433. metadata from an input file to an ffmetadata file, and then transcode
  2434. the file into an output file with the edited ffmetadata file.
  2435. .PP
  2436. Extracting an ffmetadata file with \fIffmpeg\fR goes as follows:
  2437. .PP
  2438. .Vb 1
  2439. \&        ffmpeg -i INPUT -f ffmetadata FFMETADATAFILE
  2440. .Ve
  2441. .PP
  2442. Reinserting edited metadata information from the \s-1FFMETADATAFILE\s0 file can
  2443. be done as:
  2444. .PP
  2445. .Vb 1
  2446. \&        ffmpeg -i INPUT -i FFMETADATAFILE -map_metadata 1 -codec copy OUTPUT
  2447. .Ve
  2448. .SH "SEE ALSO"
  2449. .IX Header "SEE ALSO"
  2450. \&\fIffmpeg\fR\|(1), \fIffplay\fR\|(1), \fIffprobe\fR\|(1), \fIffserver\fR\|(1), \fIlibavformat\fR\|(3)
  2451. .SH "AUTHORS"
  2452. .IX Header "AUTHORS"
  2453. The FFmpeg developers.
  2454. .PP
  2455. For details about the authorship, see the Git history of the project
  2456. (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
  2457. \&\fBgit log\fR in the FFmpeg source directory, or browsing the
  2458. online repository at <\fBhttp://source.ffmpeg.org\fR>.
  2459. .PP
  2460. Maintainers for the specific components are listed in the file
  2461. \&\fI\s-1MAINTAINERS\s0\fR in the source code tree.
  2462.