You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4886 lines
225KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Created by GNU Texinfo 6.8, https://www.gnu.org/software/texinfo/ -->
  4. <head>
  5. <meta charset="utf-8">
  6. <title>
  7. FFmpeg Formats Documentation
  8. </title>
  9. <meta name="viewport" content="width=device-width,initial-scale=1.0">
  10. <link rel="stylesheet" type="text/css" href="bootstrap.min.css">
  11. <link rel="stylesheet" type="text/css" href="style.min.css">
  12. </head>
  13. <body>
  14. <div class="container">
  15. <h1>
  16. FFmpeg Formats Documentation
  17. </h1>
  18. <div align="center">
  19. </div>
  20. <a name="SEC_Top"></a>
  21. <div class="Contents_element" id="SEC_Contents">
  22. <h2 class="contents-heading">Table of Contents</h2>
  23. <div class="contents">
  24. <ul class="no-bullet">
  25. <li><a id="toc-Description" href="#Description">1 Description</a></li>
  26. <li><a id="toc-Format-Options" href="#Format-Options">2 Format Options</a>
  27. <ul class="no-bullet">
  28. <li><a id="toc-Format-stream-specifiers-1" href="#Format-stream-specifiers-1">2.1 Format stream specifiers</a></li>
  29. </ul></li>
  30. <li><a id="toc-Demuxers" href="#Demuxers">3 Demuxers</a>
  31. <ul class="no-bullet">
  32. <li><a id="toc-aa" href="#aa">3.1 aa</a></li>
  33. <li><a id="toc-aac" href="#aac">3.2 aac</a></li>
  34. <li><a id="toc-apng" href="#apng">3.3 apng</a></li>
  35. <li><a id="toc-asf-1" href="#asf-1">3.4 asf</a></li>
  36. <li><a id="toc-concat-1" href="#concat-1">3.5 concat</a>
  37. <ul class="no-bullet">
  38. <li><a id="toc-Syntax" href="#Syntax">3.5.1 Syntax</a></li>
  39. <li><a id="toc-Options" href="#Options">3.5.2 Options</a></li>
  40. <li><a id="toc-Examples" href="#Examples">3.5.3 Examples</a></li>
  41. </ul></li>
  42. <li><a id="toc-dash-1" href="#dash-1">3.6 dash</a>
  43. <ul class="no-bullet">
  44. <li><a id="toc-Options-1" href="#Options-1">3.6.1 Options</a></li>
  45. </ul></li>
  46. <li><a id="toc-ea" href="#ea">3.7 ea</a>
  47. <ul class="no-bullet">
  48. <li><a id="toc-Options-2" href="#Options-2">3.7.1 Options</a></li>
  49. </ul></li>
  50. <li><a id="toc-imf" href="#imf">3.8 imf</a></li>
  51. <li><a id="toc-flv_002c-live_005fflv_002c-kux" href="#flv_002c-live_005fflv_002c-kux">3.9 flv, live_flv, kux</a></li>
  52. <li><a id="toc-gif-1" href="#gif-1">3.10 gif</a></li>
  53. <li><a id="toc-hls-1" href="#hls-1">3.11 hls</a></li>
  54. <li><a id="toc-image2-1" href="#image2-1">3.12 image2</a>
  55. <ul class="no-bullet">
  56. <li><a id="toc-Examples-1" href="#Examples-1">3.12.1 Examples</a></li>
  57. </ul></li>
  58. <li><a id="toc-libgme" href="#libgme">3.13 libgme</a></li>
  59. <li><a id="toc-libmodplug" href="#libmodplug">3.14 libmodplug</a></li>
  60. <li><a id="toc-libopenmpt" href="#libopenmpt">3.15 libopenmpt</a></li>
  61. <li><a id="toc-mov_002fmp4_002f3gp" href="#mov_002fmp4_002f3gp">3.16 mov/mp4/3gp</a>
  62. <ul class="no-bullet">
  63. <li><a id="toc-Options-3" href="#Options-3">3.16.1 Options</a></li>
  64. <li><a id="toc-Audible-AAX" href="#Audible-AAX">3.16.2 Audible AAX</a></li>
  65. </ul></li>
  66. <li><a id="toc-mpegts" href="#mpegts">3.17 mpegts</a></li>
  67. <li><a id="toc-mpjpeg" href="#mpjpeg">3.18 mpjpeg</a></li>
  68. <li><a id="toc-rawvideo" href="#rawvideo">3.19 rawvideo</a></li>
  69. <li><a id="toc-sbg" href="#sbg">3.20 sbg</a></li>
  70. <li><a id="toc-tedcaptions" href="#tedcaptions">3.21 tedcaptions</a></li>
  71. <li><a id="toc-vapoursynth" href="#vapoursynth">3.22 vapoursynth</a></li>
  72. </ul></li>
  73. <li><a id="toc-Muxers" href="#Muxers">4 Muxers</a>
  74. <ul class="no-bullet">
  75. <li><a id="toc-a64-1" href="#a64-1">4.1 a64</a></li>
  76. <li><a id="toc-adts-1" href="#adts-1">4.2 adts</a>
  77. <ul class="no-bullet">
  78. <li><a id="toc-Options-4" href="#Options-4">4.2.1 Options</a></li>
  79. </ul></li>
  80. <li><a id="toc-aiff-1" href="#aiff-1">4.3 aiff</a>
  81. <ul class="no-bullet">
  82. <li><a id="toc-Options-5" href="#Options-5">4.3.1 Options</a></li>
  83. </ul></li>
  84. <li><a id="toc-alp-1" href="#alp-1">4.4 alp</a>
  85. <ul class="no-bullet">
  86. <li><a id="toc-Options-6" href="#Options-6">4.4.1 Options</a></li>
  87. </ul></li>
  88. <li><a id="toc-asf-2" href="#asf-2">4.5 asf</a>
  89. <ul class="no-bullet">
  90. <li><a id="toc-Options-7" href="#Options-7">4.5.1 Options</a></li>
  91. </ul></li>
  92. <li><a id="toc-avi-1" href="#avi-1">4.6 avi</a>
  93. <ul class="no-bullet">
  94. <li><a id="toc-Options-8" href="#Options-8">4.6.1 Options</a></li>
  95. </ul></li>
  96. <li><a id="toc-chromaprint-1" href="#chromaprint-1">4.7 chromaprint</a>
  97. <ul class="no-bullet">
  98. <li><a id="toc-Options-9" href="#Options-9">4.7.1 Options</a></li>
  99. </ul></li>
  100. <li><a id="toc-crc-1" href="#crc-1">4.8 crc</a>
  101. <ul class="no-bullet">
  102. <li><a id="toc-Examples-2" href="#Examples-2">4.8.1 Examples</a></li>
  103. </ul></li>
  104. <li><a id="toc-dash-2" href="#dash-2">4.9 dash</a></li>
  105. <li><a id="toc-fifo-1" href="#fifo-1">4.10 fifo</a>
  106. <ul class="no-bullet">
  107. <li><a id="toc-Examples-3" href="#Examples-3">4.10.1 Examples</a></li>
  108. </ul></li>
  109. <li><a id="toc-flv" href="#flv">4.11 flv</a></li>
  110. <li><a id="toc-framecrc-1" href="#framecrc-1">4.12 framecrc</a>
  111. <ul class="no-bullet">
  112. <li><a id="toc-Examples-4" href="#Examples-4">4.12.1 Examples</a></li>
  113. </ul></li>
  114. <li><a id="toc-framehash-1" href="#framehash-1">4.13 framehash</a>
  115. <ul class="no-bullet">
  116. <li><a id="toc-Examples-5" href="#Examples-5">4.13.1 Examples</a></li>
  117. </ul></li>
  118. <li><a id="toc-framemd5-1" href="#framemd5-1">4.14 framemd5</a>
  119. <ul class="no-bullet">
  120. <li><a id="toc-Examples-6" href="#Examples-6">4.14.1 Examples</a></li>
  121. </ul></li>
  122. <li><a id="toc-gif-2" href="#gif-2">4.15 gif</a></li>
  123. <li><a id="toc-hash-1" href="#hash-1">4.16 hash</a>
  124. <ul class="no-bullet">
  125. <li><a id="toc-Examples-7" href="#Examples-7">4.16.1 Examples</a></li>
  126. </ul></li>
  127. <li><a id="toc-hls-2" href="#hls-2">4.17 hls</a>
  128. <ul class="no-bullet">
  129. <li><a id="toc-Options-10" href="#Options-10">4.17.1 Options</a></li>
  130. </ul></li>
  131. <li><a id="toc-ico-1" href="#ico-1">4.18 ico</a></li>
  132. <li><a id="toc-image2-2" href="#image2-2">4.19 image2</a>
  133. <ul class="no-bullet">
  134. <li><a id="toc-Options-11" href="#Options-11">4.19.1 Options</a></li>
  135. <li><a id="toc-Examples-8" href="#Examples-8">4.19.2 Examples</a></li>
  136. </ul></li>
  137. <li><a id="toc-matroska" href="#matroska">4.20 matroska</a>
  138. <ul class="no-bullet">
  139. <li><a id="toc-Metadata" href="#Metadata">4.20.1 Metadata</a></li>
  140. <li><a id="toc-Options-12" href="#Options-12">4.20.2 Options</a></li>
  141. </ul></li>
  142. <li><a id="toc-md5-1" href="#md5-1">4.21 md5</a>
  143. <ul class="no-bullet">
  144. <li><a id="toc-Examples-9" href="#Examples-9">4.21.1 Examples</a></li>
  145. </ul></li>
  146. <li><a id="toc-mov_002c-mp4_002c-ismv" href="#mov_002c-mp4_002c-ismv">4.22 mov, mp4, ismv</a>
  147. <ul class="no-bullet">
  148. <li><a id="toc-Options-13" href="#Options-13">4.22.1 Options</a></li>
  149. <li><a id="toc-Example" href="#Example">4.22.2 Example</a></li>
  150. </ul></li>
  151. <li><a id="toc-mp3" href="#mp3">4.23 mp3</a></li>
  152. <li><a id="toc-mpegts-1" href="#mpegts-1">4.24 mpegts</a>
  153. <ul class="no-bullet">
  154. <li><a id="toc-Options-14" href="#Options-14">4.24.1 Options</a></li>
  155. <li><a id="toc-Example-1" href="#Example-1">4.24.2 Example</a></li>
  156. </ul></li>
  157. <li><a id="toc-mxf_002c-mxf_005fd10_002c-mxf_005fopatom" href="#mxf_002c-mxf_005fd10_002c-mxf_005fopatom">4.25 mxf, mxf_d10, mxf_opatom</a>
  158. <ul class="no-bullet">
  159. <li><a id="toc-Options-15" href="#Options-15">4.25.1 Options</a></li>
  160. </ul></li>
  161. <li><a id="toc-null" href="#null">4.26 null</a></li>
  162. <li><a id="toc-nut" href="#nut">4.27 nut</a></li>
  163. <li><a id="toc-ogg" href="#ogg">4.28 ogg</a></li>
  164. <li><a id="toc-raw-muxers-1" href="#raw-muxers-1">4.29 raw muxers</a>
  165. <ul class="no-bullet">
  166. <li><a id="toc-ac3" href="#ac3">4.29.1 ac3</a></li>
  167. <li><a id="toc-adx" href="#adx">4.29.2 adx</a></li>
  168. <li><a id="toc-aptx" href="#aptx">4.29.3 aptx</a></li>
  169. <li><a id="toc-aptx_005fhd" href="#aptx_005fhd">4.29.4 aptx_hd</a></li>
  170. <li><a id="toc-avs2" href="#avs2">4.29.5 avs2</a></li>
  171. <li><a id="toc-cavsvideo" href="#cavsvideo">4.29.6 cavsvideo</a></li>
  172. <li><a id="toc-codec2raw" href="#codec2raw">4.29.7 codec2raw</a></li>
  173. <li><a id="toc-data" href="#data">4.29.8 data</a></li>
  174. <li><a id="toc-dirac" href="#dirac">4.29.9 dirac</a></li>
  175. <li><a id="toc-dnxhd" href="#dnxhd">4.29.10 dnxhd</a></li>
  176. <li><a id="toc-dts" href="#dts">4.29.11 dts</a></li>
  177. <li><a id="toc-eac3" href="#eac3">4.29.12 eac3</a></li>
  178. <li><a id="toc-g722" href="#g722">4.29.13 g722</a></li>
  179. <li><a id="toc-g723_005f1" href="#g723_005f1">4.29.14 g723_1</a></li>
  180. <li><a id="toc-g726" href="#g726">4.29.15 g726</a></li>
  181. <li><a id="toc-g726le" href="#g726le">4.29.16 g726le</a></li>
  182. <li><a id="toc-gsm" href="#gsm">4.29.17 gsm</a></li>
  183. <li><a id="toc-h261" href="#h261">4.29.18 h261</a></li>
  184. <li><a id="toc-h263" href="#h263">4.29.19 h263</a></li>
  185. <li><a id="toc-h264" href="#h264">4.29.20 h264</a></li>
  186. <li><a id="toc-hevc" href="#hevc">4.29.21 hevc</a></li>
  187. <li><a id="toc-m4v" href="#m4v">4.29.22 m4v</a></li>
  188. <li><a id="toc-mjpeg" href="#mjpeg">4.29.23 mjpeg</a></li>
  189. <li><a id="toc-mlp" href="#mlp">4.29.24 mlp</a></li>
  190. <li><a id="toc-mp2" href="#mp2">4.29.25 mp2</a></li>
  191. <li><a id="toc-mpeg1video" href="#mpeg1video">4.29.26 mpeg1video</a></li>
  192. <li><a id="toc-mpeg2video" href="#mpeg2video">4.29.27 mpeg2video</a></li>
  193. <li><a id="toc-obu" href="#obu">4.29.28 obu</a></li>
  194. <li><a id="toc-rawvideo-1" href="#rawvideo-1">4.29.29 rawvideo</a></li>
  195. <li><a id="toc-sbc" href="#sbc">4.29.30 sbc</a></li>
  196. <li><a id="toc-truehd" href="#truehd">4.29.31 truehd</a></li>
  197. <li><a id="toc-vc1" href="#vc1">4.29.32 vc1</a></li>
  198. </ul></li>
  199. <li><a id="toc-segment_002c-stream_005fsegment_002c-ssegment" href="#segment_002c-stream_005fsegment_002c-ssegment">4.30 segment, stream_segment, ssegment</a>
  200. <ul class="no-bullet">
  201. <li><a id="toc-Options-16" href="#Options-16">4.30.1 Options</a></li>
  202. <li><a id="toc-Examples-10" href="#Examples-10">4.30.2 Examples</a></li>
  203. </ul></li>
  204. <li><a id="toc-smoothstreaming" href="#smoothstreaming">4.31 smoothstreaming</a></li>
  205. <li><a id="toc-streamhash-1" href="#streamhash-1">4.32 streamhash</a>
  206. <ul class="no-bullet">
  207. <li><a id="toc-Examples-11" href="#Examples-11">4.32.1 Examples</a></li>
  208. </ul></li>
  209. <li><a id="toc-tee-1" href="#tee-1">4.33 tee</a>
  210. <ul class="no-bullet">
  211. <li><a id="toc-Options-17" href="#Options-17">4.33.1 Options</a></li>
  212. <li><a id="toc-Examples-12" href="#Examples-12">4.33.2 Examples</a></li>
  213. </ul></li>
  214. <li><a id="toc-webm_005fchunk" href="#webm_005fchunk">4.34 webm_chunk</a>
  215. <ul class="no-bullet">
  216. <li><a id="toc-Options-18" href="#Options-18">4.34.1 Options</a></li>
  217. <li><a id="toc-Example-2" href="#Example-2">4.34.2 Example</a></li>
  218. </ul></li>
  219. <li><a id="toc-webm_005fdash_005fmanifest" href="#webm_005fdash_005fmanifest">4.35 webm_dash_manifest</a>
  220. <ul class="no-bullet">
  221. <li><a id="toc-Options-19" href="#Options-19">4.35.1 Options</a></li>
  222. <li><a id="toc-Example-3" href="#Example-3">4.35.2 Example</a></li>
  223. </ul></li>
  224. </ul></li>
  225. <li><a id="toc-Metadata-1" href="#Metadata-1">5 Metadata</a></li>
  226. <li><a id="toc-See-Also" href="#See-Also">6 See Also</a></li>
  227. <li><a id="toc-Authors" href="#Authors">7 Authors</a></li>
  228. </ul>
  229. </div>
  230. </div>
  231. <a name="Description"></a>
  232. <h2 class="chapter">1 Description<span class="pull-right"><a class="anchor hidden-xs" href="#Description" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Description" aria-hidden="true">TOC</a></span></h2>
  233. <p>This document describes the supported formats (muxers and demuxers)
  234. provided by the libavformat library.
  235. </p>
  236. <a name="Format-Options"></a>
  237. <h2 class="chapter">2 Format Options<span class="pull-right"><a class="anchor hidden-xs" href="#Format-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Format-Options" aria-hidden="true">TOC</a></span></h2>
  238. <p>The libavformat library provides some generic global options, which
  239. can be set on all the muxers and demuxers. In addition each muxer or
  240. demuxer may support so-called private options, which are specific for
  241. that component.
  242. </p>
  243. <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
  244. FFmpeg tools, or by setting the value explicitly in the
  245. <code>AVFormatContext</code> options or using the <samp>libavutil/opt.h</samp> API
  246. for programmatic use.
  247. </p>
  248. <p>The list of supported options follows:
  249. </p>
  250. <dl compact="compact">
  251. <dt><span><samp>avioflags <var>flags</var> (<em>input/output</em>)</samp></span></dt>
  252. <dd><p>Possible values:
  253. </p><dl compact="compact">
  254. <dt><span>&lsquo;<samp>direct</samp>&rsquo;</span></dt>
  255. <dd><p>Reduce buffering.
  256. </p></dd>
  257. </dl>
  258. </dd>
  259. <dt><span><samp>probesize <var>integer</var> (<em>input</em>)</samp></span></dt>
  260. <dd><p>Set probing size in bytes, i.e. the size of the data to analyze to get
  261. stream information. A higher value will enable detecting more
  262. information in case it is dispersed into the stream, but will increase
  263. latency. Must be an integer not lesser than 32. It is 5000000 by default.
  264. </p>
  265. </dd>
  266. <dt><span><samp>max_probe_packets <var>integer</var> (<em>input</em>)</samp></span></dt>
  267. <dd><p>Set the maximum number of buffered packets when probing a codec.
  268. Default is 2500 packets.
  269. </p>
  270. </dd>
  271. <dt><span><samp>packetsize <var>integer</var> (<em>output</em>)</samp></span></dt>
  272. <dd><p>Set packet size.
  273. </p>
  274. </dd>
  275. <dt><span><samp>fflags <var>flags</var></samp></span></dt>
  276. <dd><p>Set format flags. Some are implemented for a limited number of formats.
  277. </p>
  278. <p>Possible values for input files:
  279. </p><dl compact="compact">
  280. <dt><span>&lsquo;<samp>discardcorrupt</samp>&rsquo;</span></dt>
  281. <dd><p>Discard corrupted packets.
  282. </p></dd>
  283. <dt><span>&lsquo;<samp>fastseek</samp>&rsquo;</span></dt>
  284. <dd><p>Enable fast, but inaccurate seeks for some formats.
  285. </p></dd>
  286. <dt><span>&lsquo;<samp>genpts</samp>&rsquo;</span></dt>
  287. <dd><p>Generate missing PTS if DTS is present.
  288. </p></dd>
  289. <dt><span>&lsquo;<samp>igndts</samp>&rsquo;</span></dt>
  290. <dd><p>Ignore DTS if PTS is set. Inert when nofillin is set.
  291. </p></dd>
  292. <dt><span>&lsquo;<samp>ignidx</samp>&rsquo;</span></dt>
  293. <dd><p>Ignore index.
  294. </p></dd>
  295. <dt><span>&lsquo;<samp>nobuffer</samp>&rsquo;</span></dt>
  296. <dd><p>Reduce the latency introduced by buffering during initial input streams analysis.
  297. </p></dd>
  298. <dt><span>&lsquo;<samp>nofillin</samp>&rsquo;</span></dt>
  299. <dd><p>Do not fill in missing values in packet fields that can be exactly calculated.
  300. </p></dd>
  301. <dt><span>&lsquo;<samp>noparse</samp>&rsquo;</span></dt>
  302. <dd><p>Disable AVParsers, this needs <code>+nofillin</code> too.
  303. </p></dd>
  304. <dt><span>&lsquo;<samp>sortdts</samp>&rsquo;</span></dt>
  305. <dd><p>Try to interleave output packets by DTS. At present, available only for AVIs with an index.
  306. </p></dd>
  307. </dl>
  308. <p>Possible values for output files:
  309. </p><dl compact="compact">
  310. <dt><span>&lsquo;<samp>autobsf</samp>&rsquo;</span></dt>
  311. <dd><p>Automatically apply bitstream filters as required by the output format. Enabled by default.
  312. </p></dd>
  313. <dt><span>&lsquo;<samp>bitexact</samp>&rsquo;</span></dt>
  314. <dd><p>Only write platform-, build- and time-independent data.
  315. This ensures that file and data checksums are reproducible and match between
  316. platforms. Its primary use is for regression testing.
  317. </p></dd>
  318. <dt><span>&lsquo;<samp>flush_packets</samp>&rsquo;</span></dt>
  319. <dd><p>Write out packets immediately.
  320. </p></dd>
  321. <dt><span>&lsquo;<samp>shortest</samp>&rsquo;</span></dt>
  322. <dd><p>Stop muxing at the end of the shortest stream.
  323. It may be needed to increase max_interleave_delta to avoid flushing the longer
  324. streams before EOF.
  325. </p></dd>
  326. </dl>
  327. </dd>
  328. <dt><span><samp>seek2any <var>integer</var> (<em>input</em>)</samp></span></dt>
  329. <dd><p>Allow seeking to non-keyframes on demuxer level when supported if set to 1.
  330. Default is 0.
  331. </p>
  332. </dd>
  333. <dt><span><samp>analyzeduration <var>integer</var> (<em>input</em>)</samp></span></dt>
  334. <dd><p>Specify how many microseconds are analyzed to probe the input. A
  335. higher value will enable detecting more accurate information, but will
  336. increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
  337. </p>
  338. </dd>
  339. <dt><span><samp>cryptokey <var>hexadecimal string</var> (<em>input</em>)</samp></span></dt>
  340. <dd><p>Set decryption key.
  341. </p>
  342. </dd>
  343. <dt><span><samp>indexmem <var>integer</var> (<em>input</em>)</samp></span></dt>
  344. <dd><p>Set max memory used for timestamp index (per stream).
  345. </p>
  346. </dd>
  347. <dt><span><samp>rtbufsize <var>integer</var> (<em>input</em>)</samp></span></dt>
  348. <dd><p>Set max memory used for buffering real-time frames.
  349. </p>
  350. </dd>
  351. <dt><span><samp>fdebug <var>flags</var> (<em>input/output</em>)</samp></span></dt>
  352. <dd><p>Print specific debug info.
  353. </p>
  354. <p>Possible values:
  355. </p><dl compact="compact">
  356. <dt><span>&lsquo;<samp>ts</samp>&rsquo;</span></dt>
  357. </dl>
  358. </dd>
  359. <dt><span><samp>max_delay <var>integer</var> (<em>input/output</em>)</samp></span></dt>
  360. <dd><p>Set maximum muxing or demuxing delay in microseconds.
  361. </p>
  362. </dd>
  363. <dt><span><samp>fpsprobesize <var>integer</var> (<em>input</em>)</samp></span></dt>
  364. <dd><p>Set number of frames used to probe fps.
  365. </p>
  366. </dd>
  367. <dt><span><samp>audio_preload <var>integer</var> (<em>output</em>)</samp></span></dt>
  368. <dd><p>Set microseconds by which audio packets should be interleaved earlier.
  369. </p>
  370. </dd>
  371. <dt><span><samp>chunk_duration <var>integer</var> (<em>output</em>)</samp></span></dt>
  372. <dd><p>Set microseconds for each chunk.
  373. </p>
  374. </dd>
  375. <dt><span><samp>chunk_size <var>integer</var> (<em>output</em>)</samp></span></dt>
  376. <dd><p>Set size in bytes for each chunk.
  377. </p>
  378. </dd>
  379. <dt><span><samp>err_detect, f_err_detect <var>flags</var> (<em>input</em>)</samp></span></dt>
  380. <dd><p>Set error detection flags. <code>f_err_detect</code> is deprecated and
  381. should be used only via the <code>ffmpeg</code> tool.
  382. </p>
  383. <p>Possible values:
  384. </p><dl compact="compact">
  385. <dt><span>&lsquo;<samp>crccheck</samp>&rsquo;</span></dt>
  386. <dd><p>Verify embedded CRCs.
  387. </p></dd>
  388. <dt><span>&lsquo;<samp>bitstream</samp>&rsquo;</span></dt>
  389. <dd><p>Detect bitstream specification deviations.
  390. </p></dd>
  391. <dt><span>&lsquo;<samp>buffer</samp>&rsquo;</span></dt>
  392. <dd><p>Detect improper bitstream length.
  393. </p></dd>
  394. <dt><span>&lsquo;<samp>explode</samp>&rsquo;</span></dt>
  395. <dd><p>Abort decoding on minor error detection.
  396. </p></dd>
  397. <dt><span>&lsquo;<samp>careful</samp>&rsquo;</span></dt>
  398. <dd><p>Consider things that violate the spec and have not been seen in the
  399. wild as errors.
  400. </p></dd>
  401. <dt><span>&lsquo;<samp>compliant</samp>&rsquo;</span></dt>
  402. <dd><p>Consider all spec non compliancies as errors.
  403. </p></dd>
  404. <dt><span>&lsquo;<samp>aggressive</samp>&rsquo;</span></dt>
  405. <dd><p>Consider things that a sane encoder should not do as an error.
  406. </p></dd>
  407. </dl>
  408. </dd>
  409. <dt><span><samp>max_interleave_delta <var>integer</var> (<em>output</em>)</samp></span></dt>
  410. <dd><p>Set maximum buffering duration for interleaving. The duration is
  411. expressed in microseconds, and defaults to 10000000 (10 seconds).
  412. </p>
  413. <p>To ensure all the streams are interleaved correctly, libavformat will
  414. wait until it has at least one packet for each stream before actually
  415. writing any packets to the output file. When some streams are
  416. &quot;sparse&quot; (i.e. there are large gaps between successive packets), this
  417. can result in excessive buffering.
  418. </p>
  419. <p>This field specifies the maximum difference between the timestamps of the
  420. first and the last packet in the muxing queue, above which libavformat
  421. will output a packet regardless of whether it has queued a packet for all
  422. the streams.
  423. </p>
  424. <p>If set to 0, libavformat will continue buffering packets until it has
  425. a packet for each stream, regardless of the maximum timestamp
  426. difference between the buffered packets.
  427. </p>
  428. </dd>
  429. <dt><span><samp>use_wallclock_as_timestamps <var>integer</var> (<em>input</em>)</samp></span></dt>
  430. <dd><p>Use wallclock as timestamps if set to 1. Default is 0.
  431. </p>
  432. </dd>
  433. <dt><span><samp>avoid_negative_ts <var>integer</var> (<em>output</em>)</samp></span></dt>
  434. <dd>
  435. <p>Possible values:
  436. </p><dl compact="compact">
  437. <dt><span>&lsquo;<samp>make_non_negative</samp>&rsquo;</span></dt>
  438. <dd><p>Shift timestamps to make them non-negative.
  439. Also note that this affects only leading negative timestamps, and not
  440. non-monotonic negative timestamps.
  441. </p></dd>
  442. <dt><span>&lsquo;<samp>make_zero</samp>&rsquo;</span></dt>
  443. <dd><p>Shift timestamps so that the first timestamp is 0.
  444. </p></dd>
  445. <dt><span>&lsquo;<samp>auto (default)</samp>&rsquo;</span></dt>
  446. <dd><p>Enables shifting when required by the target format.
  447. </p></dd>
  448. <dt><span>&lsquo;<samp>disabled</samp>&rsquo;</span></dt>
  449. <dd><p>Disables shifting of timestamp.
  450. </p></dd>
  451. </dl>
  452. <p>When shifting is enabled, all output timestamps are shifted by the
  453. same amount. Audio, video, and subtitles desynching and relative
  454. timestamp differences are preserved compared to how they would have
  455. been without shifting.
  456. </p>
  457. </dd>
  458. <dt><span><samp>skip_initial_bytes <var>integer</var> (<em>input</em>)</samp></span></dt>
  459. <dd><p>Set number of bytes to skip before reading header and frames if set to 1.
  460. Default is 0.
  461. </p>
  462. </dd>
  463. <dt><span><samp>correct_ts_overflow <var>integer</var> (<em>input</em>)</samp></span></dt>
  464. <dd><p>Correct single timestamp overflows if set to 1. Default is 1.
  465. </p>
  466. </dd>
  467. <dt><span><samp>flush_packets <var>integer</var> (<em>output</em>)</samp></span></dt>
  468. <dd><p>Flush the underlying I/O stream after each packet. Default is -1 (auto), which
  469. means that the underlying protocol will decide, 1 enables it, and has the
  470. effect of reducing the latency, 0 disables it and may increase IO throughput in
  471. some cases.
  472. </p>
  473. </dd>
  474. <dt><span><samp>output_ts_offset <var>offset</var> (<em>output</em>)</samp></span></dt>
  475. <dd><p>Set the output time offset.
  476. </p>
  477. <p><var>offset</var> must be a time duration specification,
  478. see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>.
  479. </p>
  480. <p>The offset is added by the muxer to the output timestamps.
  481. </p>
  482. <p>Specifying a positive offset means that the corresponding streams are
  483. delayed bt the time duration specified in <var>offset</var>. Default value
  484. is <code>0</code> (meaning that no offset is applied).
  485. </p>
  486. </dd>
  487. <dt><span><samp>format_whitelist <var>list</var> (<em>input</em>)</samp></span></dt>
  488. <dd><p>&quot;,&quot; separated list of allowed demuxers. By default all are allowed.
  489. </p>
  490. </dd>
  491. <dt><span><samp>dump_separator <var>string</var> (<em>input</em>)</samp></span></dt>
  492. <dd><p>Separator used to separate the fields printed on the command line about the
  493. Stream parameters.
  494. For example, to separate the fields with newlines and indentation:
  495. </p><div class="example">
  496. <pre class="example">ffprobe -dump_separator &quot;
  497. &quot; -i ~/videos/matrixbench_mpeg2.mpg
  498. </pre></div>
  499. </dd>
  500. <dt><span><samp>max_streams <var>integer</var> (<em>input</em>)</samp></span></dt>
  501. <dd><p>Specifies the maximum number of streams. This can be used to reject files that
  502. would require too many resources due to a large number of streams.
  503. </p>
  504. </dd>
  505. <dt><span><samp>skip_estimate_duration_from_pts <var>bool</var> (<em>input</em>)</samp></span></dt>
  506. <dd><p>Skip estimation of input duration when calculated using PTS.
  507. At present, applicable for MPEG-PS and MPEG-TS.
  508. </p>
  509. </dd>
  510. <dt><span><samp>strict, f_strict <var>integer</var> (<em>input/output</em>)</samp></span></dt>
  511. <dd><p>Specify how strictly to follow the standards. <code>f_strict</code> is deprecated and
  512. should be used only via the <code>ffmpeg</code> tool.
  513. </p>
  514. <p>Possible values:
  515. </p><dl compact="compact">
  516. <dt><span>&lsquo;<samp>very</samp>&rsquo;</span></dt>
  517. <dd><p>strictly conform to an older more strict version of the spec or reference software
  518. </p></dd>
  519. <dt><span>&lsquo;<samp>strict</samp>&rsquo;</span></dt>
  520. <dd><p>strictly conform to all the things in the spec no matter what consequences
  521. </p></dd>
  522. <dt><span>&lsquo;<samp>normal</samp>&rsquo;</span></dt>
  523. <dt><span>&lsquo;<samp>unofficial</samp>&rsquo;</span></dt>
  524. <dd><p>allow unofficial extensions
  525. </p></dd>
  526. <dt><span>&lsquo;<samp>experimental</samp>&rsquo;</span></dt>
  527. <dd><p>allow non standardized experimental things, experimental
  528. (unfinished/work in progress/not well tested) decoders and encoders.
  529. Note: experimental decoders can pose a security risk, do not use this for
  530. decoding untrusted input.
  531. </p></dd>
  532. </dl>
  533. </dd>
  534. </dl>
  535. <span id="Format-stream-specifiers"></span><a name="Format-stream-specifiers-1"></a>
  536. <h3 class="section">2.1 Format stream specifiers<span class="pull-right"><a class="anchor hidden-xs" href="#Format-stream-specifiers-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Format-stream-specifiers-1" aria-hidden="true">TOC</a></span></h3>
  537. <p>Format stream specifiers allow selection of one or more streams that
  538. match specific properties.
  539. </p>
  540. <p>The exact semantics of stream specifiers is defined by the
  541. <code>avformat_match_stream_specifier()</code> function declared in the
  542. <samp>libavformat/avformat.h</samp> header and documented in the
  543. <a data-manual="ffmpeg" href="ffmpeg.html#Stream-specifiers">(ffmpeg)Stream specifiers section in the ffmpeg(1) manual</a>.
  544. </p>
  545. <a name="Demuxers"></a>
  546. <h2 class="chapter">3 Demuxers<span class="pull-right"><a class="anchor hidden-xs" href="#Demuxers" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Demuxers" aria-hidden="true">TOC</a></span></h2>
  547. <p>Demuxers are configured elements in FFmpeg that can read the
  548. multimedia streams from a particular type of file.
  549. </p>
  550. <p>When you configure your FFmpeg build, all the supported demuxers
  551. are enabled by default. You can list all available ones using the
  552. configure option <code>--list-demuxers</code>.
  553. </p>
  554. <p>You can disable all the demuxers using the configure option
  555. <code>--disable-demuxers</code>, and selectively enable a single demuxer with
  556. the option <code>--enable-demuxer=<var>DEMUXER</var></code>, or disable it
  557. with the option <code>--disable-demuxer=<var>DEMUXER</var></code>.
  558. </p>
  559. <p>The option <code>-demuxers</code> of the ff* tools will display the list of
  560. enabled demuxers. Use <code>-formats</code> to view a combined list of
  561. enabled demuxers and muxers.
  562. </p>
  563. <p>The description of some of the currently available demuxers follows.
  564. </p>
  565. <a name="aa"></a>
  566. <h3 class="section">3.1 aa<span class="pull-right"><a class="anchor hidden-xs" href="#aa" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aa" aria-hidden="true">TOC</a></span></h3>
  567. <p>Audible Format 2, 3, and 4 demuxer.
  568. </p>
  569. <p>This demuxer is used to demux Audible Format 2, 3, and 4 (.aa) files.
  570. </p>
  571. <a name="aac"></a>
  572. <h3 class="section">3.2 aac<span class="pull-right"><a class="anchor hidden-xs" href="#aac" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aac" aria-hidden="true">TOC</a></span></h3>
  573. <p>Raw Audio Data Transport Stream AAC demuxer.
  574. </p>
  575. <p>This demuxer is used to demux an ADTS input containing a single AAC stream
  576. alongwith any ID3v1/2 or APE tags in it.
  577. </p>
  578. <a name="apng"></a>
  579. <h3 class="section">3.3 apng<span class="pull-right"><a class="anchor hidden-xs" href="#apng" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-apng" aria-hidden="true">TOC</a></span></h3>
  580. <p>Animated Portable Network Graphics demuxer.
  581. </p>
  582. <p>This demuxer is used to demux APNG files.
  583. All headers, but the PNG signature, up to (but not including) the first
  584. fcTL chunk are transmitted as extradata.
  585. Frames are then split as being all the chunks between two fcTL ones, or
  586. between the last fcTL and IEND chunks.
  587. </p>
  588. <dl compact="compact">
  589. <dt><span><samp>-ignore_loop <var>bool</var></samp></span></dt>
  590. <dd><p>Ignore the loop variable in the file if set. Default is enabled.
  591. </p>
  592. </dd>
  593. <dt><span><samp>-max_fps <var>int</var></samp></span></dt>
  594. <dd><p>Maximum framerate in frames per second. Default of 0 imposes no limit.
  595. </p>
  596. </dd>
  597. <dt><span><samp>-default_fps <var>int</var></samp></span></dt>
  598. <dd><p>Default framerate in frames per second when none is specified in the file
  599. (0 meaning as fast as possible). Default is 15.
  600. </p>
  601. </dd>
  602. </dl>
  603. <a name="asf-1"></a>
  604. <h3 class="section">3.4 asf<span class="pull-right"><a class="anchor hidden-xs" href="#asf-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asf-1" aria-hidden="true">TOC</a></span></h3>
  605. <p>Advanced Systems Format demuxer.
  606. </p>
  607. <p>This demuxer is used to demux ASF files and MMS network streams.
  608. </p>
  609. <dl compact="compact">
  610. <dt><span><samp>-no_resync_search <var>bool</var></samp></span></dt>
  611. <dd><p>Do not try to resynchronize by looking for a certain optional start code.
  612. </p></dd>
  613. </dl>
  614. <span id="concat"></span><a name="concat-1"></a>
  615. <h3 class="section">3.5 concat<span class="pull-right"><a class="anchor hidden-xs" href="#concat-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-concat-1" aria-hidden="true">TOC</a></span></h3>
  616. <p>Virtual concatenation script demuxer.
  617. </p>
  618. <p>This demuxer reads a list of files and other directives from a text file and
  619. demuxes them one after the other, as if all their packets had been muxed
  620. together.
  621. </p>
  622. <p>The timestamps in the files are adjusted so that the first file starts at 0
  623. and each next file starts where the previous one finishes. Note that it is
  624. done globally and may cause gaps if all streams do not have exactly the same
  625. length.
  626. </p>
  627. <p>All files must have the same streams (same codecs, same time base, etc.).
  628. </p>
  629. <p>The duration of each file is used to adjust the timestamps of the next file:
  630. if the duration is incorrect (because it was computed using the bit-rate or
  631. because the file is truncated, for example), it can cause artifacts. The
  632. <code>duration</code> directive can be used to override the duration stored in
  633. each file.
  634. </p>
  635. <a name="Syntax"></a>
  636. <h4 class="subsection">3.5.1 Syntax<span class="pull-right"><a class="anchor hidden-xs" href="#Syntax" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Syntax" aria-hidden="true">TOC</a></span></h4>
  637. <p>The script is a text file in extended-ASCII, with one directive per line.
  638. Empty lines, leading spaces and lines starting with &rsquo;#&rsquo; are ignored. The
  639. following directive is recognized:
  640. </p>
  641. <dl compact="compact">
  642. <dt><span><samp><code>file <var>path</var></code></samp></span></dt>
  643. <dd><p>Path to a file to read; special characters and spaces must be escaped with
  644. backslash or single quotes.
  645. </p>
  646. <p>All subsequent file-related directives apply to that file.
  647. </p>
  648. </dd>
  649. <dt><span><samp><code>ffconcat version 1.0</code></samp></span></dt>
  650. <dd><p>Identify the script type and version.
  651. </p>
  652. <p>To make FFmpeg recognize the format automatically, this directive must
  653. appear exactly as is (no extra space or byte-order-mark) on the very first
  654. line of the script.
  655. </p>
  656. </dd>
  657. <dt><span><samp><code>duration <var>dur</var></code></samp></span></dt>
  658. <dd><p>Duration of the file. This information can be specified from the file;
  659. specifying it here may be more efficient or help if the information from the
  660. file is not available or accurate.
  661. </p>
  662. <p>If the duration is set for all files, then it is possible to seek in the
  663. whole concatenated video.
  664. </p>
  665. </dd>
  666. <dt><span><samp><code>inpoint <var>timestamp</var></code></samp></span></dt>
  667. <dd><p>In point of the file. When the demuxer opens the file it instantly seeks to the
  668. specified timestamp. Seeking is done so that all streams can be presented
  669. successfully at In point.
  670. </p>
  671. <p>This directive works best with intra frame codecs, because for non-intra frame
  672. ones you will usually get extra packets before the actual In point and the
  673. decoded content will most likely contain frames before In point too.
  674. </p>
  675. <p>For each file, packets before the file In point will have timestamps less than
  676. the calculated start timestamp of the file (negative in case of the first
  677. file), and the duration of the files (if not specified by the <code>duration</code>
  678. directive) will be reduced based on their specified In point.
  679. </p>
  680. <p>Because of potential packets before the specified In point, packet timestamps
  681. may overlap between two concatenated files.
  682. </p>
  683. </dd>
  684. <dt><span><samp><code>outpoint <var>timestamp</var></code></samp></span></dt>
  685. <dd><p>Out point of the file. When the demuxer reaches the specified decoding
  686. timestamp in any of the streams, it handles it as an end of file condition and
  687. skips the current and all the remaining packets from all streams.
  688. </p>
  689. <p>Out point is exclusive, which means that the demuxer will not output packets
  690. with a decoding timestamp greater or equal to Out point.
  691. </p>
  692. <p>This directive works best with intra frame codecs and formats where all streams
  693. are tightly interleaved. For non-intra frame codecs you will usually get
  694. additional packets with presentation timestamp after Out point therefore the
  695. decoded content will most likely contain frames after Out point too. If your
  696. streams are not tightly interleaved you may not get all the packets from all
  697. streams before Out point and you may only will be able to decode the earliest
  698. stream until Out point.
  699. </p>
  700. <p>The duration of the files (if not specified by the <code>duration</code>
  701. directive) will be reduced based on their specified Out point.
  702. </p>
  703. </dd>
  704. <dt><span><samp><code>file_packet_metadata <var>key=value</var></code></samp></span></dt>
  705. <dd><p>Metadata of the packets of the file. The specified metadata will be set for
  706. each file packet. You can specify this directive multiple times to add multiple
  707. metadata entries.
  708. This directive is deprecated, use <code>file_packet_meta</code> instead.
  709. </p>
  710. </dd>
  711. <dt><span><samp><code>file_packet_meta <var>key</var> <var>value</var></code></samp></span></dt>
  712. <dd><p>Metadata of the packets of the file. The specified metadata will be set for
  713. each file packet. You can specify this directive multiple times to add multiple
  714. metadata entries.
  715. </p>
  716. </dd>
  717. <dt><span><samp><code>option <var>key</var> <var>value</var></code></samp></span></dt>
  718. <dd><p>Option to access, open and probe the file.
  719. Can be present multiple times.
  720. </p>
  721. </dd>
  722. <dt><span><samp><code>stream</code></samp></span></dt>
  723. <dd><p>Introduce a stream in the virtual file.
  724. All subsequent stream-related directives apply to the last introduced
  725. stream.
  726. Some streams properties must be set in order to allow identifying the
  727. matching streams in the subfiles.
  728. If no streams are defined in the script, the streams from the first file are
  729. copied.
  730. </p>
  731. </dd>
  732. <dt><span><samp><code>exact_stream_id <var>id</var></code></samp></span></dt>
  733. <dd><p>Set the id of the stream.
  734. If this directive is given, the string with the corresponding id in the
  735. subfiles will be used.
  736. This is especially useful for MPEG-PS (VOB) files, where the order of the
  737. streams is not reliable.
  738. </p>
  739. </dd>
  740. <dt><span><samp><code>stream_meta <var>key</var> <var>value</var></code></samp></span></dt>
  741. <dd><p>Metadata for the stream.
  742. Can be present multiple times.
  743. </p>
  744. </dd>
  745. <dt><span><samp><code>stream_codec <var>value</var></code></samp></span></dt>
  746. <dd><p>Codec for the stream.
  747. </p>
  748. </dd>
  749. <dt><span><samp><code>stream_extradata <var>hex_string</var></code></samp></span></dt>
  750. <dd><p>Extradata for the string, encoded in hexadecimal.
  751. </p>
  752. </dd>
  753. <dt><span><samp><code>chapter <var>id</var> <var>start</var> <var>end</var></code></samp></span></dt>
  754. <dd><p>Add a chapter. <var>id</var> is an unique identifier, possibly small and
  755. consecutive.
  756. </p>
  757. </dd>
  758. </dl>
  759. <a name="Options"></a>
  760. <h4 class="subsection">3.5.2 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options" aria-hidden="true">TOC</a></span></h4>
  761. <p>This demuxer accepts the following option:
  762. </p>
  763. <dl compact="compact">
  764. <dt><span><samp>safe</samp></span></dt>
  765. <dd><p>If set to 1, reject unsafe file paths and directives.
  766. A file path is considered safe if it
  767. does not contain a protocol specification and is relative and all components
  768. only contain characters from the portable character set (letters, digits,
  769. period, underscore and hyphen) and have no period at the beginning of a
  770. component.
  771. </p>
  772. <p>If set to 0, any file name is accepted.
  773. </p>
  774. <p>The default is 1.
  775. </p>
  776. </dd>
  777. <dt><span><samp>auto_convert</samp></span></dt>
  778. <dd><p>If set to 1, try to perform automatic conversions on packet data to make the
  779. streams concatenable.
  780. The default is 1.
  781. </p>
  782. <p>Currently, the only conversion is adding the h264_mp4toannexb bitstream
  783. filter to H.264 streams in MP4 format. This is necessary in particular if
  784. there are resolution changes.
  785. </p>
  786. </dd>
  787. <dt><span><samp>segment_time_metadata</samp></span></dt>
  788. <dd><p>If set to 1, every packet will contain the <var>lavf.concat.start_time</var> and the
  789. <var>lavf.concat.duration</var> packet metadata values which are the start_time and
  790. the duration of the respective file segments in the concatenated output
  791. expressed in microseconds. The duration metadata is only set if it is known
  792. based on the concat file.
  793. The default is 0.
  794. </p>
  795. </dd>
  796. </dl>
  797. <a name="Examples"></a>
  798. <h4 class="subsection">3.5.3 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples" aria-hidden="true">TOC</a></span></h4>
  799. <ul>
  800. <li> Use absolute filenames and include some comments:
  801. <div class="example">
  802. <pre class="example"># my first filename
  803. file /mnt/share/file-1.wav
  804. # my second filename including whitespace
  805. file '/mnt/share/file 2.wav'
  806. # my third filename including whitespace plus single quote
  807. file '/mnt/share/file 3'\''.wav'
  808. </pre></div>
  809. </li><li> Allow for input format auto-probing, use safe filenames and set the duration of
  810. the first file:
  811. <div class="example">
  812. <pre class="example">ffconcat version 1.0
  813. file file-1.wav
  814. duration 20.0
  815. file subdir/file-2.wav
  816. </pre></div>
  817. </li></ul>
  818. <a name="dash-1"></a>
  819. <h3 class="section">3.6 dash<span class="pull-right"><a class="anchor hidden-xs" href="#dash-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dash-1" aria-hidden="true">TOC</a></span></h3>
  820. <p>Dynamic Adaptive Streaming over HTTP demuxer.
  821. </p>
  822. <p>This demuxer presents all AVStreams found in the manifest.
  823. By setting the discard flags on AVStreams the caller can decide
  824. which streams to actually receive.
  825. Each stream mirrors the <code>id</code> and <code>bandwidth</code> properties from the
  826. <code>&lt;Representation&gt;</code> as metadata keys named &quot;id&quot; and &quot;variant_bitrate&quot; respectively.
  827. </p>
  828. <a name="Options-1"></a>
  829. <h4 class="subsection">3.6.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-1" aria-hidden="true">TOC</a></span></h4>
  830. <p>This demuxer accepts the following option:
  831. </p>
  832. <dl compact="compact">
  833. <dt><span><samp>cenc_decryption_key</samp></span></dt>
  834. <dd><p>16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7).
  835. </p>
  836. </dd>
  837. </dl>
  838. <a name="ea"></a>
  839. <h3 class="section">3.7 ea<span class="pull-right"><a class="anchor hidden-xs" href="#ea" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ea" aria-hidden="true">TOC</a></span></h3>
  840. <p>Electronic Arts Multimedia format demuxer.
  841. </p>
  842. <p>This format is used by various Electronic Arts games.
  843. </p>
  844. <a name="Options-2"></a>
  845. <h4 class="subsection">3.7.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-2" aria-hidden="true">TOC</a></span></h4>
  846. <dl compact="compact">
  847. <dt><span><samp>merge_alpha <var>bool</var></samp></span></dt>
  848. <dd>
  849. <p>Normally the VP6 alpha channel (if exists) is returned as a secondary video
  850. stream, by setting this option you can make the demuxer return a single video
  851. stream which contains the alpha channel in addition to the ordinary video.
  852. </p>
  853. </dd>
  854. </dl>
  855. <a name="imf"></a>
  856. <h3 class="section">3.8 imf<span class="pull-right"><a class="anchor hidden-xs" href="#imf" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-imf" aria-hidden="true">TOC</a></span></h3>
  857. <p>Interoperable Master Format demuxer.
  858. </p>
  859. <p>This demuxer presents audio and video streams found in an IMF Composition, as
  860. specified in <a href="https://doi.org/10.5594/SMPTE.ST2067-2.2020">SMPTE ST 2067-2</a>.
  861. </p>
  862. <div class="example">
  863. <pre class="example">ffmpeg [-assetmaps &lt;path of ASSETMAP1&gt;,&lt;path of ASSETMAP2&gt;,...] -i &lt;path of CPL&gt; ...
  864. </pre></div>
  865. <p>If <code>-assetmaps</code> is not specified, the demuxer looks for a file called
  866. <samp>ASSETMAP.xml</samp> in the same directory as the CPL.
  867. </p>
  868. <a name="flv_002c-live_005fflv_002c-kux"></a>
  869. <h3 class="section">3.9 flv, live_flv, kux<span class="pull-right"><a class="anchor hidden-xs" href="#flv_002c-live_005fflv_002c-kux" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-flv_002c-live_005fflv_002c-kux" aria-hidden="true">TOC</a></span></h3>
  870. <p>Adobe Flash Video Format demuxer.
  871. </p>
  872. <p>This demuxer is used to demux FLV files and RTMP network streams. In case of live network streams, if you force format, you may use live_flv option instead of flv to survive timestamp discontinuities.
  873. KUX is a flv variant used on the Youku platform.
  874. </p>
  875. <div class="example">
  876. <pre class="example">ffmpeg -f flv -i myfile.flv ...
  877. ffmpeg -f live_flv -i rtmp://&lt;any.server&gt;/anything/key ....
  878. </pre></div>
  879. <dl compact="compact">
  880. <dt><span><samp>-flv_metadata <var>bool</var></samp></span></dt>
  881. <dd><p>Allocate the streams according to the onMetaData array content.
  882. </p>
  883. </dd>
  884. <dt><span><samp>-flv_ignore_prevtag <var>bool</var></samp></span></dt>
  885. <dd><p>Ignore the size of previous tag value.
  886. </p>
  887. </dd>
  888. <dt><span><samp>-flv_full_metadata <var>bool</var></samp></span></dt>
  889. <dd><p>Output all context of the onMetadata.
  890. </p></dd>
  891. </dl>
  892. <a name="gif-1"></a>
  893. <h3 class="section">3.10 gif<span class="pull-right"><a class="anchor hidden-xs" href="#gif-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gif-1" aria-hidden="true">TOC</a></span></h3>
  894. <p>Animated GIF demuxer.
  895. </p>
  896. <p>It accepts the following options:
  897. </p>
  898. <dl compact="compact">
  899. <dt><span><samp>min_delay</samp></span></dt>
  900. <dd><p>Set the minimum valid delay between frames in hundredths of seconds.
  901. Range is 0 to 6000. Default value is 2.
  902. </p>
  903. </dd>
  904. <dt><span><samp>max_gif_delay</samp></span></dt>
  905. <dd><p>Set the maximum valid delay between frames in hundredth of seconds.
  906. Range is 0 to 65535. Default value is 65535 (nearly eleven minutes),
  907. the maximum value allowed by the specification.
  908. </p>
  909. </dd>
  910. <dt><span><samp>default_delay</samp></span></dt>
  911. <dd><p>Set the default delay between frames in hundredths of seconds.
  912. Range is 0 to 6000. Default value is 10.
  913. </p>
  914. </dd>
  915. <dt><span><samp>ignore_loop</samp></span></dt>
  916. <dd><p>GIF files can contain information to loop a certain number of times (or
  917. infinitely). If <samp>ignore_loop</samp> is set to 1, then the loop setting
  918. from the input will be ignored and looping will not occur. If set to 0,
  919. then looping will occur and will cycle the number of times according to
  920. the GIF. Default value is 1.
  921. </p></dd>
  922. </dl>
  923. <p>For example, with the overlay filter, place an infinitely looping GIF
  924. over another video:
  925. </p><div class="example">
  926. <pre class="example">ffmpeg -i input.mp4 -ignore_loop 0 -i input.gif -filter_complex overlay=shortest=1 out.mkv
  927. </pre></div>
  928. <p>Note that in the above example the shortest option for overlay filter is
  929. used to end the output video at the length of the shortest input file,
  930. which in this case is <samp>input.mp4</samp> as the GIF in this example loops
  931. infinitely.
  932. </p>
  933. <a name="hls-1"></a>
  934. <h3 class="section">3.11 hls<span class="pull-right"><a class="anchor hidden-xs" href="#hls-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hls-1" aria-hidden="true">TOC</a></span></h3>
  935. <p>HLS demuxer
  936. </p>
  937. <p>Apple HTTP Live Streaming demuxer.
  938. </p>
  939. <p>This demuxer presents all AVStreams from all variant streams.
  940. The id field is set to the bitrate variant index number. By setting
  941. the discard flags on AVStreams (by pressing &rsquo;a&rsquo; or &rsquo;v&rsquo; in ffplay),
  942. the caller can decide which variant streams to actually receive.
  943. The total bitrate of the variant that the stream belongs to is
  944. available in a metadata key named &quot;variant_bitrate&quot;.
  945. </p>
  946. <p>It accepts the following options:
  947. </p>
  948. <dl compact="compact">
  949. <dt><span><samp>live_start_index</samp></span></dt>
  950. <dd><p>segment index to start live streams at (negative values are from the end).
  951. </p>
  952. </dd>
  953. <dt><span><samp>prefer_x_start</samp></span></dt>
  954. <dd><p>prefer to use #EXT-X-START if it&rsquo;s in playlist instead of live_start_index.
  955. </p>
  956. </dd>
  957. <dt><span><samp>allowed_extensions</samp></span></dt>
  958. <dd><p>&rsquo;,&rsquo; separated list of file extensions that hls is allowed to access.
  959. </p>
  960. </dd>
  961. <dt><span><samp>max_reload</samp></span></dt>
  962. <dd><p>Maximum number of times a insufficient list is attempted to be reloaded.
  963. Default value is 1000.
  964. </p>
  965. </dd>
  966. <dt><span><samp>m3u8_hold_counters</samp></span></dt>
  967. <dd><p>The maximum number of times to load m3u8 when it refreshes without new segments.
  968. Default value is 1000.
  969. </p>
  970. </dd>
  971. <dt><span><samp>http_persistent</samp></span></dt>
  972. <dd><p>Use persistent HTTP connections. Applicable only for HTTP streams.
  973. Enabled by default.
  974. </p>
  975. </dd>
  976. <dt><span><samp>http_multiple</samp></span></dt>
  977. <dd><p>Use multiple HTTP connections for downloading HTTP segments.
  978. Enabled by default for HTTP/1.1 servers.
  979. </p>
  980. </dd>
  981. <dt><span><samp>http_seekable</samp></span></dt>
  982. <dd><p>Use HTTP partial requests for downloading HTTP segments.
  983. 0 = disable, 1 = enable, -1 = auto, Default is auto.
  984. </p>
  985. </dd>
  986. <dt><span><samp>seg_format_options</samp></span></dt>
  987. <dd><p>Set options for the demuxer of media segments using a list of key=value pairs separated by <code>:</code>.
  988. </p>
  989. </dd>
  990. <dt><span><samp>seg_max_retry</samp></span></dt>
  991. <dd><p>Maximum number of times to reload a segment on error, useful when segment skip on network error is not desired.
  992. Default value is 0.
  993. </p></dd>
  994. </dl>
  995. <a name="image2-1"></a>
  996. <h3 class="section">3.12 image2<span class="pull-right"><a class="anchor hidden-xs" href="#image2-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-image2-1" aria-hidden="true">TOC</a></span></h3>
  997. <p>Image file demuxer.
  998. </p>
  999. <p>This demuxer reads from a list of image files specified by a pattern.
  1000. The syntax and meaning of the pattern is specified by the
  1001. option <var>pattern_type</var>.
  1002. </p>
  1003. <p>The pattern may contain a suffix which is used to automatically
  1004. determine the format of the images contained in the files.
  1005. </p>
  1006. <p>The size, the pixel format, and the format of each image must be the
  1007. same for all the files in the sequence.
  1008. </p>
  1009. <p>This demuxer accepts the following options:
  1010. </p><dl compact="compact">
  1011. <dt><span><samp>framerate</samp></span></dt>
  1012. <dd><p>Set the frame rate for the video stream. It defaults to 25.
  1013. </p></dd>
  1014. <dt><span><samp>loop</samp></span></dt>
  1015. <dd><p>If set to 1, loop over the input. Default value is 0.
  1016. </p></dd>
  1017. <dt><span><samp>pattern_type</samp></span></dt>
  1018. <dd><p>Select the pattern type used to interpret the provided filename.
  1019. </p>
  1020. <p><var>pattern_type</var> accepts one of the following values.
  1021. </p><dl compact="compact">
  1022. <dt><span><samp>none</samp></span></dt>
  1023. <dd><p>Disable pattern matching, therefore the video will only contain the specified
  1024. image. You should use this option if you do not want to create sequences from
  1025. multiple images and your filenames may contain special pattern characters.
  1026. </p></dd>
  1027. <dt><span><samp>sequence</samp></span></dt>
  1028. <dd><p>Select a sequence pattern type, used to specify a sequence of files
  1029. indexed by sequential numbers.
  1030. </p>
  1031. <p>A sequence pattern may contain the string &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, which
  1032. specifies the position of the characters representing a sequential
  1033. number in each filename matched by the pattern. If the form
  1034. &quot;%d0<var>N</var>d&quot; is used, the string representing the number in each
  1035. filename is 0-padded and <var>N</var> is the total number of 0-padded
  1036. digits representing the number. The literal character &rsquo;%&rsquo; can be
  1037. specified in the pattern with the string &quot;%%&quot;.
  1038. </p>
  1039. <p>If the sequence pattern contains &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, the first filename of
  1040. the file list specified by the pattern must contain a number
  1041. inclusively contained between <var>start_number</var> and
  1042. <var>start_number</var>+<var>start_number_range</var>-1, and all the following
  1043. numbers must be sequential.
  1044. </p>
  1045. <p>For example the pattern &quot;img-%03d.bmp&quot; will match a sequence of
  1046. filenames of the form <samp>img-001.bmp</samp>, <samp>img-002.bmp</samp>, ...,
  1047. <samp>img-010.bmp</samp>, etc.; the pattern &quot;i%%m%%g-%d.jpg&quot; will match a
  1048. sequence of filenames of the form <samp>i%m%g-1.jpg</samp>,
  1049. <samp>i%m%g-2.jpg</samp>, ..., <samp>i%m%g-10.jpg</samp>, etc.
  1050. </p>
  1051. <p>Note that the pattern must not necessarily contain &quot;%d&quot; or
  1052. &quot;%0<var>N</var>d&quot;, for example to convert a single image file
  1053. <samp>img.jpeg</samp> you can employ the command:
  1054. </p><div class="example">
  1055. <pre class="example">ffmpeg -i img.jpeg img.png
  1056. </pre></div>
  1057. </dd>
  1058. <dt><span><samp>glob</samp></span></dt>
  1059. <dd><p>Select a glob wildcard pattern type.
  1060. </p>
  1061. <p>The pattern is interpreted like a <code>glob()</code> pattern. This is only
  1062. selectable if libavformat was compiled with globbing support.
  1063. </p>
  1064. </dd>
  1065. <dt><span><samp>glob_sequence <em>(deprecated, will be removed)</em></samp></span></dt>
  1066. <dd><p>Select a mixed glob wildcard/sequence pattern.
  1067. </p>
  1068. <p>If your version of libavformat was compiled with globbing support, and
  1069. the provided pattern contains at least one glob meta character among
  1070. <code>%*?[]{}</code> that is preceded by an unescaped &quot;%&quot;, the pattern is
  1071. interpreted like a <code>glob()</code> pattern, otherwise it is interpreted
  1072. like a sequence pattern.
  1073. </p>
  1074. <p>All glob special characters <code>%*?[]{}</code> must be prefixed
  1075. with &quot;%&quot;. To escape a literal &quot;%&quot; you shall use &quot;%%&quot;.
  1076. </p>
  1077. <p>For example the pattern <code>foo-%*.jpeg</code> will match all the
  1078. filenames prefixed by &quot;foo-&quot; and terminating with &quot;.jpeg&quot;, and
  1079. <code>foo-%?%?%?.jpeg</code> will match all the filenames prefixed with
  1080. &quot;foo-&quot;, followed by a sequence of three characters, and terminating
  1081. with &quot;.jpeg&quot;.
  1082. </p>
  1083. <p>This pattern type is deprecated in favor of <var>glob</var> and
  1084. <var>sequence</var>.
  1085. </p></dd>
  1086. </dl>
  1087. <p>Default value is <var>glob_sequence</var>.
  1088. </p></dd>
  1089. <dt><span><samp>pixel_format</samp></span></dt>
  1090. <dd><p>Set the pixel format of the images to read. If not specified the pixel
  1091. format is guessed from the first image file in the sequence.
  1092. </p></dd>
  1093. <dt><span><samp>start_number</samp></span></dt>
  1094. <dd><p>Set the index of the file matched by the image file pattern to start
  1095. to read from. Default value is 0.
  1096. </p></dd>
  1097. <dt><span><samp>start_number_range</samp></span></dt>
  1098. <dd><p>Set the index interval range to check when looking for the first image
  1099. file in the sequence, starting from <var>start_number</var>. Default value
  1100. is 5.
  1101. </p></dd>
  1102. <dt><span><samp>ts_from_file</samp></span></dt>
  1103. <dd><p>If set to 1, will set frame timestamp to modification time of image file. Note
  1104. that monotonity of timestamps is not provided: images go in the same order as
  1105. without this option. Default value is 0.
  1106. If set to 2, will set frame timestamp to the modification time of the image file in
  1107. nanosecond precision.
  1108. </p></dd>
  1109. <dt><span><samp>video_size</samp></span></dt>
  1110. <dd><p>Set the video size of the images to read. If not specified the video
  1111. size is guessed from the first image file in the sequence.
  1112. </p></dd>
  1113. <dt><span><samp>export_path_metadata</samp></span></dt>
  1114. <dd><p>If set to 1, will add two extra fields to the metadata found in input, making them
  1115. also available for other filters (see <var>drawtext</var> filter for examples). Default
  1116. value is 0. The extra fields are described below:
  1117. </p><dl compact="compact">
  1118. <dt><span><samp>lavf.image2dec.source_path</samp></span></dt>
  1119. <dd><p>Corresponds to the full path to the input file being read.
  1120. </p></dd>
  1121. <dt><span><samp>lavf.image2dec.source_basename</samp></span></dt>
  1122. <dd><p>Corresponds to the name of the file being read.
  1123. </p></dd>
  1124. </dl>
  1125. </dd>
  1126. </dl>
  1127. <a name="Examples-1"></a>
  1128. <h4 class="subsection">3.12.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-1" aria-hidden="true">TOC</a></span></h4>
  1129. <ul>
  1130. <li> Use <code>ffmpeg</code> for creating a video from the images in the file
  1131. sequence <samp>img-001.jpeg</samp>, <samp>img-002.jpeg</samp>, ..., assuming an
  1132. input frame rate of 10 frames per second:
  1133. <div class="example">
  1134. <pre class="example">ffmpeg -framerate 10 -i 'img-%03d.jpeg' out.mkv
  1135. </pre></div>
  1136. </li><li> As above, but start by reading from a file with index 100 in the sequence:
  1137. <div class="example">
  1138. <pre class="example">ffmpeg -framerate 10 -start_number 100 -i 'img-%03d.jpeg' out.mkv
  1139. </pre></div>
  1140. </li><li> Read images matching the &quot;*.png&quot; glob pattern , that is all the files
  1141. terminating with the &quot;.png&quot; suffix:
  1142. <div class="example">
  1143. <pre class="example">ffmpeg -framerate 10 -pattern_type glob -i &quot;*.png&quot; out.mkv
  1144. </pre></div>
  1145. </li></ul>
  1146. <a name="libgme"></a>
  1147. <h3 class="section">3.13 libgme<span class="pull-right"><a class="anchor hidden-xs" href="#libgme" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libgme" aria-hidden="true">TOC</a></span></h3>
  1148. <p>The Game Music Emu library is a collection of video game music file emulators.
  1149. </p>
  1150. <p>See <a href="https://bitbucket.org/mpyne/game-music-emu/overview">https://bitbucket.org/mpyne/game-music-emu/overview</a> for more information.
  1151. </p>
  1152. <p>It accepts the following options:
  1153. </p>
  1154. <dl compact="compact">
  1155. <dt><span><samp>track_index</samp></span></dt>
  1156. <dd><p>Set the index of which track to demux. The demuxer can only export one track.
  1157. Track indexes start at 0. Default is to pick the first track. Number of tracks
  1158. is exported as <var>tracks</var> metadata entry.
  1159. </p>
  1160. </dd>
  1161. <dt><span><samp>sample_rate</samp></span></dt>
  1162. <dd><p>Set the sampling rate of the exported track. Range is 1000 to 999999. Default is 44100.
  1163. </p>
  1164. </dd>
  1165. <dt><span><samp>max_size <em>(bytes)</em></samp></span></dt>
  1166. <dd><p>The demuxer buffers the entire file into memory. Adjust this value to set the maximum buffer size,
  1167. which in turn, acts as a ceiling for the size of files that can be read.
  1168. Default is 50 MiB.
  1169. </p>
  1170. </dd>
  1171. </dl>
  1172. <a name="libmodplug"></a>
  1173. <h3 class="section">3.14 libmodplug<span class="pull-right"><a class="anchor hidden-xs" href="#libmodplug" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libmodplug" aria-hidden="true">TOC</a></span></h3>
  1174. <p>ModPlug based module demuxer
  1175. </p>
  1176. <p>See <a href="https://github.com/Konstanty/libmodplug">https://github.com/Konstanty/libmodplug</a>
  1177. </p>
  1178. <p>It will export one 2-channel 16-bit 44.1 kHz audio stream.
  1179. Optionally, a <code>pal8</code> 16-color video stream can be exported with or without printed metadata.
  1180. </p>
  1181. <p>It accepts the following options:
  1182. </p>
  1183. <dl compact="compact">
  1184. <dt><span><samp>noise_reduction</samp></span></dt>
  1185. <dd><p>Apply a simple low-pass filter. Can be 1 (on) or 0 (off). Default is 0.
  1186. </p>
  1187. </dd>
  1188. <dt><span><samp>reverb_depth</samp></span></dt>
  1189. <dd><p>Set amount of reverb. Range 0-100. Default is 0.
  1190. </p>
  1191. </dd>
  1192. <dt><span><samp>reverb_delay</samp></span></dt>
  1193. <dd><p>Set delay in ms, clamped to 40-250 ms. Default is 0.
  1194. </p>
  1195. </dd>
  1196. <dt><span><samp>bass_amount</samp></span></dt>
  1197. <dd><p>Apply bass expansion a.k.a. XBass or megabass. Range is 0 (quiet) to 100 (loud). Default is 0.
  1198. </p>
  1199. </dd>
  1200. <dt><span><samp>bass_range</samp></span></dt>
  1201. <dd><p>Set cutoff i.e. upper-bound for bass frequencies. Range is 10-100 Hz. Default is 0.
  1202. </p>
  1203. </dd>
  1204. <dt><span><samp>surround_depth</samp></span></dt>
  1205. <dd><p>Apply a Dolby Pro-Logic surround effect. Range is 0 (quiet) to 100 (heavy). Default is 0.
  1206. </p>
  1207. </dd>
  1208. <dt><span><samp>surround_delay</samp></span></dt>
  1209. <dd><p>Set surround delay in ms, clamped to 5-40 ms. Default is 0.
  1210. </p>
  1211. </dd>
  1212. <dt><span><samp>max_size</samp></span></dt>
  1213. <dd><p>The demuxer buffers the entire file into memory. Adjust this value to set the maximum buffer size,
  1214. which in turn, acts as a ceiling for the size of files that can be read. Range is 0 to 100 MiB.
  1215. 0 removes buffer size limit (not recommended). Default is 5 MiB.
  1216. </p>
  1217. </dd>
  1218. <dt><span><samp>video_stream_expr</samp></span></dt>
  1219. <dd><p>String which is evaluated using the eval API to assign colors to the generated video stream.
  1220. Variables which can be used are <code>x</code>, <code>y</code>, <code>w</code>, <code>h</code>, <code>t</code>, <code>speed</code>,
  1221. <code>tempo</code>, <code>order</code>, <code>pattern</code> and <code>row</code>.
  1222. </p>
  1223. </dd>
  1224. <dt><span><samp>video_stream</samp></span></dt>
  1225. <dd><p>Generate video stream. Can be 1 (on) or 0 (off). Default is 0.
  1226. </p>
  1227. </dd>
  1228. <dt><span><samp>video_stream_w</samp></span></dt>
  1229. <dd><p>Set video frame width in &rsquo;chars&rsquo; where one char indicates 8 pixels. Range is 20-512. Default is 30.
  1230. </p>
  1231. </dd>
  1232. <dt><span><samp>video_stream_h</samp></span></dt>
  1233. <dd><p>Set video frame height in &rsquo;chars&rsquo; where one char indicates 8 pixels. Range is 20-512. Default is 30.
  1234. </p>
  1235. </dd>
  1236. <dt><span><samp>video_stream_ptxt</samp></span></dt>
  1237. <dd><p>Print metadata on video stream. Includes <code>speed</code>, <code>tempo</code>, <code>order</code>, <code>pattern</code>,
  1238. <code>row</code> and <code>ts</code> (time in ms). Can be 1 (on) or 0 (off). Default is 1.
  1239. </p>
  1240. </dd>
  1241. </dl>
  1242. <a name="libopenmpt"></a>
  1243. <h3 class="section">3.15 libopenmpt<span class="pull-right"><a class="anchor hidden-xs" href="#libopenmpt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libopenmpt" aria-hidden="true">TOC</a></span></h3>
  1244. <p>libopenmpt based module demuxer
  1245. </p>
  1246. <p>See <a href="https://lib.openmpt.org/libopenmpt/">https://lib.openmpt.org/libopenmpt/</a> for more information.
  1247. </p>
  1248. <p>Some files have multiple subsongs (tracks) this can be set with the <samp>subsong</samp>
  1249. option.
  1250. </p>
  1251. <p>It accepts the following options:
  1252. </p>
  1253. <dl compact="compact">
  1254. <dt><span><samp>subsong</samp></span></dt>
  1255. <dd><p>Set the subsong index. This can be either &rsquo;all&rsquo;, &rsquo;auto&rsquo;, or the index of the
  1256. subsong. Subsong indexes start at 0. The default is &rsquo;auto&rsquo;.
  1257. </p>
  1258. <p>The default value is to let libopenmpt choose.
  1259. </p>
  1260. </dd>
  1261. <dt><span><samp>layout</samp></span></dt>
  1262. <dd><p>Set the channel layout. Valid values are 1, 2, and 4 channel layouts.
  1263. The default value is STEREO.
  1264. </p>
  1265. </dd>
  1266. <dt><span><samp>sample_rate</samp></span></dt>
  1267. <dd><p>Set the sample rate for libopenmpt to output.
  1268. Range is from 1000 to INT_MAX. The value default is 48000.
  1269. </p></dd>
  1270. </dl>
  1271. <a name="mov_002fmp4_002f3gp"></a>
  1272. <h3 class="section">3.16 mov/mp4/3gp<span class="pull-right"><a class="anchor hidden-xs" href="#mov_002fmp4_002f3gp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mov_002fmp4_002f3gp" aria-hidden="true">TOC</a></span></h3>
  1273. <p>Demuxer for Quicktime File Format &amp; ISO/IEC Base Media File Format (ISO/IEC 14496-12 or MPEG-4 Part 12, ISO/IEC 15444-12 or JPEG 2000 Part 12).
  1274. </p>
  1275. <p>Registered extensions: mov, mp4, m4a, 3gp, 3g2, mj2, psp, m4b, ism, ismv, isma, f4v
  1276. </p>
  1277. <a name="Options-3"></a>
  1278. <h4 class="subsection">3.16.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-3" aria-hidden="true">TOC</a></span></h4>
  1279. <p>This demuxer accepts the following options:
  1280. </p><dl compact="compact">
  1281. <dt><span><samp>enable_drefs</samp></span></dt>
  1282. <dd><p>Enable loading of external tracks, disabled by default.
  1283. Enabling this can theoretically leak information in some use cases.
  1284. </p>
  1285. </dd>
  1286. <dt><span><samp>use_absolute_path</samp></span></dt>
  1287. <dd><p>Allows loading of external tracks via absolute paths, disabled by default.
  1288. Enabling this poses a security risk. It should only be enabled if the source
  1289. is known to be non-malicious.
  1290. </p>
  1291. </dd>
  1292. <dt><span><samp>seek_streams_individually</samp></span></dt>
  1293. <dd><p>When seeking, identify the closest point in each stream individually and demux packets in
  1294. that stream from identified point. This can lead to a different sequence of packets compared
  1295. to demuxing linearly from the beginning. Default is true.
  1296. </p>
  1297. </dd>
  1298. <dt><span><samp>ignore_editlist</samp></span></dt>
  1299. <dd><p>Ignore any edit list atoms. The demuxer, by default, modifies the stream index to reflect the
  1300. timeline described by the edit list. Default is false.
  1301. </p>
  1302. </dd>
  1303. <dt><span><samp>advanced_editlist</samp></span></dt>
  1304. <dd><p>Modify the stream index to reflect the timeline described by the edit list. <code>ignore_editlist</code>
  1305. must be set to false for this option to be effective.
  1306. If both <code>ignore_editlist</code> and this option are set to false, then only the
  1307. start of the stream index is modified to reflect initial dwell time or starting timestamp
  1308. described by the edit list. Default is true.
  1309. </p>
  1310. </dd>
  1311. <dt><span><samp>ignore_chapters</samp></span></dt>
  1312. <dd><p>Don&rsquo;t parse chapters. This includes GoPro &rsquo;HiLight&rsquo; tags/moments. Note that chapters are
  1313. only parsed when input is seekable. Default is false.
  1314. </p>
  1315. </dd>
  1316. <dt><span><samp>use_mfra_for</samp></span></dt>
  1317. <dd><p>For seekable fragmented input, set fragment&rsquo;s starting timestamp from media fragment random access box, if present.
  1318. </p>
  1319. <p>Following options are available:
  1320. </p><dl compact="compact">
  1321. <dt><span>&lsquo;<samp>auto</samp>&rsquo;</span></dt>
  1322. <dd><p>Auto-detect whether to set mfra timestamps as PTS or DTS <em>(default)</em>
  1323. </p>
  1324. </dd>
  1325. <dt><span>&lsquo;<samp>dts</samp>&rsquo;</span></dt>
  1326. <dd><p>Set mfra timestamps as DTS
  1327. </p>
  1328. </dd>
  1329. <dt><span>&lsquo;<samp>pts</samp>&rsquo;</span></dt>
  1330. <dd><p>Set mfra timestamps as PTS
  1331. </p>
  1332. </dd>
  1333. <dt><span>&lsquo;<samp>0</samp>&rsquo;</span></dt>
  1334. <dd><p>Don&rsquo;t use mfra box to set timestamps
  1335. </p></dd>
  1336. </dl>
  1337. </dd>
  1338. <dt><span><samp>use_tfdt</samp></span></dt>
  1339. <dd><p>For fragmented input, set fragment&rsquo;s starting timestamp to <code>baseMediaDecodeTime</code> from the <code>tfdt</code> box.
  1340. Default is enabled, which will prefer to use the <code>tfdt</code> box to set DTS. Disable to use the <code>earliest_presentation_time</code> from the <code>sidx</code> box.
  1341. In either case, the timestamp from the <code>mfra</code> box will be used if it&rsquo;s available and <code>use_mfra_for</code> is
  1342. set to pts or dts.
  1343. </p>
  1344. </dd>
  1345. <dt><span><samp>export_all</samp></span></dt>
  1346. <dd><p>Export unrecognized boxes within the <var>udta</var> box as metadata entries. The first four
  1347. characters of the box type are set as the key. Default is false.
  1348. </p>
  1349. </dd>
  1350. <dt><span><samp>export_xmp</samp></span></dt>
  1351. <dd><p>Export entire contents of <var>XMP_</var> box and <var>uuid</var> box as a string with key <code>xmp</code>. Note that
  1352. if <code>export_all</code> is set and this option isn&rsquo;t, the contents of <var>XMP_</var> box are still exported
  1353. but with key <code>XMP_</code>. Default is false.
  1354. </p>
  1355. </dd>
  1356. <dt><span><samp>activation_bytes</samp></span></dt>
  1357. <dd><p>4-byte key required to decrypt Audible AAX and AAX+ files. See Audible AAX subsection below.
  1358. </p>
  1359. </dd>
  1360. <dt><span><samp>audible_fixed_key</samp></span></dt>
  1361. <dd><p>Fixed key used for handling Audible AAX/AAX+ files. It has been pre-set so should not be necessary to
  1362. specify.
  1363. </p>
  1364. </dd>
  1365. <dt><span><samp>decryption_key</samp></span></dt>
  1366. <dd><p>16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7).
  1367. </p>
  1368. </dd>
  1369. <dt><span><samp>max_stts_delta</samp></span></dt>
  1370. <dd><p>Very high sample deltas written in a trak&rsquo;s stts box may occasionally be intended but usually they are written in
  1371. error or used to store a negative value for dts correction when treated as signed 32-bit integers. This option lets
  1372. the user set an upper limit, beyond which the delta is clamped to 1. Values greater than the limit if negative when
  1373. cast to int32 are used to adjust onward dts.
  1374. </p>
  1375. <p>Unit is the track time scale. Range is 0 to UINT_MAX. Default is <code>UINT_MAX - 48000*10</code> which allows upto
  1376. a 10 second dts correction for 48 kHz audio streams while accommodating 99.9% of <code>uint32</code> range.
  1377. </p></dd>
  1378. </dl>
  1379. <a name="Audible-AAX"></a>
  1380. <h4 class="subsection">3.16.2 Audible AAX<span class="pull-right"><a class="anchor hidden-xs" href="#Audible-AAX" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Audible-AAX" aria-hidden="true">TOC</a></span></h4>
  1381. <p>Audible AAX files are encrypted M4B files, and they can be decrypted by specifying a 4 byte activation secret.
  1382. </p><div class="example">
  1383. <pre class="example">ffmpeg -activation_bytes 1CEB00DA -i test.aax -vn -c:a copy output.mp4
  1384. </pre></div>
  1385. <a name="mpegts"></a>
  1386. <h3 class="section">3.17 mpegts<span class="pull-right"><a class="anchor hidden-xs" href="#mpegts" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mpegts" aria-hidden="true">TOC</a></span></h3>
  1387. <p>MPEG-2 transport stream demuxer.
  1388. </p>
  1389. <p>This demuxer accepts the following options:
  1390. </p><dl compact="compact">
  1391. <dt><span><samp>resync_size</samp></span></dt>
  1392. <dd><p>Set size limit for looking up a new synchronization. Default value is
  1393. 65536.
  1394. </p>
  1395. </dd>
  1396. <dt><span><samp>skip_unknown_pmt</samp></span></dt>
  1397. <dd><p>Skip PMTs for programs not defined in the PAT. Default value is 0.
  1398. </p>
  1399. </dd>
  1400. <dt><span><samp>fix_teletext_pts</samp></span></dt>
  1401. <dd><p>Override teletext packet PTS and DTS values with the timestamps calculated
  1402. from the PCR of the first program which the teletext stream is part of and is
  1403. not discarded. Default value is 1, set this option to 0 if you want your
  1404. teletext packet PTS and DTS values untouched.
  1405. </p>
  1406. </dd>
  1407. <dt><span><samp>ts_packetsize</samp></span></dt>
  1408. <dd><p>Output option carrying the raw packet size in bytes.
  1409. Show the detected raw packet size, cannot be set by the user.
  1410. </p>
  1411. </dd>
  1412. <dt><span><samp>scan_all_pmts</samp></span></dt>
  1413. <dd><p>Scan and combine all PMTs. The value is an integer with value from -1
  1414. to 1 (-1 means automatic setting, 1 means enabled, 0 means
  1415. disabled). Default value is -1.
  1416. </p>
  1417. </dd>
  1418. <dt><span><samp>merge_pmt_versions</samp></span></dt>
  1419. <dd><p>Re-use existing streams when a PMT&rsquo;s version is updated and elementary
  1420. streams move to different PIDs. Default value is 0.
  1421. </p>
  1422. </dd>
  1423. <dt><span><samp>max_packet_size</samp></span></dt>
  1424. <dd><p>Set maximum size, in bytes, of packet emitted by the demuxer. Payloads above this size
  1425. are split across multiple packets. Range is 1 to INT_MAX/2. Default is 204800 bytes.
  1426. </p></dd>
  1427. </dl>
  1428. <a name="mpjpeg"></a>
  1429. <h3 class="section">3.18 mpjpeg<span class="pull-right"><a class="anchor hidden-xs" href="#mpjpeg" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mpjpeg" aria-hidden="true">TOC</a></span></h3>
  1430. <p>MJPEG encapsulated in multi-part MIME demuxer.
  1431. </p>
  1432. <p>This demuxer allows reading of MJPEG, where each frame is represented as a part of
  1433. multipart/x-mixed-replace stream.
  1434. </p><dl compact="compact">
  1435. <dt><span><samp>strict_mime_boundary</samp></span></dt>
  1436. <dd><p>Default implementation applies a relaxed standard to multi-part MIME boundary detection,
  1437. to prevent regression with numerous existing endpoints not generating a proper MIME
  1438. MJPEG stream. Turning this option on by setting it to 1 will result in a stricter check
  1439. of the boundary value.
  1440. </p></dd>
  1441. </dl>
  1442. <a name="rawvideo"></a>
  1443. <h3 class="section">3.19 rawvideo<span class="pull-right"><a class="anchor hidden-xs" href="#rawvideo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rawvideo" aria-hidden="true">TOC</a></span></h3>
  1444. <p>Raw video demuxer.
  1445. </p>
  1446. <p>This demuxer allows one to read raw video data. Since there is no header
  1447. specifying the assumed video parameters, the user must specify them
  1448. in order to be able to decode the data correctly.
  1449. </p>
  1450. <p>This demuxer accepts the following options:
  1451. </p><dl compact="compact">
  1452. <dt><span><samp>framerate</samp></span></dt>
  1453. <dd><p>Set input video frame rate. Default value is 25.
  1454. </p>
  1455. </dd>
  1456. <dt><span><samp>pixel_format</samp></span></dt>
  1457. <dd><p>Set the input video pixel format. Default value is <code>yuv420p</code>.
  1458. </p>
  1459. </dd>
  1460. <dt><span><samp>video_size</samp></span></dt>
  1461. <dd><p>Set the input video size. This value must be specified explicitly.
  1462. </p></dd>
  1463. </dl>
  1464. <p>For example to read a rawvideo file <samp>input.raw</samp> with
  1465. <code>ffplay</code>, assuming a pixel format of <code>rgb24</code>, a video
  1466. size of <code>320x240</code>, and a frame rate of 10 images per second, use
  1467. the command:
  1468. </p><div class="example">
  1469. <pre class="example">ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
  1470. </pre></div>
  1471. <a name="sbg"></a>
  1472. <h3 class="section">3.20 sbg<span class="pull-right"><a class="anchor hidden-xs" href="#sbg" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sbg" aria-hidden="true">TOC</a></span></h3>
  1473. <p>SBaGen script demuxer.
  1474. </p>
  1475. <p>This demuxer reads the script language used by SBaGen
  1476. <a href="http://uazu.net/sbagen/">http://uazu.net/sbagen/</a> to generate binaural beats sessions. A SBG
  1477. script looks like that:
  1478. </p><div class="example">
  1479. <pre class="example">-SE
  1480. a: 300-2.5/3 440+4.5/0
  1481. b: 300-2.5/0 440+4.5/3
  1482. off: -
  1483. NOW == a
  1484. +0:07:00 == b
  1485. +0:14:00 == a
  1486. +0:21:00 == b
  1487. +0:30:00 off
  1488. </pre></div>
  1489. <p>A SBG script can mix absolute and relative timestamps. If the script uses
  1490. either only absolute timestamps (including the script start time) or only
  1491. relative ones, then its layout is fixed, and the conversion is
  1492. straightforward. On the other hand, if the script mixes both kind of
  1493. timestamps, then the <var>NOW</var> reference for relative timestamps will be
  1494. taken from the current time of day at the time the script is read, and the
  1495. script layout will be frozen according to that reference. That means that if
  1496. the script is directly played, the actual times will match the absolute
  1497. timestamps up to the sound controller&rsquo;s clock accuracy, but if the user
  1498. somehow pauses the playback or seeks, all times will be shifted accordingly.
  1499. </p>
  1500. <a name="tedcaptions"></a>
  1501. <h3 class="section">3.21 tedcaptions<span class="pull-right"><a class="anchor hidden-xs" href="#tedcaptions" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tedcaptions" aria-hidden="true">TOC</a></span></h3>
  1502. <p>JSON captions used for <a href="http://www.ted.com/">TED Talks</a>.
  1503. </p>
  1504. <p>TED does not provide links to the captions, but they can be guessed from the
  1505. page. The file <samp>tools/bookmarklets.html</samp> from the FFmpeg source tree
  1506. contains a bookmarklet to expose them.
  1507. </p>
  1508. <p>This demuxer accepts the following option:
  1509. </p><dl compact="compact">
  1510. <dt><span><samp>start_time</samp></span></dt>
  1511. <dd><p>Set the start time of the TED talk, in milliseconds. The default is 15000
  1512. (15s). It is used to sync the captions with the downloadable videos, because
  1513. they include a 15s intro.
  1514. </p></dd>
  1515. </dl>
  1516. <p>Example: convert the captions to a format most players understand:
  1517. </p><div class="example">
  1518. <pre class="example">ffmpeg -i http://www.ted.com/talks/subtitles/id/1/lang/en talk1-en.srt
  1519. </pre></div>
  1520. <a name="vapoursynth"></a>
  1521. <h3 class="section">3.22 vapoursynth<span class="pull-right"><a class="anchor hidden-xs" href="#vapoursynth" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vapoursynth" aria-hidden="true">TOC</a></span></h3>
  1522. <p>Vapoursynth wrapper.
  1523. </p>
  1524. <p>Due to security concerns, Vapoursynth scripts will not
  1525. be autodetected so the input format has to be forced. For ff* CLI tools,
  1526. add <code>-f vapoursynth</code> before the input <code>-i yourscript.vpy</code>.
  1527. </p>
  1528. <p>This demuxer accepts the following option:
  1529. </p><dl compact="compact">
  1530. <dt><span><samp>max_script_size</samp></span></dt>
  1531. <dd><p>The demuxer buffers the entire script into memory. Adjust this value to set the maximum buffer size,
  1532. which in turn, acts as a ceiling for the size of scripts that can be read.
  1533. Default is 1 MiB.
  1534. </p></dd>
  1535. </dl>
  1536. <a name="Muxers"></a>
  1537. <h2 class="chapter">4 Muxers<span class="pull-right"><a class="anchor hidden-xs" href="#Muxers" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Muxers" aria-hidden="true">TOC</a></span></h2>
  1538. <p>Muxers are configured elements in FFmpeg which allow writing
  1539. multimedia streams to a particular type of file.
  1540. </p>
  1541. <p>When you configure your FFmpeg build, all the supported muxers
  1542. are enabled by default. You can list all available muxers using the
  1543. configure option <code>--list-muxers</code>.
  1544. </p>
  1545. <p>You can disable all the muxers with the configure option
  1546. <code>--disable-muxers</code> and selectively enable / disable single muxers
  1547. with the options <code>--enable-muxer=<var>MUXER</var></code> /
  1548. <code>--disable-muxer=<var>MUXER</var></code>.
  1549. </p>
  1550. <p>The option <code>-muxers</code> of the ff* tools will display the list of
  1551. enabled muxers. Use <code>-formats</code> to view a combined list of
  1552. enabled demuxers and muxers.
  1553. </p>
  1554. <p>A description of some of the currently available muxers follows.
  1555. </p>
  1556. <span id="a64"></span><a name="a64-1"></a>
  1557. <h3 class="section">4.1 a64<span class="pull-right"><a class="anchor hidden-xs" href="#a64-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-a64-1" aria-hidden="true">TOC</a></span></h3>
  1558. <p>A64 muxer for Commodore 64 video. Accepts a single <code>a64_multi</code> or <code>a64_multi5</code> codec video stream.
  1559. </p>
  1560. <span id="adts"></span><a name="adts-1"></a>
  1561. <h3 class="section">4.2 adts<span class="pull-right"><a class="anchor hidden-xs" href="#adts-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adts-1" aria-hidden="true">TOC</a></span></h3>
  1562. <p>Audio Data Transport Stream muxer. It accepts a single AAC stream.
  1563. </p>
  1564. <a name="Options-4"></a>
  1565. <h4 class="subsection">4.2.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-4" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-4" aria-hidden="true">TOC</a></span></h4>
  1566. <p>It accepts the following options:
  1567. </p>
  1568. <dl compact="compact">
  1569. <dt><span><samp>write_id3v2 <var>bool</var></samp></span></dt>
  1570. <dd><p>Enable to write ID3v2.4 tags at the start of the stream. Default is disabled.
  1571. </p>
  1572. </dd>
  1573. <dt><span><samp>write_apetag <var>bool</var></samp></span></dt>
  1574. <dd><p>Enable to write APE tags at the end of the stream. Default is disabled.
  1575. </p>
  1576. </dd>
  1577. <dt><span><samp>write_mpeg2 <var>bool</var></samp></span></dt>
  1578. <dd><p>Enable to set MPEG version bit in the ADTS frame header to 1 which indicates MPEG-2. Default is 0, which indicates MPEG-4.
  1579. </p>
  1580. </dd>
  1581. </dl>
  1582. <span id="aiff"></span><a name="aiff-1"></a>
  1583. <h3 class="section">4.3 aiff<span class="pull-right"><a class="anchor hidden-xs" href="#aiff-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aiff-1" aria-hidden="true">TOC</a></span></h3>
  1584. <p>Audio Interchange File Format muxer.
  1585. </p>
  1586. <a name="Options-5"></a>
  1587. <h4 class="subsection">4.3.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-5" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-5" aria-hidden="true">TOC</a></span></h4>
  1588. <p>It accepts the following options:
  1589. </p>
  1590. <dl compact="compact">
  1591. <dt><span><samp>write_id3v2</samp></span></dt>
  1592. <dd><p>Enable ID3v2 tags writing when set to 1. Default is 0 (disabled).
  1593. </p>
  1594. </dd>
  1595. <dt><span><samp>id3v2_version</samp></span></dt>
  1596. <dd><p>Select ID3v2 version to write. Currently only version 3 and 4 (aka.
  1597. ID3v2.3 and ID3v2.4) are supported. The default is version 4.
  1598. </p>
  1599. </dd>
  1600. </dl>
  1601. <span id="alp"></span><a name="alp-1"></a>
  1602. <h3 class="section">4.4 alp<span class="pull-right"><a class="anchor hidden-xs" href="#alp-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-alp-1" aria-hidden="true">TOC</a></span></h3>
  1603. <p>Muxer for audio of High Voltage Software&rsquo;s Lego Racers game. It accepts a single ADPCM_IMA_ALP stream
  1604. with no more than 2 channels nor a sample rate greater than 44100 Hz.
  1605. </p>
  1606. <p>Extensions: tun, pcm
  1607. </p>
  1608. <a name="Options-6"></a>
  1609. <h4 class="subsection">4.4.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-6" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-6" aria-hidden="true">TOC</a></span></h4>
  1610. <p>It accepts the following options:
  1611. </p>
  1612. <dl compact="compact">
  1613. <dt><span><samp>type <var>type</var></samp></span></dt>
  1614. <dd><p>Set file type.
  1615. </p>
  1616. <dl compact="compact">
  1617. <dt><span>&lsquo;<samp>tun</samp>&rsquo;</span></dt>
  1618. <dd><p>Set file type as music. Must have a sample rate of 22050 Hz.
  1619. </p>
  1620. </dd>
  1621. <dt><span>&lsquo;<samp>pcm</samp>&rsquo;</span></dt>
  1622. <dd><p>Set file type as sfx.
  1623. </p>
  1624. </dd>
  1625. <dt><span>&lsquo;<samp>auto</samp>&rsquo;</span></dt>
  1626. <dd><p>Set file type as per output file extension. <code>.pcm</code> results in type <code>pcm</code> else type <code>tun</code> is set. <var>(default)</var>
  1627. </p>
  1628. </dd>
  1629. </dl>
  1630. </dd>
  1631. </dl>
  1632. <span id="asf"></span><a name="asf-2"></a>
  1633. <h3 class="section">4.5 asf<span class="pull-right"><a class="anchor hidden-xs" href="#asf-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asf-2" aria-hidden="true">TOC</a></span></h3>
  1634. <p>Advanced Systems Format muxer.
  1635. </p>
  1636. <p>Note that Windows Media Audio (wma) and Windows Media Video (wmv) use this
  1637. muxer too.
  1638. </p>
  1639. <a name="Options-7"></a>
  1640. <h4 class="subsection">4.5.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-7" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-7" aria-hidden="true">TOC</a></span></h4>
  1641. <p>It accepts the following options:
  1642. </p>
  1643. <dl compact="compact">
  1644. <dt><span><samp>packet_size</samp></span></dt>
  1645. <dd><p>Set the muxer packet size. By tuning this setting you may reduce data
  1646. fragmentation or muxer overhead depending on your source. Default value is
  1647. 3200, minimum is 100, maximum is 64k.
  1648. </p>
  1649. </dd>
  1650. </dl>
  1651. <span id="avi"></span><a name="avi-1"></a>
  1652. <h3 class="section">4.6 avi<span class="pull-right"><a class="anchor hidden-xs" href="#avi-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-avi-1" aria-hidden="true">TOC</a></span></h3>
  1653. <p>Audio Video Interleaved muxer.
  1654. </p>
  1655. <a name="Options-8"></a>
  1656. <h4 class="subsection">4.6.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-8" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-8" aria-hidden="true">TOC</a></span></h4>
  1657. <p>It accepts the following options:
  1658. </p>
  1659. <dl compact="compact">
  1660. <dt><span><samp>reserve_index_space</samp></span></dt>
  1661. <dd><p>Reserve the specified amount of bytes for the OpenDML master index of each
  1662. stream within the file header. By default additional master indexes are
  1663. embedded within the data packets if there is no space left in the first master
  1664. index and are linked together as a chain of indexes. This index structure can
  1665. cause problems for some use cases, e.g. third-party software strictly relying
  1666. on the OpenDML index specification or when file seeking is slow. Reserving
  1667. enough index space in the file header avoids these problems.
  1668. </p>
  1669. <p>The required index space depends on the output file size and should be about 16
  1670. bytes per gigabyte. When this option is omitted or set to zero the necessary
  1671. index space is guessed.
  1672. </p>
  1673. </dd>
  1674. <dt><span><samp>write_channel_mask</samp></span></dt>
  1675. <dd><p>Write the channel layout mask into the audio stream header.
  1676. </p>
  1677. <p>This option is enabled by default. Disabling the channel mask can be useful in
  1678. specific scenarios, e.g. when merging multiple audio streams into one for
  1679. compatibility with software that only supports a single audio stream in AVI
  1680. (see <a data-manual="ffmpeg-filters" href="ffmpeg-filters.html#amerge">(ffmpeg-filters)the &quot;amerge&quot; section in the ffmpeg-filters manual</a>).
  1681. </p>
  1682. </dd>
  1683. <dt><span><samp>flipped_raw_rgb</samp></span></dt>
  1684. <dd><p>If set to true, store positive height for raw RGB bitmaps, which indicates
  1685. bitmap is stored bottom-up. Note that this option does not flip the bitmap
  1686. which has to be done manually beforehand, e.g. by using the vflip filter.
  1687. Default is <var>false</var> and indicates bitmap is stored top down.
  1688. </p>
  1689. </dd>
  1690. </dl>
  1691. <span id="chromaprint"></span><a name="chromaprint-1"></a>
  1692. <h3 class="section">4.7 chromaprint<span class="pull-right"><a class="anchor hidden-xs" href="#chromaprint-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chromaprint-1" aria-hidden="true">TOC</a></span></h3>
  1693. <p>Chromaprint fingerprinter.
  1694. </p>
  1695. <p>This muxer feeds audio data to the Chromaprint library,
  1696. which generates a fingerprint for the provided audio data. See <a href="https://acoustid.org/chromaprint">https://acoustid.org/chromaprint</a>
  1697. </p>
  1698. <p>It takes a single signed native-endian 16-bit raw audio stream of at most 2 channels.
  1699. </p>
  1700. <a name="Options-9"></a>
  1701. <h4 class="subsection">4.7.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-9" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-9" aria-hidden="true">TOC</a></span></h4>
  1702. <dl compact="compact">
  1703. <dt><span><samp>silence_threshold</samp></span></dt>
  1704. <dd><p>Threshold for detecting silence. Range is from -1 to 32767, where -1 disables
  1705. silence detection. Silence detection can only be used with version 3 of the
  1706. algorithm.
  1707. Silence detection must be disabled for use with the AcoustID service. Default is -1.
  1708. </p>
  1709. </dd>
  1710. <dt><span><samp>algorithm</samp></span></dt>
  1711. <dd><p>Version of algorithm to fingerprint with. Range is 0 to 4.
  1712. Version 3 enables silence detection. Default is 1.
  1713. </p>
  1714. </dd>
  1715. <dt><span><samp>fp_format</samp></span></dt>
  1716. <dd><p>Format to output the fingerprint as. Accepts the following options:
  1717. </p><dl compact="compact">
  1718. <dt><span>&lsquo;<samp>raw</samp>&rsquo;</span></dt>
  1719. <dd><p>Binary raw fingerprint
  1720. </p>
  1721. </dd>
  1722. <dt><span>&lsquo;<samp>compressed</samp>&rsquo;</span></dt>
  1723. <dd><p>Binary compressed fingerprint
  1724. </p>
  1725. </dd>
  1726. <dt><span>&lsquo;<samp>base64</samp>&rsquo;</span></dt>
  1727. <dd><p>Base64 compressed fingerprint <em>(default)</em>
  1728. </p>
  1729. </dd>
  1730. </dl>
  1731. </dd>
  1732. </dl>
  1733. <span id="crc"></span><a name="crc-1"></a>
  1734. <h3 class="section">4.8 crc<span class="pull-right"><a class="anchor hidden-xs" href="#crc-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-crc-1" aria-hidden="true">TOC</a></span></h3>
  1735. <p>CRC (Cyclic Redundancy Check) testing format.
  1736. </p>
  1737. <p>This muxer computes and prints the Adler-32 CRC of all the input audio
  1738. and video frames. By default audio frames are converted to signed
  1739. 16-bit raw audio and video frames to raw video before computing the
  1740. CRC.
  1741. </p>
  1742. <p>The output of the muxer consists of a single line of the form:
  1743. CRC=0x<var>CRC</var>, where <var>CRC</var> is a hexadecimal number 0-padded to
  1744. 8 digits containing the CRC for all the decoded input frames.
  1745. </p>
  1746. <p>See also the <a href="#framecrc">framecrc</a> muxer.
  1747. </p>
  1748. <a name="Examples-2"></a>
  1749. <h4 class="subsection">4.8.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-2" aria-hidden="true">TOC</a></span></h4>
  1750. <p>For example to compute the CRC of the input, and store it in the file
  1751. <samp>out.crc</samp>:
  1752. </p><div class="example">
  1753. <pre class="example">ffmpeg -i INPUT -f crc out.crc
  1754. </pre></div>
  1755. <p>You can print the CRC to stdout with the command:
  1756. </p><div class="example">
  1757. <pre class="example">ffmpeg -i INPUT -f crc -
  1758. </pre></div>
  1759. <p>You can select the output format of each frame with <code>ffmpeg</code> by
  1760. specifying the audio and video codec and format. For example to
  1761. compute the CRC of the input audio converted to PCM unsigned 8-bit
  1762. and the input video converted to MPEG-2 video, use the command:
  1763. </p><div class="example">
  1764. <pre class="example">ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f crc -
  1765. </pre></div>
  1766. <span id="dash"></span><a name="dash-2"></a>
  1767. <h3 class="section">4.9 dash<span class="pull-right"><a class="anchor hidden-xs" href="#dash-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dash-2" aria-hidden="true">TOC</a></span></h3>
  1768. <p>Dynamic Adaptive Streaming over HTTP (DASH) muxer that creates segments
  1769. and manifest files according to the MPEG-DASH standard ISO/IEC 23009-1:2014.
  1770. </p>
  1771. <p>For more information see:
  1772. </p>
  1773. <ul>
  1774. <li> ISO DASH Specification: <a href="http://standards.iso.org/ittf/PubliclyAvailableStandards/c065274_ISO_IEC_23009-1_2014.zip">http://standards.iso.org/ittf/PubliclyAvailableStandards/c065274_ISO_IEC_23009-1_2014.zip</a>
  1775. </li><li> WebM DASH Specification: <a href="https://sites.google.com/a/webmproject.org/wiki/adaptive-streaming/webm-dash-specification">https://sites.google.com/a/webmproject.org/wiki/adaptive-streaming/webm-dash-specification</a>
  1776. </li></ul>
  1777. <p>It creates a MPD manifest file and segment files for each stream.
  1778. </p>
  1779. <p>The segment filename might contain pre-defined identifiers used with SegmentTemplate
  1780. as defined in section 5.3.9.4.4 of the standard. Available identifiers are &quot;$RepresentationID$&quot;,
  1781. &quot;$Number$&quot;, &quot;$Bandwidth$&quot; and &quot;$Time$&quot;.
  1782. In addition to the standard identifiers, an ffmpeg-specific &quot;$ext$&quot; identifier is also supported.
  1783. When specified ffmpeg will replace $ext$ in the file name with muxing format&rsquo;s extensions such as mp4, webm etc.,
  1784. </p>
  1785. <div class="example">
  1786. <pre class="example">ffmpeg -re -i &lt;input&gt; -map 0 -map 0 -c:a libfdk_aac -c:v libx264 \
  1787. -b:v:0 800k -b:v:1 300k -s:v:1 320x170 -profile:v:1 baseline \
  1788. -profile:v:0 main -bf 1 -keyint_min 120 -g 120 -sc_threshold 0 \
  1789. -b_strategy 0 -ar:a:1 22050 -use_timeline 1 -use_template 1 \
  1790. -window_size 5 -adaptation_sets &quot;id=0,streams=v id=1,streams=a&quot; \
  1791. -f dash /path/to/out.mpd
  1792. </pre></div>
  1793. <dl compact="compact">
  1794. <dt><span><samp>seg_duration <var>duration</var></samp></span></dt>
  1795. <dd><p>Set the segment length in seconds (fractional value can be set). The value is
  1796. treated as average segment duration when <var>use_template</var> is enabled and
  1797. <var>use_timeline</var> is disabled and as minimum segment duration for all the other
  1798. use cases.
  1799. </p></dd>
  1800. <dt><span><samp>frag_duration <var>duration</var></samp></span></dt>
  1801. <dd><p>Set the length in seconds of fragments within segments (fractional value can be set).
  1802. </p></dd>
  1803. <dt><span><samp>frag_type <var>type</var></samp></span></dt>
  1804. <dd><p>Set the type of interval for fragmentation.
  1805. </p></dd>
  1806. <dt><span><samp>window_size <var>size</var></samp></span></dt>
  1807. <dd><p>Set the maximum number of segments kept in the manifest.
  1808. </p></dd>
  1809. <dt><span><samp>extra_window_size <var>size</var></samp></span></dt>
  1810. <dd><p>Set the maximum number of segments kept outside of the manifest before removing from disk.
  1811. </p></dd>
  1812. <dt><span><samp>remove_at_exit <var>remove</var></samp></span></dt>
  1813. <dd><p>Enable (1) or disable (0) removal of all segments when finished.
  1814. </p></dd>
  1815. <dt><span><samp>use_template <var>template</var></samp></span></dt>
  1816. <dd><p>Enable (1) or disable (0) use of SegmentTemplate instead of SegmentList.
  1817. </p></dd>
  1818. <dt><span><samp>use_timeline <var>timeline</var></samp></span></dt>
  1819. <dd><p>Enable (1) or disable (0) use of SegmentTimeline in SegmentTemplate.
  1820. </p></dd>
  1821. <dt><span><samp>single_file <var>single_file</var></samp></span></dt>
  1822. <dd><p>Enable (1) or disable (0) storing all segments in one file, accessed using byte ranges.
  1823. </p></dd>
  1824. <dt><span><samp>single_file_name <var>file_name</var></samp></span></dt>
  1825. <dd><p>DASH-templated name to be used for baseURL. Implies <var>single_file</var> set to &quot;1&quot;. In the template, &quot;$ext$&quot; is replaced with the file name extension specific for the segment format.
  1826. </p></dd>
  1827. <dt><span><samp>init_seg_name <var>init_name</var></samp></span></dt>
  1828. <dd><p>DASH-templated name to used for the initialization segment. Default is &quot;init-stream$RepresentationID$.$ext$&quot;. &quot;$ext$&quot; is replaced with the file name extension specific for the segment format.
  1829. </p></dd>
  1830. <dt><span><samp>media_seg_name <var>segment_name</var></samp></span></dt>
  1831. <dd><p>DASH-templated name to used for the media segments. Default is &quot;chunk-stream$RepresentationID$-$Number%05d$.$ext$&quot;. &quot;$ext$&quot; is replaced with the file name extension specific for the segment format.
  1832. </p></dd>
  1833. <dt><span><samp>utc_timing_url <var>utc_url</var></samp></span></dt>
  1834. <dd><p>URL of the page that will return the UTC timestamp in ISO format. Example: &quot;https://time.akamai.com/?iso&quot;
  1835. </p></dd>
  1836. <dt><span><samp>method <var>method</var></samp></span></dt>
  1837. <dd><p>Use the given HTTP method to create output files. Generally set to PUT or POST.
  1838. </p></dd>
  1839. <dt><span><samp>http_user_agent <var>user_agent</var></samp></span></dt>
  1840. <dd><p>Override User-Agent field in HTTP header. Applicable only for HTTP output.
  1841. </p></dd>
  1842. <dt><span><samp>http_persistent <var>http_persistent</var></samp></span></dt>
  1843. <dd><p>Use persistent HTTP connections. Applicable only for HTTP output.
  1844. </p></dd>
  1845. <dt><span><samp>hls_playlist <var>hls_playlist</var></samp></span></dt>
  1846. <dd><p>Generate HLS playlist files as well. The master playlist is generated with the filename <var>hls_master_name</var>.
  1847. One media playlist file is generated for each stream with filenames media_0.m3u8, media_1.m3u8, etc.
  1848. </p></dd>
  1849. <dt><span><samp>hls_master_name <var>file_name</var></samp></span></dt>
  1850. <dd><p>HLS master playlist name. Default is &quot;master.m3u8&quot;.
  1851. </p></dd>
  1852. <dt><span><samp>streaming <var>streaming</var></samp></span></dt>
  1853. <dd><p>Enable (1) or disable (0) chunk streaming mode of output. In chunk streaming
  1854. mode, each frame will be a moof fragment which forms a chunk.
  1855. </p></dd>
  1856. <dt><span><samp>adaptation_sets <var>adaptation_sets</var></samp></span></dt>
  1857. <dd><p>Assign streams to AdaptationSets. Syntax is &quot;id=x,streams=a,b,c id=y,streams=d,e&quot; with x and y being the IDs
  1858. of the adaptation sets and a,b,c,d and e are the indices of the mapped streams.
  1859. </p>
  1860. <p>To map all video (or audio) streams to an AdaptationSet, &quot;v&quot; (or &quot;a&quot;) can be used as stream identifier instead of IDs.
  1861. </p>
  1862. <p>When no assignment is defined, this defaults to an AdaptationSet for each stream.
  1863. </p>
  1864. <p>Optional syntax is &quot;id=x,seg_duration=x,frag_duration=x,frag_type=type,descriptor=descriptor_string,streams=a,b,c id=y,seg_duration=y,frag_type=type,streams=d,e&quot; and so on,
  1865. descriptor is useful to the scheme defined by ISO/IEC 23009-1:2014/Amd.2:2015.
  1866. For example, -adaptation_sets &quot;id=0,descriptor=&lt;SupplementalProperty schemeIdUri=\&quot;urn:mpeg:dash:srd:2014\&quot; value=\&quot;0,0,0,1,1,2,2\&quot;/&gt;,streams=v&quot;.
  1867. Please note that descriptor string should be a self-closing xml tag.
  1868. seg_duration, frag_duration and frag_type override the global option values for each adaptation set.
  1869. For example, -adaptation_sets &quot;id=0,seg_duration=2,frag_duration=1,frag_type=duration,streams=v id=1,seg_duration=2,frag_type=none,streams=a&quot;
  1870. type_id marks an adaptation set as containing streams meant to be used for Trick Mode for the referenced adaptation set.
  1871. For example, -adaptation_sets &quot;id=0,seg_duration=2,frag_type=none,streams=0 id=1,seg_duration=10,frag_type=none,trick_id=0,streams=1&quot;
  1872. </p></dd>
  1873. <dt><span><samp>timeout <var>timeout</var></samp></span></dt>
  1874. <dd><p>Set timeout for socket I/O operations. Applicable only for HTTP output.
  1875. </p></dd>
  1876. <dt><span><samp>index_correction <var>index_correction</var></samp></span></dt>
  1877. <dd><p>Enable (1) or Disable (0) segment index correction logic. Applicable only when
  1878. <var>use_template</var> is enabled and <var>use_timeline</var> is disabled.
  1879. </p>
  1880. <p>When enabled, the logic monitors the flow of segment indexes. If a streams&rsquo;s
  1881. segment index value is not at the expected real time position, then the logic
  1882. corrects that index value.
  1883. </p>
  1884. <p>Typically this logic is needed in live streaming use cases. The network bandwidth
  1885. fluctuations are common during long run streaming. Each fluctuation can cause
  1886. the segment indexes fall behind the expected real time position.
  1887. </p></dd>
  1888. <dt><span><samp>format_options <var>options_list</var></samp></span></dt>
  1889. <dd><p>Set container format (mp4/webm) options using a <code>:</code> separated list of
  1890. key=value parameters. Values containing <code>:</code> special characters must be
  1891. escaped.
  1892. </p>
  1893. </dd>
  1894. <dt><span><samp>global_sidx <var>global_sidx</var></samp></span></dt>
  1895. <dd><p>Write global SIDX atom. Applicable only for single file, mp4 output, non-streaming mode.
  1896. </p>
  1897. </dd>
  1898. <dt><span><samp>dash_segment_type <var>dash_segment_type</var></samp></span></dt>
  1899. <dd><p>Possible values:
  1900. </p><dl compact="compact">
  1901. <dt><span><samp>auto</samp></span></dt>
  1902. <dd><p>If this flag is set, the dash segment files format will be selected based on the stream codec. This is the default mode.
  1903. </p>
  1904. </dd>
  1905. <dt><span><samp>mp4</samp></span></dt>
  1906. <dd><p>If this flag is set, the dash segment files will be in in ISOBMFF format.
  1907. </p>
  1908. </dd>
  1909. <dt><span><samp>webm</samp></span></dt>
  1910. <dd><p>If this flag is set, the dash segment files will be in in WebM format.
  1911. </p></dd>
  1912. </dl>
  1913. </dd>
  1914. <dt><span><samp>ignore_io_errors <var>ignore_io_errors</var></samp></span></dt>
  1915. <dd><p>Ignore IO errors during open and write. Useful for long-duration runs with network output.
  1916. </p>
  1917. </dd>
  1918. <dt><span><samp>lhls <var>lhls</var></samp></span></dt>
  1919. <dd><p>Enable Low-latency HLS(LHLS). Adds #EXT-X-PREFETCH tag with current segment&rsquo;s URI.
  1920. hls.js player folks are trying to standardize an open LHLS spec. The draft spec is available in https://github.com/video-dev/hlsjs-rfcs/blob/lhls-spec/proposals/0001-lhls.md
  1921. This option tries to comply with the above open spec.
  1922. It enables <var>streaming</var> and <var>hls_playlist</var> options automatically.
  1923. This is an experimental feature.
  1924. </p>
  1925. <p>Note: This is not Apple&rsquo;s version LHLS. See <a href="https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis">https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis</a>
  1926. </p>
  1927. </dd>
  1928. <dt><span><samp>ldash <var>ldash</var></samp></span></dt>
  1929. <dd><p>Enable Low-latency Dash by constraining the presence and values of some elements.
  1930. </p>
  1931. </dd>
  1932. <dt><span><samp>master_m3u8_publish_rate <var>master_m3u8_publish_rate</var></samp></span></dt>
  1933. <dd><p>Publish master playlist repeatedly every after specified number of segment intervals.
  1934. </p>
  1935. </dd>
  1936. <dt><span><samp>write_prft <var>write_prft</var></samp></span></dt>
  1937. <dd><p>Write Producer Reference Time elements on supported streams. This also enables writing
  1938. prft boxes in the underlying muxer. Applicable only when the <var>utc_url</var> option is enabled.
  1939. It&rsquo;s set to auto by default, in which case the muxer will attempt to enable it only in modes
  1940. that require it.
  1941. </p>
  1942. </dd>
  1943. <dt><span><samp>mpd_profile <var>mpd_profile</var></samp></span></dt>
  1944. <dd><p>Set one or more manifest profiles.
  1945. </p>
  1946. </dd>
  1947. <dt><span><samp>http_opts <var>http_opts</var></samp></span></dt>
  1948. <dd><p>A :-separated list of key=value options to pass to the underlying HTTP
  1949. protocol. Applicable only for HTTP output.
  1950. </p>
  1951. </dd>
  1952. <dt><span><samp>target_latency <var>target_latency</var></samp></span></dt>
  1953. <dd><p>Set an intended target latency in seconds (fractional value can be set) for serving. Applicable only when <var>streaming</var> and <var>write_prft</var> options are enabled.
  1954. This is an informative fields clients can use to measure the latency of the service.
  1955. </p>
  1956. </dd>
  1957. <dt><span><samp>min_playback_rate <var>min_playback_rate</var></samp></span></dt>
  1958. <dd><p>Set the minimum playback rate indicated as appropriate for the purposes of automatically
  1959. adjusting playback latency and buffer occupancy during normal playback by clients.
  1960. </p>
  1961. </dd>
  1962. <dt><span><samp>max_playback_rate <var>max_playback_rate</var></samp></span></dt>
  1963. <dd><p>Set the maximum playback rate indicated as appropriate for the purposes of automatically
  1964. adjusting playback latency and buffer occupancy during normal playback by clients.
  1965. </p>
  1966. </dd>
  1967. <dt><span><samp>update_period <var>update_period</var></samp></span></dt>
  1968. <dd><p>Set the mpd update period ,for dynamic content.
  1969. The unit is second.
  1970. </p>
  1971. </dd>
  1972. </dl>
  1973. <span id="fifo"></span><a name="fifo-1"></a>
  1974. <h3 class="section">4.10 fifo<span class="pull-right"><a class="anchor hidden-xs" href="#fifo-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fifo-1" aria-hidden="true">TOC</a></span></h3>
  1975. <p>The fifo pseudo-muxer allows the separation of encoding and muxing by using
  1976. first-in-first-out queue and running the actual muxer in a separate thread. This
  1977. is especially useful in combination with the <a href="#tee">tee</a> muxer and can be used to
  1978. send data to several destinations with different reliability/writing speed/latency.
  1979. </p>
  1980. <p>API users should be aware that callback functions (interrupt_callback,
  1981. io_open and io_close) used within its AVFormatContext must be thread-safe.
  1982. </p>
  1983. <p>The behavior of the fifo muxer if the queue fills up or if the output fails is
  1984. selectable,
  1985. </p>
  1986. <ul>
  1987. <li> output can be transparently restarted with configurable delay between retries
  1988. based on real time or time of the processed stream.
  1989. </li><li> encoding can be blocked during temporary failure, or continue transparently
  1990. dropping packets in case fifo queue fills up.
  1991. </li></ul>
  1992. <dl compact="compact">
  1993. <dt><span><samp>fifo_format</samp></span></dt>
  1994. <dd><p>Specify the format name. Useful if it cannot be guessed from the
  1995. output name suffix.
  1996. </p>
  1997. </dd>
  1998. <dt><span><samp>queue_size</samp></span></dt>
  1999. <dd><p>Specify size of the queue (number of packets). Default value is 60.
  2000. </p>
  2001. </dd>
  2002. <dt><span><samp>format_opts</samp></span></dt>
  2003. <dd><p>Specify format options for the underlying muxer. Muxer options can be specified
  2004. as a list of <var>key</var>=<var>value</var> pairs separated by &rsquo;:&rsquo;.
  2005. </p>
  2006. </dd>
  2007. <dt><span><samp>drop_pkts_on_overflow <var>bool</var></samp></span></dt>
  2008. <dd><p>If set to 1 (true), in case the fifo queue fills up, packets will be dropped
  2009. rather than blocking the encoder. This makes it possible to continue streaming without
  2010. delaying the input, at the cost of omitting part of the stream. By default
  2011. this option is set to 0 (false), so in such cases the encoder will be blocked
  2012. until the muxer processes some of the packets and none of them is lost.
  2013. </p>
  2014. </dd>
  2015. <dt><span><samp>attempt_recovery <var>bool</var></samp></span></dt>
  2016. <dd><p>If failure occurs, attempt to recover the output. This is especially useful
  2017. when used with network output, since it makes it possible to restart streaming transparently.
  2018. By default this option is set to 0 (false).
  2019. </p>
  2020. </dd>
  2021. <dt><span><samp>max_recovery_attempts</samp></span></dt>
  2022. <dd><p>Sets maximum number of successive unsuccessful recovery attempts after which
  2023. the output fails permanently. By default this option is set to 0 (unlimited).
  2024. </p>
  2025. </dd>
  2026. <dt><span><samp>recovery_wait_time <var>duration</var></samp></span></dt>
  2027. <dd><p>Waiting time before the next recovery attempt after previous unsuccessful
  2028. recovery attempt. Default value is 5 seconds.
  2029. </p>
  2030. </dd>
  2031. <dt><span><samp>recovery_wait_streamtime <var>bool</var></samp></span></dt>
  2032. <dd><p>If set to 0 (false), the real time is used when waiting for the recovery
  2033. attempt (i.e. the recovery will be attempted after at least
  2034. recovery_wait_time seconds).
  2035. If set to 1 (true), the time of the processed stream is taken into account
  2036. instead (i.e. the recovery will be attempted after at least <var>recovery_wait_time</var>
  2037. seconds of the stream is omitted).
  2038. By default, this option is set to 0 (false).
  2039. </p>
  2040. </dd>
  2041. <dt><span><samp>recover_any_error <var>bool</var></samp></span></dt>
  2042. <dd><p>If set to 1 (true), recovery will be attempted regardless of type of the error
  2043. causing the failure. By default this option is set to 0 (false) and in case of
  2044. certain (usually permanent) errors the recovery is not attempted even when
  2045. <var>attempt_recovery</var> is set to 1.
  2046. </p>
  2047. </dd>
  2048. <dt><span><samp>restart_with_keyframe <var>bool</var></samp></span></dt>
  2049. <dd><p>Specify whether to wait for the keyframe after recovering from
  2050. queue overflow or failure. This option is set to 0 (false) by default.
  2051. </p>
  2052. </dd>
  2053. <dt><span><samp>timeshift <var>duration</var></samp></span></dt>
  2054. <dd><p>Buffer the specified amount of packets and delay writing the output. Note that
  2055. <var>queue_size</var> must be big enough to store the packets for timeshift. At the
  2056. end of the input the fifo buffer is flushed at realtime speed.
  2057. </p>
  2058. </dd>
  2059. </dl>
  2060. <a name="Examples-3"></a>
  2061. <h4 class="subsection">4.10.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-3" aria-hidden="true">TOC</a></span></h4>
  2062. <ul>
  2063. <li> Stream something to rtmp server, continue processing the stream at real-time
  2064. rate even in case of temporary failure (network outage) and attempt to recover
  2065. streaming every second indefinitely.
  2066. <div class="example">
  2067. <pre class="example">ffmpeg -re -i ... -c:v libx264 -c:a aac -f fifo -fifo_format flv -map 0:v -map 0:a
  2068. -drop_pkts_on_overflow 1 -attempt_recovery 1 -recovery_wait_time 1 rtmp://example.com/live/stream_name
  2069. </pre></div>
  2070. </li></ul>
  2071. <a name="flv"></a>
  2072. <h3 class="section">4.11 flv<span class="pull-right"><a class="anchor hidden-xs" href="#flv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-flv" aria-hidden="true">TOC</a></span></h3>
  2073. <p>Adobe Flash Video Format muxer.
  2074. </p>
  2075. <p>This muxer accepts the following options:
  2076. </p>
  2077. <dl compact="compact">
  2078. <dt><span><samp>flvflags <var>flags</var></samp></span></dt>
  2079. <dd><p>Possible values:
  2080. </p>
  2081. <dl compact="compact">
  2082. <dt><span>&lsquo;<samp>aac_seq_header_detect</samp>&rsquo;</span></dt>
  2083. <dd><p>Place AAC sequence header based on audio stream data.
  2084. </p>
  2085. </dd>
  2086. <dt><span>&lsquo;<samp>no_sequence_end</samp>&rsquo;</span></dt>
  2087. <dd><p>Disable sequence end tag.
  2088. </p>
  2089. </dd>
  2090. <dt><span>&lsquo;<samp>no_metadata</samp>&rsquo;</span></dt>
  2091. <dd><p>Disable metadata tag.
  2092. </p>
  2093. </dd>
  2094. <dt><span>&lsquo;<samp>no_duration_filesize</samp>&rsquo;</span></dt>
  2095. <dd><p>Disable duration and filesize in metadata when they are equal to zero
  2096. at the end of stream. (Be used to non-seekable living stream).
  2097. </p>
  2098. </dd>
  2099. <dt><span>&lsquo;<samp>add_keyframe_index</samp>&rsquo;</span></dt>
  2100. <dd><p>Used to facilitate seeking; particularly for HTTP pseudo streaming.
  2101. </p></dd>
  2102. </dl>
  2103. </dd>
  2104. </dl>
  2105. <span id="framecrc"></span><a name="framecrc-1"></a>
  2106. <h3 class="section">4.12 framecrc<span class="pull-right"><a class="anchor hidden-xs" href="#framecrc-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-framecrc-1" aria-hidden="true">TOC</a></span></h3>
  2107. <p>Per-packet CRC (Cyclic Redundancy Check) testing format.
  2108. </p>
  2109. <p>This muxer computes and prints the Adler-32 CRC for each audio
  2110. and video packet. By default audio frames are converted to signed
  2111. 16-bit raw audio and video frames to raw video before computing the
  2112. CRC.
  2113. </p>
  2114. <p>The output of the muxer consists of a line for each audio and video
  2115. packet of the form:
  2116. </p><div class="example">
  2117. <pre class="example"><var>stream_index</var>, <var>packet_dts</var>, <var>packet_pts</var>, <var>packet_duration</var>, <var>packet_size</var>, 0x<var>CRC</var>
  2118. </pre></div>
  2119. <p><var>CRC</var> is a hexadecimal number 0-padded to 8 digits containing the
  2120. CRC of the packet.
  2121. </p>
  2122. <a name="Examples-4"></a>
  2123. <h4 class="subsection">4.12.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-4" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-4" aria-hidden="true">TOC</a></span></h4>
  2124. <p>For example to compute the CRC of the audio and video frames in
  2125. <samp>INPUT</samp>, converted to raw audio and video packets, and store it
  2126. in the file <samp>out.crc</samp>:
  2127. </p><div class="example">
  2128. <pre class="example">ffmpeg -i INPUT -f framecrc out.crc
  2129. </pre></div>
  2130. <p>To print the information to stdout, use the command:
  2131. </p><div class="example">
  2132. <pre class="example">ffmpeg -i INPUT -f framecrc -
  2133. </pre></div>
  2134. <p>With <code>ffmpeg</code>, you can select the output format to which the
  2135. audio and video frames are encoded before computing the CRC for each
  2136. packet by specifying the audio and video codec. For example, to
  2137. compute the CRC of each decoded input audio frame converted to PCM
  2138. unsigned 8-bit and of each decoded input video frame converted to
  2139. MPEG-2 video, use the command:
  2140. </p><div class="example">
  2141. <pre class="example">ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f framecrc -
  2142. </pre></div>
  2143. <p>See also the <a href="#crc">crc</a> muxer.
  2144. </p>
  2145. <span id="framehash"></span><a name="framehash-1"></a>
  2146. <h3 class="section">4.13 framehash<span class="pull-right"><a class="anchor hidden-xs" href="#framehash-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-framehash-1" aria-hidden="true">TOC</a></span></h3>
  2147. <p>Per-packet hash testing format.
  2148. </p>
  2149. <p>This muxer computes and prints a cryptographic hash for each audio
  2150. and video packet. This can be used for packet-by-packet equality
  2151. checks without having to individually do a binary comparison on each.
  2152. </p>
  2153. <p>By default audio frames are converted to signed 16-bit raw audio and
  2154. video frames to raw video before computing the hash, but the output
  2155. of explicit conversions to other codecs can also be used. It uses the
  2156. SHA-256 cryptographic hash function by default, but supports several
  2157. other algorithms.
  2158. </p>
  2159. <p>The output of the muxer consists of a line for each audio and video
  2160. packet of the form:
  2161. </p><div class="example">
  2162. <pre class="example"><var>stream_index</var>, <var>packet_dts</var>, <var>packet_pts</var>, <var>packet_duration</var>, <var>packet_size</var>, <var>hash</var>
  2163. </pre></div>
  2164. <p><var>hash</var> is a hexadecimal number representing the computed hash
  2165. for the packet.
  2166. </p>
  2167. <dl compact="compact">
  2168. <dt><span><samp>hash <var>algorithm</var></samp></span></dt>
  2169. <dd><p>Use the cryptographic hash function specified by the string <var>algorithm</var>.
  2170. Supported values include <code>MD5</code>, <code>murmur3</code>, <code>RIPEMD128</code>,
  2171. <code>RIPEMD160</code>, <code>RIPEMD256</code>, <code>RIPEMD320</code>, <code>SHA160</code>,
  2172. <code>SHA224</code>, <code>SHA256</code> (default), <code>SHA512/224</code>, <code>SHA512/256</code>,
  2173. <code>SHA384</code>, <code>SHA512</code>, <code>CRC32</code> and <code>adler32</code>.
  2174. </p>
  2175. </dd>
  2176. </dl>
  2177. <a name="Examples-5"></a>
  2178. <h4 class="subsection">4.13.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-5" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-5" aria-hidden="true">TOC</a></span></h4>
  2179. <p>To compute the SHA-256 hash of the audio and video frames in <samp>INPUT</samp>,
  2180. converted to raw audio and video packets, and store it in the file
  2181. <samp>out.sha256</samp>:
  2182. </p><div class="example">
  2183. <pre class="example">ffmpeg -i INPUT -f framehash out.sha256
  2184. </pre></div>
  2185. <p>To print the information to stdout, using the MD5 hash function, use
  2186. the command:
  2187. </p><div class="example">
  2188. <pre class="example">ffmpeg -i INPUT -f framehash -hash md5 -
  2189. </pre></div>
  2190. <p>See also the <a href="#hash">hash</a> muxer.
  2191. </p>
  2192. <span id="framemd5"></span><a name="framemd5-1"></a>
  2193. <h3 class="section">4.14 framemd5<span class="pull-right"><a class="anchor hidden-xs" href="#framemd5-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-framemd5-1" aria-hidden="true">TOC</a></span></h3>
  2194. <p>Per-packet MD5 testing format.
  2195. </p>
  2196. <p>This is a variant of the <a href="#framehash">framehash</a> muxer. Unlike that muxer,
  2197. it defaults to using the MD5 hash function.
  2198. </p>
  2199. <a name="Examples-6"></a>
  2200. <h4 class="subsection">4.14.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-6" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-6" aria-hidden="true">TOC</a></span></h4>
  2201. <p>To compute the MD5 hash of the audio and video frames in <samp>INPUT</samp>,
  2202. converted to raw audio and video packets, and store it in the file
  2203. <samp>out.md5</samp>:
  2204. </p><div class="example">
  2205. <pre class="example">ffmpeg -i INPUT -f framemd5 out.md5
  2206. </pre></div>
  2207. <p>To print the information to stdout, use the command:
  2208. </p><div class="example">
  2209. <pre class="example">ffmpeg -i INPUT -f framemd5 -
  2210. </pre></div>
  2211. <p>See also the <a href="#framehash">framehash</a> and <a href="#md5">md5</a> muxers.
  2212. </p>
  2213. <span id="gif"></span><a name="gif-2"></a>
  2214. <h3 class="section">4.15 gif<span class="pull-right"><a class="anchor hidden-xs" href="#gif-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gif-2" aria-hidden="true">TOC</a></span></h3>
  2215. <p>Animated GIF muxer.
  2216. </p>
  2217. <p>It accepts the following options:
  2218. </p>
  2219. <dl compact="compact">
  2220. <dt><span><samp>loop</samp></span></dt>
  2221. <dd><p>Set the number of times to loop the output. Use <code>-1</code> for no loop, <code>0</code>
  2222. for looping indefinitely (default).
  2223. </p>
  2224. </dd>
  2225. <dt><span><samp>final_delay</samp></span></dt>
  2226. <dd><p>Force the delay (expressed in centiseconds) after the last frame. Each frame
  2227. ends with a delay until the next frame. The default is <code>-1</code>, which is a
  2228. special value to tell the muxer to re-use the previous delay. In case of a
  2229. loop, you might want to customize this value to mark a pause for instance.
  2230. </p></dd>
  2231. </dl>
  2232. <p>For example, to encode a gif looping 10 times, with a 5 seconds delay between
  2233. the loops:
  2234. </p><div class="example">
  2235. <pre class="example">ffmpeg -i INPUT -loop 10 -final_delay 500 out.gif
  2236. </pre></div>
  2237. <p>Note 1: if you wish to extract the frames into separate GIF files, you need to
  2238. force the <a href="#image2">image2</a> muxer:
  2239. </p><div class="example">
  2240. <pre class="example">ffmpeg -i INPUT -c:v gif -f image2 &quot;out%d.gif&quot;
  2241. </pre></div>
  2242. <p>Note 2: the GIF format has a very large time base: the delay between two frames
  2243. can therefore not be smaller than one centi second.
  2244. </p>
  2245. <span id="hash"></span><a name="hash-1"></a>
  2246. <h3 class="section">4.16 hash<span class="pull-right"><a class="anchor hidden-xs" href="#hash-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hash-1" aria-hidden="true">TOC</a></span></h3>
  2247. <p>Hash testing format.
  2248. </p>
  2249. <p>This muxer computes and prints a cryptographic hash of all the input
  2250. audio and video frames. This can be used for equality checks without
  2251. having to do a complete binary comparison.
  2252. </p>
  2253. <p>By default audio frames are converted to signed 16-bit raw audio and
  2254. video frames to raw video before computing the hash, but the output
  2255. of explicit conversions to other codecs can also be used. Timestamps
  2256. are ignored. It uses the SHA-256 cryptographic hash function by default,
  2257. but supports several other algorithms.
  2258. </p>
  2259. <p>The output of the muxer consists of a single line of the form:
  2260. <var>algo</var>=<var>hash</var>, where <var>algo</var> is a short string representing
  2261. the hash function used, and <var>hash</var> is a hexadecimal number
  2262. representing the computed hash.
  2263. </p>
  2264. <dl compact="compact">
  2265. <dt><span><samp>hash <var>algorithm</var></samp></span></dt>
  2266. <dd><p>Use the cryptographic hash function specified by the string <var>algorithm</var>.
  2267. Supported values include <code>MD5</code>, <code>murmur3</code>, <code>RIPEMD128</code>,
  2268. <code>RIPEMD160</code>, <code>RIPEMD256</code>, <code>RIPEMD320</code>, <code>SHA160</code>,
  2269. <code>SHA224</code>, <code>SHA256</code> (default), <code>SHA512/224</code>, <code>SHA512/256</code>,
  2270. <code>SHA384</code>, <code>SHA512</code>, <code>CRC32</code> and <code>adler32</code>.
  2271. </p>
  2272. </dd>
  2273. </dl>
  2274. <a name="Examples-7"></a>
  2275. <h4 class="subsection">4.16.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-7" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-7" aria-hidden="true">TOC</a></span></h4>
  2276. <p>To compute the SHA-256 hash of the input converted to raw audio and
  2277. video, and store it in the file <samp>out.sha256</samp>:
  2278. </p><div class="example">
  2279. <pre class="example">ffmpeg -i INPUT -f hash out.sha256
  2280. </pre></div>
  2281. <p>To print an MD5 hash to stdout use the command:
  2282. </p><div class="example">
  2283. <pre class="example">ffmpeg -i INPUT -f hash -hash md5 -
  2284. </pre></div>
  2285. <p>See also the <a href="#framehash">framehash</a> muxer.
  2286. </p>
  2287. <span id="hls"></span><a name="hls-2"></a>
  2288. <h3 class="section">4.17 hls<span class="pull-right"><a class="anchor hidden-xs" href="#hls-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hls-2" aria-hidden="true">TOC</a></span></h3>
  2289. <p>Apple HTTP Live Streaming muxer that segments MPEG-TS according to
  2290. the HTTP Live Streaming (HLS) specification.
  2291. </p>
  2292. <p>It creates a playlist file, and one or more segment files. The output filename
  2293. specifies the playlist filename.
  2294. </p>
  2295. <p>By default, the muxer creates a file for each segment produced. These files
  2296. have the same name as the playlist, followed by a sequential number and a
  2297. .ts extension.
  2298. </p>
  2299. <p>Make sure to require a closed GOP when encoding and to set the GOP
  2300. size to fit your segment time constraint.
  2301. </p>
  2302. <p>For example, to convert an input file with <code>ffmpeg</code>:
  2303. </p><div class="example">
  2304. <pre class="example">ffmpeg -i in.mkv -c:v h264 -flags +cgop -g 30 -hls_time 1 out.m3u8
  2305. </pre></div>
  2306. <p>This example will produce the playlist, <samp>out.m3u8</samp>, and segment files:
  2307. <samp>out0.ts</samp>, <samp>out1.ts</samp>, <samp>out2.ts</samp>, etc.
  2308. </p>
  2309. <p>See also the <a href="#segment">segment</a> muxer, which provides a more generic and
  2310. flexible implementation of a segmenter, and can be used to perform HLS
  2311. segmentation.
  2312. </p>
  2313. <a name="Options-10"></a>
  2314. <h4 class="subsection">4.17.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-10" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-10" aria-hidden="true">TOC</a></span></h4>
  2315. <p>This muxer supports the following options:
  2316. </p>
  2317. <dl compact="compact">
  2318. <dt><span><samp>hls_init_time <var>duration</var></samp></span></dt>
  2319. <dd><p>Set the initial target segment length. Default value is <var>0</var>.
  2320. </p>
  2321. <p><var>duration</var> must be a time duration specification,
  2322. see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>.
  2323. </p>
  2324. <p>Segment will be cut on the next key frame after this time has passed on the first m3u8 list.
  2325. After the initial playlist is filled <code>ffmpeg</code> will cut segments
  2326. at duration equal to <code>hls_time</code>
  2327. </p>
  2328. </dd>
  2329. <dt><span><samp>hls_time <var>duration</var></samp></span></dt>
  2330. <dd><p>Set the target segment length. Default value is 2.
  2331. </p>
  2332. <p><var>duration</var> must be a time duration specification,
  2333. see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>.
  2334. Segment will be cut on the next key frame after this time has passed.
  2335. </p>
  2336. </dd>
  2337. <dt><span><samp>hls_list_size <var>size</var></samp></span></dt>
  2338. <dd><p>Set the maximum number of playlist entries. If set to 0 the list file
  2339. will contain all the segments. Default value is 5.
  2340. </p>
  2341. </dd>
  2342. <dt><span><samp>hls_delete_threshold <var>size</var></samp></span></dt>
  2343. <dd><p>Set the number of unreferenced segments to keep on disk before <code>hls_flags delete_segments</code>
  2344. deletes them. Increase this to allow continue clients to download segments which
  2345. were recently referenced in the playlist. Default value is 1, meaning segments older than
  2346. <code>hls_list_size+1</code> will be deleted.
  2347. </p>
  2348. </dd>
  2349. <dt><span><samp>hls_start_number_source</samp></span></dt>
  2350. <dd><p>Start the playlist sequence number (<code>#EXT-X-MEDIA-SEQUENCE</code>) according to the specified source.
  2351. Unless <code>hls_flags single_file</code> is set, it also specifies source of starting sequence numbers of
  2352. segment and subtitle filenames. In any case, if <code>hls_flags append_list</code>
  2353. is set and read playlist sequence number is greater than the specified start sequence number,
  2354. then that value will be used as start value.
  2355. </p>
  2356. <p>It accepts the following values:
  2357. </p>
  2358. <dl compact="compact">
  2359. <dt><span><samp>generic (default)</samp></span></dt>
  2360. <dd><p>Set the starting sequence numbers according to <var>start_number</var> option value.
  2361. </p>
  2362. </dd>
  2363. <dt><span><samp>epoch</samp></span></dt>
  2364. <dd><p>The start number will be the seconds since epoch (1970-01-01 00:00:00)
  2365. </p>
  2366. </dd>
  2367. <dt><span><samp>epoch_us</samp></span></dt>
  2368. <dd><p>The start number will be the microseconds since epoch (1970-01-01 00:00:00)
  2369. </p>
  2370. </dd>
  2371. <dt><span><samp>datetime</samp></span></dt>
  2372. <dd><p>The start number will be based on the current date/time as YYYYmmddHHMMSS. e.g. 20161231235759.
  2373. </p>
  2374. </dd>
  2375. </dl>
  2376. </dd>
  2377. <dt><span><samp>start_number <var>number</var></samp></span></dt>
  2378. <dd><p>Start the playlist sequence number (<code>#EXT-X-MEDIA-SEQUENCE</code>) from the specified <var>number</var>
  2379. when <var>hls_start_number_source</var> value is <var>generic</var>. (This is the default case.)
  2380. Unless <code>hls_flags single_file</code> is set, it also specifies starting sequence numbers of segment and subtitle filenames.
  2381. Default value is 0.
  2382. </p>
  2383. </dd>
  2384. <dt><span><samp>hls_allow_cache <var>allowcache</var></samp></span></dt>
  2385. <dd><p>Explicitly set whether the client MAY (1) or MUST NOT (0) cache media segments.
  2386. </p>
  2387. </dd>
  2388. <dt><span><samp>hls_base_url <var>baseurl</var></samp></span></dt>
  2389. <dd><p>Append <var>baseurl</var> to every entry in the playlist.
  2390. Useful to generate playlists with absolute paths.
  2391. </p>
  2392. <p>Note that the playlist sequence number must be unique for each segment
  2393. and it is not to be confused with the segment filename sequence number
  2394. which can be cyclic, for example if the <samp>wrap</samp> option is
  2395. specified.
  2396. </p>
  2397. </dd>
  2398. <dt><span><samp>hls_segment_filename <var>filename</var></samp></span></dt>
  2399. <dd><p>Set the segment filename. Unless <code>hls_flags single_file</code> is set,
  2400. <var>filename</var> is used as a string format with the segment number:
  2401. </p><div class="example">
  2402. <pre class="example">ffmpeg -i in.nut -hls_segment_filename 'file%03d.ts' out.m3u8
  2403. </pre></div>
  2404. <p>This example will produce the playlist, <samp>out.m3u8</samp>, and segment files:
  2405. <samp>file000.ts</samp>, <samp>file001.ts</samp>, <samp>file002.ts</samp>, etc.
  2406. </p>
  2407. <p><var>filename</var> may contain full path or relative path specification,
  2408. but only the file name part without any path info will be contained in the m3u8 segment list.
  2409. Should a relative path be specified, the path of the created segment
  2410. files will be relative to the current working directory.
  2411. When strftime_mkdir is set, the whole expanded value of <var>filename</var> will be written into the m3u8 segment list.
  2412. </p>
  2413. <p>When <code>var_stream_map</code> is set with two or more variant streams, the
  2414. <var>filename</var> pattern must contain the string &quot;%v&quot;, this string specifies
  2415. the position of variant stream index in the generated segment file names.
  2416. </p><div class="example">
  2417. <pre class="example">ffmpeg -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  2418. -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map &quot;v:0,a:0 v:1,a:1&quot; \
  2419. -hls_segment_filename 'file_%v_%03d.ts' out_%v.m3u8
  2420. </pre></div>
  2421. <p>This example will produce the playlists segment file sets:
  2422. <samp>file_0_000.ts</samp>, <samp>file_0_001.ts</samp>, <samp>file_0_002.ts</samp>, etc. and
  2423. <samp>file_1_000.ts</samp>, <samp>file_1_001.ts</samp>, <samp>file_1_002.ts</samp>, etc.
  2424. </p>
  2425. <p>The string &quot;%v&quot; may be present in the filename or in the last directory name
  2426. containing the file, but only in one of them. (Additionally, %v may appear multiple times in the last
  2427. sub-directory or filename.) If the string %v is present in the directory name, then
  2428. sub-directories are created after expanding the directory name pattern. This
  2429. enables creation of segments corresponding to different variant streams in
  2430. subdirectories.
  2431. </p><div class="example">
  2432. <pre class="example">ffmpeg -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  2433. -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map &quot;v:0,a:0 v:1,a:1&quot; \
  2434. -hls_segment_filename 'vs%v/file_%03d.ts' vs%v/out.m3u8
  2435. </pre></div>
  2436. <p>This example will produce the playlists segment file sets:
  2437. <samp>vs0/file_000.ts</samp>, <samp>vs0/file_001.ts</samp>, <samp>vs0/file_002.ts</samp>, etc. and
  2438. <samp>vs1/file_000.ts</samp>, <samp>vs1/file_001.ts</samp>, <samp>vs1/file_002.ts</samp>, etc.
  2439. </p>
  2440. </dd>
  2441. <dt><span><samp>strftime</samp></span></dt>
  2442. <dd><p>Use strftime() on <var>filename</var> to expand the segment filename with localtime.
  2443. The segment number is also available in this mode, but to use it, you need to specify second_level_segment_index
  2444. hls_flag and %%d will be the specifier.
  2445. </p><div class="example">
  2446. <pre class="example">ffmpeg -i in.nut -strftime 1 -hls_segment_filename 'file-%Y%m%d-%s.ts' out.m3u8
  2447. </pre></div>
  2448. <p>This example will produce the playlist, <samp>out.m3u8</samp>, and segment files:
  2449. <samp>file-20160215-1455569023.ts</samp>, <samp>file-20160215-1455569024.ts</samp>, etc.
  2450. Note: On some systems/environments, the <code>%s</code> specifier is not available. See
  2451. <code>strftime()</code> documentation.
  2452. </p><div class="example">
  2453. <pre class="example">ffmpeg -i in.nut -strftime 1 -hls_flags second_level_segment_index -hls_segment_filename 'file-%Y%m%d-%%04d.ts' out.m3u8
  2454. </pre></div>
  2455. <p>This example will produce the playlist, <samp>out.m3u8</samp>, and segment files:
  2456. <samp>file-20160215-0001.ts</samp>, <samp>file-20160215-0002.ts</samp>, etc.
  2457. </p>
  2458. </dd>
  2459. <dt><span><samp>strftime_mkdir</samp></span></dt>
  2460. <dd><p>Used together with -strftime_mkdir, it will create all subdirectories which
  2461. is expanded in <var>filename</var>.
  2462. </p><div class="example">
  2463. <pre class="example">ffmpeg -i in.nut -strftime 1 -strftime_mkdir 1 -hls_segment_filename '%Y%m%d/file-%Y%m%d-%s.ts' out.m3u8
  2464. </pre></div>
  2465. <p>This example will create a directory 201560215 (if it does not exist), and then
  2466. produce the playlist, <samp>out.m3u8</samp>, and segment files:
  2467. <samp>20160215/file-20160215-1455569023.ts</samp>, <samp>20160215/file-20160215-1455569024.ts</samp>, etc.
  2468. </p>
  2469. <div class="example">
  2470. <pre class="example">ffmpeg -i in.nut -strftime 1 -strftime_mkdir 1 -hls_segment_filename '%Y/%m/%d/file-%Y%m%d-%s.ts' out.m3u8
  2471. </pre></div>
  2472. <p>This example will create a directory hierarchy 2016/02/15 (if any of them do not exist), and then
  2473. produce the playlist, <samp>out.m3u8</samp>, and segment files:
  2474. <samp>2016/02/15/file-20160215-1455569023.ts</samp>, <samp>2016/02/15/file-20160215-1455569024.ts</samp>, etc.
  2475. </p>
  2476. </dd>
  2477. <dt><span><samp>hls_segment_options <var>options_list</var></samp></span></dt>
  2478. <dd><p>Set output format options using a :-separated list of key=value
  2479. parameters. Values containing <code>:</code> special characters must be
  2480. escaped.
  2481. </p>
  2482. </dd>
  2483. <dt><span><samp>hls_key_info_file <var>key_info_file</var></samp></span></dt>
  2484. <dd><p>Use the information in <var>key_info_file</var> for segment encryption. The first
  2485. line of <var>key_info_file</var> specifies the key URI written to the playlist. The
  2486. key URL is used to access the encryption key during playback. The second line
  2487. specifies the path to the key file used to obtain the key during the encryption
  2488. process. The key file is read as a single packed array of 16 octets in binary
  2489. format. The optional third line specifies the initialization vector (IV) as a
  2490. hexadecimal string to be used instead of the segment sequence number (default)
  2491. for encryption. Changes to <var>key_info_file</var> will result in segment
  2492. encryption with the new key/IV and an entry in the playlist for the new key
  2493. URI/IV if <code>hls_flags periodic_rekey</code> is enabled.
  2494. </p>
  2495. <p>Key info file format:
  2496. </p><div class="example">
  2497. <pre class="example"><var>key URI</var>
  2498. <var>key file path</var>
  2499. <var>IV</var> (optional)
  2500. </pre></div>
  2501. <p>Example key URIs:
  2502. </p><div class="example">
  2503. <pre class="example">http://server/file.key
  2504. /path/to/file.key
  2505. file.key
  2506. </pre></div>
  2507. <p>Example key file paths:
  2508. </p><div class="example">
  2509. <pre class="example">file.key
  2510. /path/to/file.key
  2511. </pre></div>
  2512. <p>Example IV:
  2513. </p><div class="example">
  2514. <pre class="example">0123456789ABCDEF0123456789ABCDEF
  2515. </pre></div>
  2516. <p>Key info file example:
  2517. </p><div class="example">
  2518. <pre class="example">http://server/file.key
  2519. /path/to/file.key
  2520. 0123456789ABCDEF0123456789ABCDEF
  2521. </pre></div>
  2522. <p>Example shell script:
  2523. </p><div class="example">
  2524. <pre class="example">#!/bin/sh
  2525. BASE_URL=${1:-'.'}
  2526. openssl rand 16 &gt; file.key
  2527. echo $BASE_URL/file.key &gt; file.keyinfo
  2528. echo file.key &gt;&gt; file.keyinfo
  2529. echo $(openssl rand -hex 16) &gt;&gt; file.keyinfo
  2530. ffmpeg -f lavfi -re -i testsrc -c:v h264 -hls_flags delete_segments \
  2531. -hls_key_info_file file.keyinfo out.m3u8
  2532. </pre></div>
  2533. </dd>
  2534. <dt><span><samp>-hls_enc <var>enc</var></samp></span></dt>
  2535. <dd><p>Enable (1) or disable (0) the AES128 encryption.
  2536. When enabled every segment generated is encrypted and the encryption key
  2537. is saved as <var>playlist name</var>.key.
  2538. </p>
  2539. </dd>
  2540. <dt><span><samp>-hls_enc_key <var>key</var></samp></span></dt>
  2541. <dd><p>16-octet key to encrypt the segments, by default it
  2542. is randomly generated.
  2543. </p>
  2544. </dd>
  2545. <dt><span><samp>-hls_enc_key_url <var>keyurl</var></samp></span></dt>
  2546. <dd><p>If set, <var>keyurl</var> is prepended instead of <var>baseurl</var> to the key filename
  2547. in the playlist.
  2548. </p>
  2549. </dd>
  2550. <dt><span><samp>-hls_enc_iv <var>iv</var></samp></span></dt>
  2551. <dd><p>16-octet initialization vector for every segment instead
  2552. of the autogenerated ones.
  2553. </p>
  2554. </dd>
  2555. <dt><span><samp>hls_segment_type <var>flags</var></samp></span></dt>
  2556. <dd><p>Possible values:
  2557. </p>
  2558. <dl compact="compact">
  2559. <dt><span>&lsquo;<samp>mpegts</samp>&rsquo;</span></dt>
  2560. <dd><p>Output segment files in MPEG-2 Transport Stream format. This is
  2561. compatible with all HLS versions.
  2562. </p>
  2563. </dd>
  2564. <dt><span>&lsquo;<samp>fmp4</samp>&rsquo;</span></dt>
  2565. <dd><p>Output segment files in fragmented MP4 format, similar to MPEG-DASH.
  2566. fmp4 files may be used in HLS version 7 and above.
  2567. </p>
  2568. </dd>
  2569. </dl>
  2570. </dd>
  2571. <dt><span><samp>hls_fmp4_init_filename <var>filename</var></samp></span></dt>
  2572. <dd><p>Set filename to the fragment files header file, default filename is <samp>init.mp4</samp>.
  2573. </p>
  2574. <p>Use <code>-strftime 1</code> on <var>filename</var> to expand the segment filename with localtime.
  2575. </p><div class="example">
  2576. <pre class="example">ffmpeg -i in.nut -hls_segment_type fmp4 -strftime 1 -hls_fmp4_init_filename &quot;%s_init.mp4&quot; out.m3u8
  2577. </pre></div>
  2578. <p>This will produce init like this
  2579. <samp>1602678741_init.mp4</samp>
  2580. </p>
  2581. </dd>
  2582. <dt><span><samp>hls_fmp4_init_resend</samp></span></dt>
  2583. <dd><p>Resend init file after m3u8 file refresh every time, default is <var>0</var>.
  2584. </p>
  2585. <p>When <code>var_stream_map</code> is set with two or more variant streams, the
  2586. <var>filename</var> pattern must contain the string &quot;%v&quot;, this string specifies
  2587. the position of variant stream index in the generated init file names.
  2588. The string &quot;%v&quot; may be present in the filename or in the last directory name
  2589. containing the file. If the string is present in the directory name, then
  2590. sub-directories are created after expanding the directory name pattern. This
  2591. enables creation of init files corresponding to different variant streams in
  2592. subdirectories.
  2593. </p>
  2594. </dd>
  2595. <dt><span><samp>hls_flags <var>flags</var></samp></span></dt>
  2596. <dd><p>Possible values:
  2597. </p>
  2598. <dl compact="compact">
  2599. <dt><span>&lsquo;<samp>single_file</samp>&rsquo;</span></dt>
  2600. <dd><p>If this flag is set, the muxer will store all segments in a single MPEG-TS
  2601. file, and will use byte ranges in the playlist. HLS playlists generated with
  2602. this way will have the version number 4.
  2603. For example:
  2604. </p><div class="example">
  2605. <pre class="example">ffmpeg -i in.nut -hls_flags single_file out.m3u8
  2606. </pre></div>
  2607. <p>Will produce the playlist, <samp>out.m3u8</samp>, and a single segment file,
  2608. <samp>out.ts</samp>.
  2609. </p>
  2610. </dd>
  2611. <dt><span>&lsquo;<samp>delete_segments</samp>&rsquo;</span></dt>
  2612. <dd><p>Segment files removed from the playlist are deleted after a period of time
  2613. equal to the duration of the segment plus the duration of the playlist.
  2614. </p>
  2615. </dd>
  2616. <dt><span>&lsquo;<samp>append_list</samp>&rsquo;</span></dt>
  2617. <dd><p>Append new segments into the end of old segment list,
  2618. and remove the <code>#EXT-X-ENDLIST</code> from the old segment list.
  2619. </p>
  2620. </dd>
  2621. <dt><span>&lsquo;<samp>round_durations</samp>&rsquo;</span></dt>
  2622. <dd><p>Round the duration info in the playlist file segment info to integer
  2623. values, instead of using floating point.
  2624. If there are no other features requiring higher HLS versions be used,
  2625. then this will allow ffmpeg to output a HLS version 2 m3u8.
  2626. </p>
  2627. </dd>
  2628. <dt><span>&lsquo;<samp>discont_start</samp>&rsquo;</span></dt>
  2629. <dd><p>Add the <code>#EXT-X-DISCONTINUITY</code> tag to the playlist, before the
  2630. first segment&rsquo;s information.
  2631. </p>
  2632. </dd>
  2633. <dt><span>&lsquo;<samp>omit_endlist</samp>&rsquo;</span></dt>
  2634. <dd><p>Do not append the <code>EXT-X-ENDLIST</code> tag at the end of the playlist.
  2635. </p>
  2636. </dd>
  2637. <dt><span>&lsquo;<samp>periodic_rekey</samp>&rsquo;</span></dt>
  2638. <dd><p>The file specified by <code>hls_key_info_file</code> will be checked periodically and
  2639. detect updates to the encryption info. Be sure to replace this file atomically,
  2640. including the file containing the AES encryption key.
  2641. </p>
  2642. </dd>
  2643. <dt><span>&lsquo;<samp>independent_segments</samp>&rsquo;</span></dt>
  2644. <dd><p>Add the <code>#EXT-X-INDEPENDENT-SEGMENTS</code> to playlists that has video segments
  2645. and when all the segments of that playlist are guaranteed to start with a Key frame.
  2646. </p>
  2647. </dd>
  2648. <dt><span>&lsquo;<samp>iframes_only</samp>&rsquo;</span></dt>
  2649. <dd><p>Add the <code>#EXT-X-I-FRAMES-ONLY</code> to playlists that has video segments
  2650. and can play only I-frames in the <code>#EXT-X-BYTERANGE</code> mode.
  2651. </p>
  2652. </dd>
  2653. <dt><span>&lsquo;<samp>split_by_time</samp>&rsquo;</span></dt>
  2654. <dd><p>Allow segments to start on frames other than keyframes. This improves
  2655. behavior on some players when the time between keyframes is inconsistent,
  2656. but may make things worse on others, and can cause some oddities during
  2657. seeking. This flag should be used with the <code>hls_time</code> option.
  2658. </p>
  2659. </dd>
  2660. <dt><span>&lsquo;<samp>program_date_time</samp>&rsquo;</span></dt>
  2661. <dd><p>Generate <code>EXT-X-PROGRAM-DATE-TIME</code> tags.
  2662. </p>
  2663. </dd>
  2664. <dt><span>&lsquo;<samp>second_level_segment_index</samp>&rsquo;</span></dt>
  2665. <dd><p>Makes it possible to use segment indexes as %%d in hls_segment_filename expression
  2666. besides date/time values when strftime is on.
  2667. To get fixed width numbers with trailing zeroes, %%0xd format is available where x is the required width.
  2668. </p>
  2669. </dd>
  2670. <dt><span>&lsquo;<samp>second_level_segment_size</samp>&rsquo;</span></dt>
  2671. <dd><p>Makes it possible to use segment sizes (counted in bytes) as %%s in hls_segment_filename
  2672. expression besides date/time values when strftime is on.
  2673. To get fixed width numbers with trailing zeroes, %%0xs format is available where x is the required width.
  2674. </p>
  2675. </dd>
  2676. <dt><span>&lsquo;<samp>second_level_segment_duration</samp>&rsquo;</span></dt>
  2677. <dd><p>Makes it possible to use segment duration (calculated in microseconds) as %%t in hls_segment_filename
  2678. expression besides date/time values when strftime is on.
  2679. To get fixed width numbers with trailing zeroes, %%0xt format is available where x is the required width.
  2680. </p>
  2681. <div class="example">
  2682. <pre class="example">ffmpeg -i sample.mpeg \
  2683. -f hls -hls_time 3 -hls_list_size 5 \
  2684. -hls_flags second_level_segment_index+second_level_segment_size+second_level_segment_duration \
  2685. -strftime 1 -strftime_mkdir 1 -hls_segment_filename &quot;segment_%Y%m%d%H%M%S_%%04d_%%08s_%%013t.ts&quot; stream.m3u8
  2686. </pre></div>
  2687. <p>This will produce segments like this:
  2688. <samp>segment_20170102194334_0003_00122200_0000003000000.ts</samp>, <samp>segment_20170102194334_0004_00120072_0000003000000.ts</samp> etc.
  2689. </p>
  2690. </dd>
  2691. <dt><span>&lsquo;<samp>temp_file</samp>&rsquo;</span></dt>
  2692. <dd><p>Write segment data to filename.tmp and rename to filename only once the segment is complete. A webserver
  2693. serving up segments can be configured to reject requests to *.tmp to prevent access to in-progress segments
  2694. before they have been added to the m3u8 playlist. This flag also affects how m3u8 playlist files are created.
  2695. If this flag is set, all playlist files will written into temporary file and renamed after they are complete, similarly as segments are handled.
  2696. But playlists with <code>file</code> protocol and with type (<code>hls_playlist_type</code>) other than <code>vod</code>
  2697. are always written into temporary file regardless of this flag. Master playlist files (<code>master_pl_name</code>), if any, with <code>file</code> protocol,
  2698. are always written into temporary file regardless of this flag if <code>master_pl_publish_rate</code> value is other than zero.
  2699. </p>
  2700. </dd>
  2701. </dl>
  2702. </dd>
  2703. <dt><span><samp>hls_playlist_type event</samp></span></dt>
  2704. <dd><p>Emit <code>#EXT-X-PLAYLIST-TYPE:EVENT</code> in the m3u8 header. Forces
  2705. <samp>hls_list_size</samp> to 0; the playlist can only be appended to.
  2706. </p>
  2707. </dd>
  2708. <dt><span><samp>hls_playlist_type vod</samp></span></dt>
  2709. <dd><p>Emit <code>#EXT-X-PLAYLIST-TYPE:VOD</code> in the m3u8 header. Forces
  2710. <samp>hls_list_size</samp> to 0; the playlist must not change.
  2711. </p>
  2712. </dd>
  2713. <dt><span><samp>method</samp></span></dt>
  2714. <dd><p>Use the given HTTP method to create the hls files.
  2715. </p><div class="example">
  2716. <pre class="example">ffmpeg -re -i in.ts -f hls -method PUT http://example.com/live/out.m3u8
  2717. </pre></div>
  2718. <p>This example will upload all the mpegts segment files to the HTTP
  2719. server using the HTTP PUT method, and update the m3u8 files every
  2720. <code>refresh</code> times using the same method.
  2721. Note that the HTTP server must support the given method for uploading
  2722. files.
  2723. </p>
  2724. </dd>
  2725. <dt><span><samp>http_user_agent</samp></span></dt>
  2726. <dd><p>Override User-Agent field in HTTP header. Applicable only for HTTP output.
  2727. </p>
  2728. </dd>
  2729. <dt><span><samp>var_stream_map</samp></span></dt>
  2730. <dd><p>Map string which specifies how to group the audio, video and subtitle streams
  2731. into different variant streams. The variant stream groups are separated
  2732. by space.
  2733. Expected string format is like this &quot;a:0,v:0 a:1,v:1 ....&quot;. Here a:, v:, s: are
  2734. the keys to specify audio, video and subtitle streams respectively.
  2735. Allowed values are 0 to 9 (limited just based on practical usage).
  2736. </p>
  2737. <p>When there are two or more variant streams, the output filename pattern must
  2738. contain the string &quot;%v&quot;, this string specifies the position of variant stream
  2739. index in the output media playlist filenames. The string &quot;%v&quot; may be present in
  2740. the filename or in the last directory name containing the file. If the string is
  2741. present in the directory name, then sub-directories are created after expanding
  2742. the directory name pattern. This enables creation of variant streams in
  2743. subdirectories.
  2744. </p>
  2745. <div class="example">
  2746. <pre class="example">ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  2747. -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map &quot;v:0,a:0 v:1,a:1&quot; \
  2748. http://example.com/live/out_%v.m3u8
  2749. </pre></div>
  2750. <p>This example creates two hls variant streams. The first variant stream will
  2751. contain video stream of bitrate 1000k and audio stream of bitrate 64k and the
  2752. second variant stream will contain video stream of bitrate 256k and audio
  2753. stream of bitrate 32k. Here, two media playlist with file names out_0.m3u8 and
  2754. out_1.m3u8 will be created. If you want something meaningful text instead of indexes
  2755. in result names, you may specify names for each or some of the variants
  2756. as in the following example.
  2757. </p>
  2758. <div class="example">
  2759. <pre class="example">ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  2760. -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map &quot;v:0,a:0,name:my_hd v:1,a:1,name:my_sd&quot; \
  2761. http://example.com/live/out_%v.m3u8
  2762. </pre></div>
  2763. <p>This example creates two hls variant streams as in the previous one.
  2764. But here, the two media playlist with file names out_my_hd.m3u8 and
  2765. out_my_sd.m3u8 will be created.
  2766. </p>
  2767. <div class="example">
  2768. <pre class="example">ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k \
  2769. -map 0:v -map 0:a -map 0:v -f hls -var_stream_map &quot;v:0 a:0 v:1&quot; \
  2770. http://example.com/live/out_%v.m3u8
  2771. </pre></div>
  2772. <p>This example creates three hls variant streams. The first variant stream will
  2773. be a video only stream with video bitrate 1000k, the second variant stream will
  2774. be an audio only stream with bitrate 64k and the third variant stream will be a
  2775. video only stream with bitrate 256k. Here, three media playlist with file names
  2776. out_0.m3u8, out_1.m3u8 and out_2.m3u8 will be created.
  2777. </p><div class="example">
  2778. <pre class="example">ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  2779. -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map &quot;v:0,a:0 v:1,a:1&quot; \
  2780. http://example.com/live/vs_%v/out.m3u8
  2781. </pre></div>
  2782. <p>This example creates the variant streams in subdirectories. Here, the first
  2783. media playlist is created at <samp>http://example.com/live/vs_0/out.m3u8</samp> and
  2784. the second one at <samp>http://example.com/live/vs_1/out.m3u8</samp>.
  2785. </p><div class="example">
  2786. <pre class="example">ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k -b:v:1 3000k \
  2787. -map 0:a -map 0:a -map 0:v -map 0:v -f hls \
  2788. -var_stream_map &quot;a:0,agroup:aud_low a:1,agroup:aud_high v:0,agroup:aud_low v:1,agroup:aud_high&quot; \
  2789. -master_pl_name master.m3u8 \
  2790. http://example.com/live/out_%v.m3u8
  2791. </pre></div>
  2792. <p>This example creates two audio only and two video only variant streams. In
  2793. addition to the #EXT-X-STREAM-INF tag for each variant stream in the master
  2794. playlist, #EXT-X-MEDIA tag is also added for the two audio only variant streams
  2795. and they are mapped to the two video only variant streams with audio group names
  2796. &rsquo;aud_low&rsquo; and &rsquo;aud_high&rsquo;.
  2797. </p>
  2798. <p>By default, a single hls variant containing all the encoded streams is created.
  2799. </p>
  2800. <div class="example">
  2801. <pre class="example">ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k \
  2802. -map 0:a -map 0:a -map 0:v -f hls \
  2803. -var_stream_map &quot;a:0,agroup:aud_low,default:yes a:1,agroup:aud_low v:0,agroup:aud_low&quot; \
  2804. -master_pl_name master.m3u8 \
  2805. http://example.com/live/out_%v.m3u8
  2806. </pre></div>
  2807. <p>This example creates two audio only and one video only variant streams. In
  2808. addition to the #EXT-X-STREAM-INF tag for each variant stream in the master
  2809. playlist, #EXT-X-MEDIA tag is also added for the two audio only variant streams
  2810. and they are mapped to the one video only variant streams with audio group name
  2811. &rsquo;aud_low&rsquo;, and the audio group have default stat is NO or YES.
  2812. </p>
  2813. <p>By default, a single hls variant containing all the encoded streams is created.
  2814. </p>
  2815. <div class="example">
  2816. <pre class="example">ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k \
  2817. -map 0:a -map 0:a -map 0:v -f hls \
  2818. -var_stream_map &quot;a:0,agroup:aud_low,default:yes,language:ENG a:1,agroup:aud_low,language:CHN v:0,agroup:aud_low&quot; \
  2819. -master_pl_name master.m3u8 \
  2820. http://example.com/live/out_%v.m3u8
  2821. </pre></div>
  2822. <p>This example creates two audio only and one video only variant streams. In
  2823. addition to the #EXT-X-STREAM-INF tag for each variant stream in the master
  2824. playlist, #EXT-X-MEDIA tag is also added for the two audio only variant streams
  2825. and they are mapped to the one video only variant streams with audio group name
  2826. &rsquo;aud_low&rsquo;, and the audio group have default stat is NO or YES, and one audio
  2827. have and language is named ENG, the other audio language is named CHN.
  2828. </p>
  2829. <p>By default, a single hls variant containing all the encoded streams is created.
  2830. </p>
  2831. <div class="example">
  2832. <pre class="example">ffmpeg -y -i input_with_subtitle.mkv \
  2833. -b:v:0 5250k -c:v h264 -pix_fmt yuv420p -profile:v main -level 4.1 \
  2834. -b:a:0 256k \
  2835. -c:s webvtt -c:a mp2 -ar 48000 -ac 2 -map 0:v -map 0:a:0 -map 0:s:0 \
  2836. -f hls -var_stream_map &quot;v:0,a:0,s:0,sgroup:subtitle&quot; \
  2837. -master_pl_name master.m3u8 -t 300 -hls_time 10 -hls_init_time 4 -hls_list_size \
  2838. 10 -master_pl_publish_rate 10 -hls_flags \
  2839. delete_segments+discont_start+split_by_time ./tmp/video.m3u8
  2840. </pre></div>
  2841. <p>This example adds <code>#EXT-X-MEDIA</code> tag with <code>TYPE=SUBTITLES</code> in
  2842. the master playlist with webvtt subtitle group name &rsquo;subtitle&rsquo;. Please make sure
  2843. the input file has one text subtitle stream at least.
  2844. </p>
  2845. </dd>
  2846. <dt><span><samp>cc_stream_map</samp></span></dt>
  2847. <dd><p>Map string which specifies different closed captions groups and their
  2848. attributes. The closed captions stream groups are separated by space.
  2849. Expected string format is like this
  2850. &quot;ccgroup:&lt;group name&gt;,instreamid:&lt;INSTREAM-ID&gt;,language:&lt;language code&gt; ....&quot;.
  2851. &rsquo;ccgroup&rsquo; and &rsquo;instreamid&rsquo; are mandatory attributes. &rsquo;language&rsquo; is an optional
  2852. attribute.
  2853. The closed captions groups configured using this option are mapped to different
  2854. variant streams by providing the same &rsquo;ccgroup&rsquo; name in the
  2855. <code>var_stream_map</code> string. If <code>var_stream_map</code> is not set, then the
  2856. first available ccgroup in <code>cc_stream_map</code> is mapped to the output variant
  2857. stream. The examples for these two use cases are given below.
  2858. </p>
  2859. <div class="example">
  2860. <pre class="example">ffmpeg -re -i in.ts -b:v 1000k -b:a 64k -a53cc 1 -f hls \
  2861. -cc_stream_map &quot;ccgroup:cc,instreamid:CC1,language:en&quot; \
  2862. -master_pl_name master.m3u8 \
  2863. http://example.com/live/out.m3u8
  2864. </pre></div>
  2865. <p>This example adds <code>#EXT-X-MEDIA</code> tag with <code>TYPE=CLOSED-CAPTIONS</code> in
  2866. the master playlist with group name &rsquo;cc&rsquo;, language &rsquo;en&rsquo; (english) and
  2867. INSTREAM-ID &rsquo;CC1&rsquo;. Also, it adds <code>CLOSED-CAPTIONS</code> attribute with group
  2868. name &rsquo;cc&rsquo; for the output variant stream.
  2869. </p><div class="example">
  2870. <pre class="example">ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  2871. -a53cc:0 1 -a53cc:1 1\
  2872. -map 0:v -map 0:a -map 0:v -map 0:a -f hls \
  2873. -cc_stream_map &quot;ccgroup:cc,instreamid:CC1,language:en ccgroup:cc,instreamid:CC2,language:sp&quot; \
  2874. -var_stream_map &quot;v:0,a:0,ccgroup:cc v:1,a:1,ccgroup:cc&quot; \
  2875. -master_pl_name master.m3u8 \
  2876. http://example.com/live/out_%v.m3u8
  2877. </pre></div>
  2878. <p>This example adds two <code>#EXT-X-MEDIA</code> tags with <code>TYPE=CLOSED-CAPTIONS</code> in
  2879. the master playlist for the INSTREAM-IDs &rsquo;CC1&rsquo; and &rsquo;CC2&rsquo;. Also, it adds
  2880. <code>CLOSED-CAPTIONS</code> attribute with group name &rsquo;cc&rsquo; for the two output variant
  2881. streams.
  2882. </p>
  2883. </dd>
  2884. <dt><span><samp>master_pl_name</samp></span></dt>
  2885. <dd><p>Create HLS master playlist with the given name.
  2886. </p>
  2887. <div class="example">
  2888. <pre class="example">ffmpeg -re -i in.ts -f hls -master_pl_name master.m3u8 http://example.com/live/out.m3u8
  2889. </pre></div>
  2890. <p>This example creates HLS master playlist with name master.m3u8 and it is
  2891. published at http://example.com/live/
  2892. </p>
  2893. </dd>
  2894. <dt><span><samp>master_pl_publish_rate</samp></span></dt>
  2895. <dd><p>Publish master play list repeatedly every after specified number of segment intervals.
  2896. </p>
  2897. <div class="example">
  2898. <pre class="example">ffmpeg -re -i in.ts -f hls -master_pl_name master.m3u8 \
  2899. -hls_time 2 -master_pl_publish_rate 30 http://example.com/live/out.m3u8
  2900. </pre></div>
  2901. <p>This example creates HLS master playlist with name master.m3u8 and keep
  2902. publishing it repeatedly every after 30 segments i.e. every after 60s.
  2903. </p>
  2904. </dd>
  2905. <dt><span><samp>http_persistent</samp></span></dt>
  2906. <dd><p>Use persistent HTTP connections. Applicable only for HTTP output.
  2907. </p>
  2908. </dd>
  2909. <dt><span><samp>timeout</samp></span></dt>
  2910. <dd><p>Set timeout for socket I/O operations. Applicable only for HTTP output.
  2911. </p>
  2912. </dd>
  2913. <dt><span><samp>-ignore_io_errors</samp></span></dt>
  2914. <dd><p>Ignore IO errors during open, write and delete. Useful for long-duration runs with network output.
  2915. </p>
  2916. </dd>
  2917. <dt><span><samp>headers</samp></span></dt>
  2918. <dd><p>Set custom HTTP headers, can override built in default headers. Applicable only for HTTP output.
  2919. </p>
  2920. </dd>
  2921. </dl>
  2922. <span id="ico"></span><a name="ico-1"></a>
  2923. <h3 class="section">4.18 ico<span class="pull-right"><a class="anchor hidden-xs" href="#ico-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ico-1" aria-hidden="true">TOC</a></span></h3>
  2924. <p>ICO file muxer.
  2925. </p>
  2926. <p>Microsoft&rsquo;s icon file format (ICO) has some strict limitations that should be noted:
  2927. </p>
  2928. <ul>
  2929. <li> Size cannot exceed 256 pixels in any dimension
  2930. </li><li> Only BMP and PNG images can be stored
  2931. </li><li> If a BMP image is used, it must be one of the following pixel formats:
  2932. <div class="example">
  2933. <pre class="example">BMP Bit Depth FFmpeg Pixel Format
  2934. 1bit pal8
  2935. 4bit pal8
  2936. 8bit pal8
  2937. 16bit rgb555le
  2938. 24bit bgr24
  2939. 32bit bgra
  2940. </pre></div>
  2941. </li><li> If a BMP image is used, it must use the BITMAPINFOHEADER DIB header
  2942. </li><li> If a PNG image is used, it must use the rgba pixel format
  2943. </li></ul>
  2944. <span id="image2"></span><a name="image2-2"></a>
  2945. <h3 class="section">4.19 image2<span class="pull-right"><a class="anchor hidden-xs" href="#image2-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-image2-2" aria-hidden="true">TOC</a></span></h3>
  2946. <p>Image file muxer.
  2947. </p>
  2948. <p>The image file muxer writes video frames to image files.
  2949. </p>
  2950. <p>The output filenames are specified by a pattern, which can be used to
  2951. produce sequentially numbered series of files.
  2952. The pattern may contain the string &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, this string
  2953. specifies the position of the characters representing a numbering in
  2954. the filenames. If the form &quot;%0<var>N</var>d&quot; is used, the string
  2955. representing the number in each filename is 0-padded to <var>N</var>
  2956. digits. The literal character &rsquo;%&rsquo; can be specified in the pattern with
  2957. the string &quot;%%&quot;.
  2958. </p>
  2959. <p>If the pattern contains &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, the first filename of
  2960. the file list specified will contain the number 1, all the following
  2961. numbers will be sequential.
  2962. </p>
  2963. <p>The pattern may contain a suffix which is used to automatically
  2964. determine the format of the image files to write.
  2965. </p>
  2966. <p>For example the pattern &quot;img-%03d.bmp&quot; will specify a sequence of
  2967. filenames of the form <samp>img-001.bmp</samp>, <samp>img-002.bmp</samp>, ...,
  2968. <samp>img-010.bmp</samp>, etc.
  2969. The pattern &quot;img%%-%d.jpg&quot; will specify a sequence of filenames of the
  2970. form <samp>img%-1.jpg</samp>, <samp>img%-2.jpg</samp>, ..., <samp>img%-10.jpg</samp>,
  2971. etc.
  2972. </p>
  2973. <p>The image muxer supports the .Y.U.V image file format. This format is
  2974. special in that that each image frame consists of three files, for
  2975. each of the YUV420P components. To read or write this image file format,
  2976. specify the name of the &rsquo;.Y&rsquo; file. The muxer will automatically open the
  2977. &rsquo;.U&rsquo; and &rsquo;.V&rsquo; files as required.
  2978. </p>
  2979. <a name="Options-11"></a>
  2980. <h4 class="subsection">4.19.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-11" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-11" aria-hidden="true">TOC</a></span></h4>
  2981. <dl compact="compact">
  2982. <dt><span><samp>frame_pts</samp></span></dt>
  2983. <dd><p>If set to 1, expand the filename with pts from pkt-&gt;pts.
  2984. Default value is 0.
  2985. </p>
  2986. </dd>
  2987. <dt><span><samp>start_number</samp></span></dt>
  2988. <dd><p>Start the sequence from the specified number. Default value is 1.
  2989. </p>
  2990. </dd>
  2991. <dt><span><samp>update</samp></span></dt>
  2992. <dd><p>If set to 1, the filename will always be interpreted as just a
  2993. filename, not a pattern, and the corresponding file will be continuously
  2994. overwritten with new images. Default value is 0.
  2995. </p>
  2996. </dd>
  2997. <dt><span><samp>strftime</samp></span></dt>
  2998. <dd><p>If set to 1, expand the filename with date and time information from
  2999. <code>strftime()</code>. Default value is 0.
  3000. </p>
  3001. </dd>
  3002. <dt><span><samp>atomic_writing</samp></span></dt>
  3003. <dd><p>Write output to a temporary file, which is renamed to target filename once
  3004. writing is completed. Default is disabled.
  3005. </p>
  3006. </dd>
  3007. <dt><span><samp>protocol_opts <var>options_list</var></samp></span></dt>
  3008. <dd><p>Set protocol options as a :-separated list of key=value parameters. Values
  3009. containing the <code>:</code> special character must be escaped.
  3010. </p>
  3011. </dd>
  3012. </dl>
  3013. <a name="Examples-8"></a>
  3014. <h4 class="subsection">4.19.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-8" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-8" aria-hidden="true">TOC</a></span></h4>
  3015. <p>The following example shows how to use <code>ffmpeg</code> for creating a
  3016. sequence of files <samp>img-001.jpeg</samp>, <samp>img-002.jpeg</samp>, ...,
  3017. taking one image every second from the input video:
  3018. </p><div class="example">
  3019. <pre class="example">ffmpeg -i in.avi -vsync cfr -r 1 -f image2 'img-%03d.jpeg'
  3020. </pre></div>
  3021. <p>Note that with <code>ffmpeg</code>, if the format is not specified with the
  3022. <code>-f</code> option and the output filename specifies an image file
  3023. format, the image2 muxer is automatically selected, so the previous
  3024. command can be written as:
  3025. </p><div class="example">
  3026. <pre class="example">ffmpeg -i in.avi -vsync cfr -r 1 'img-%03d.jpeg'
  3027. </pre></div>
  3028. <p>Note also that the pattern must not necessarily contain &quot;%d&quot; or
  3029. &quot;%0<var>N</var>d&quot;, for example to create a single image file
  3030. <samp>img.jpeg</samp> from the start of the input video you can employ the command:
  3031. </p><div class="example">
  3032. <pre class="example">ffmpeg -i in.avi -f image2 -frames:v 1 img.jpeg
  3033. </pre></div>
  3034. <p>The <samp>strftime</samp> option allows you to expand the filename with
  3035. date and time information. Check the documentation of
  3036. the <code>strftime()</code> function for the syntax.
  3037. </p>
  3038. <p>For example to generate image files from the <code>strftime()</code>
  3039. &quot;%Y-%m-%d_%H-%M-%S&quot; pattern, the following <code>ffmpeg</code> command
  3040. can be used:
  3041. </p><div class="example">
  3042. <pre class="example">ffmpeg -f v4l2 -r 1 -i /dev/video0 -f image2 -strftime 1 &quot;%Y-%m-%d_%H-%M-%S.jpg&quot;
  3043. </pre></div>
  3044. <p>You can set the file name with current frame&rsquo;s PTS:
  3045. </p><div class="example">
  3046. <pre class="example">ffmpeg -f v4l2 -r 1 -i /dev/video0 -copyts -f image2 -frame_pts true %d.jpg&quot;
  3047. </pre></div>
  3048. <p>A more complex example is to publish contents of your desktop directly to a
  3049. WebDAV server every second:
  3050. </p><div class="example">
  3051. <pre class="example">ffmpeg -f x11grab -framerate 1 -i :0.0 -q:v 6 -update 1 -protocol_opts method=PUT http://example.com/desktop.jpg
  3052. </pre></div>
  3053. <a name="matroska"></a>
  3054. <h3 class="section">4.20 matroska<span class="pull-right"><a class="anchor hidden-xs" href="#matroska" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-matroska" aria-hidden="true">TOC</a></span></h3>
  3055. <p>Matroska container muxer.
  3056. </p>
  3057. <p>This muxer implements the matroska and webm container specs.
  3058. </p>
  3059. <a name="Metadata"></a>
  3060. <h4 class="subsection">4.20.1 Metadata<span class="pull-right"><a class="anchor hidden-xs" href="#Metadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Metadata" aria-hidden="true">TOC</a></span></h4>
  3061. <p>The recognized metadata settings in this muxer are:
  3062. </p>
  3063. <dl compact="compact">
  3064. <dt><span><samp>title</samp></span></dt>
  3065. <dd><p>Set title name provided to a single track. This gets mapped to
  3066. the FileDescription element for a stream written as attachment.
  3067. </p>
  3068. </dd>
  3069. <dt><span><samp>language</samp></span></dt>
  3070. <dd><p>Specify the language of the track in the Matroska languages form.
  3071. </p>
  3072. <p>The language can be either the 3 letters bibliographic ISO-639-2 (ISO
  3073. 639-2/B) form (like &quot;fre&quot; for French), or a language code mixed with a
  3074. country code for specialities in languages (like &quot;fre-ca&quot; for Canadian
  3075. French).
  3076. </p>
  3077. </dd>
  3078. <dt><span><samp>stereo_mode</samp></span></dt>
  3079. <dd><p>Set stereo 3D video layout of two views in a single video track.
  3080. </p>
  3081. <p>The following values are recognized:
  3082. </p><dl compact="compact">
  3083. <dt><span>&lsquo;<samp>mono</samp>&rsquo;</span></dt>
  3084. <dd><p>video is not stereo
  3085. </p></dd>
  3086. <dt><span>&lsquo;<samp>left_right</samp>&rsquo;</span></dt>
  3087. <dd><p>Both views are arranged side by side, Left-eye view is on the left
  3088. </p></dd>
  3089. <dt><span>&lsquo;<samp>bottom_top</samp>&rsquo;</span></dt>
  3090. <dd><p>Both views are arranged in top-bottom orientation, Left-eye view is at bottom
  3091. </p></dd>
  3092. <dt><span>&lsquo;<samp>top_bottom</samp>&rsquo;</span></dt>
  3093. <dd><p>Both views are arranged in top-bottom orientation, Left-eye view is on top
  3094. </p></dd>
  3095. <dt><span>&lsquo;<samp>checkerboard_rl</samp>&rsquo;</span></dt>
  3096. <dd><p>Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first
  3097. </p></dd>
  3098. <dt><span>&lsquo;<samp>checkerboard_lr</samp>&rsquo;</span></dt>
  3099. <dd><p>Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first
  3100. </p></dd>
  3101. <dt><span>&lsquo;<samp>row_interleaved_rl</samp>&rsquo;</span></dt>
  3102. <dd><p>Each view is constituted by a row based interleaving, Right-eye view is first row
  3103. </p></dd>
  3104. <dt><span>&lsquo;<samp>row_interleaved_lr</samp>&rsquo;</span></dt>
  3105. <dd><p>Each view is constituted by a row based interleaving, Left-eye view is first row
  3106. </p></dd>
  3107. <dt><span>&lsquo;<samp>col_interleaved_rl</samp>&rsquo;</span></dt>
  3108. <dd><p>Both views are arranged in a column based interleaving manner, Right-eye view is first column
  3109. </p></dd>
  3110. <dt><span>&lsquo;<samp>col_interleaved_lr</samp>&rsquo;</span></dt>
  3111. <dd><p>Both views are arranged in a column based interleaving manner, Left-eye view is first column
  3112. </p></dd>
  3113. <dt><span>&lsquo;<samp>anaglyph_cyan_red</samp>&rsquo;</span></dt>
  3114. <dd><p>All frames are in anaglyph format viewable through red-cyan filters
  3115. </p></dd>
  3116. <dt><span>&lsquo;<samp>right_left</samp>&rsquo;</span></dt>
  3117. <dd><p>Both views are arranged side by side, Right-eye view is on the left
  3118. </p></dd>
  3119. <dt><span>&lsquo;<samp>anaglyph_green_magenta</samp>&rsquo;</span></dt>
  3120. <dd><p>All frames are in anaglyph format viewable through green-magenta filters
  3121. </p></dd>
  3122. <dt><span>&lsquo;<samp>block_lr</samp>&rsquo;</span></dt>
  3123. <dd><p>Both eyes laced in one Block, Left-eye view is first
  3124. </p></dd>
  3125. <dt><span>&lsquo;<samp>block_rl</samp>&rsquo;</span></dt>
  3126. <dd><p>Both eyes laced in one Block, Right-eye view is first
  3127. </p></dd>
  3128. </dl>
  3129. </dd>
  3130. </dl>
  3131. <p>For example a 3D WebM clip can be created using the following command line:
  3132. </p><div class="example">
  3133. <pre class="example">ffmpeg -i sample_left_right_clip.mpg -an -c:v libvpx -metadata stereo_mode=left_right -y stereo_clip.webm
  3134. </pre></div>
  3135. <a name="Options-12"></a>
  3136. <h4 class="subsection">4.20.2 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-12" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-12" aria-hidden="true">TOC</a></span></h4>
  3137. <p>This muxer supports the following options:
  3138. </p>
  3139. <dl compact="compact">
  3140. <dt><span><samp>reserve_index_space</samp></span></dt>
  3141. <dd><p>By default, this muxer writes the index for seeking (called cues in Matroska
  3142. terms) at the end of the file, because it cannot know in advance how much space
  3143. to leave for the index at the beginning of the file. However for some use cases
  3144. &ndash; e.g. streaming where seeking is possible but slow &ndash; it is useful to put the
  3145. index at the beginning of the file.
  3146. </p>
  3147. <p>If this option is set to a non-zero value, the muxer will reserve a given amount
  3148. of space in the file header and then try to write the cues there when the muxing
  3149. finishes. If the reserved space does not suffice, no Cues will be written, the
  3150. file will be finalized and writing the trailer will return an error.
  3151. A safe size for most use cases should be about 50kB per hour of video.
  3152. </p>
  3153. <p>Note that cues are only written if the output is seekable and this option will
  3154. have no effect if it is not.
  3155. </p>
  3156. </dd>
  3157. <dt><span><samp>cues_to_front</samp></span></dt>
  3158. <dd><p>If set, the muxer will write the index at the beginning of the file
  3159. by shifting the main data if necessary. This can be combined with
  3160. reserve_index_space in which case the data is only shifted if
  3161. the initially reserved space turns out to be insufficient.
  3162. </p>
  3163. <p>This option is ignored if the output is unseekable.
  3164. </p>
  3165. </dd>
  3166. <dt><span><samp>default_mode</samp></span></dt>
  3167. <dd><p>This option controls how the FlagDefault of the output tracks will be set.
  3168. It influences which tracks players should play by default. The default mode
  3169. is &lsquo;<samp>passthrough</samp>&rsquo;.
  3170. </p><dl compact="compact">
  3171. <dt><span>&lsquo;<samp>infer</samp>&rsquo;</span></dt>
  3172. <dd><p>Every track with disposition default will have the FlagDefault set.
  3173. Additionally, for each type of track (audio, video or subtitle), if no track
  3174. with disposition default of this type exists, then the first track of this type
  3175. will be marked as default (if existing). This ensures that the default flag
  3176. is set in a sensible way even if the input originated from containers that
  3177. lack the concept of default tracks.
  3178. </p></dd>
  3179. <dt><span>&lsquo;<samp>infer_no_subs</samp>&rsquo;</span></dt>
  3180. <dd><p>This mode is the same as infer except that if no subtitle track with
  3181. disposition default exists, no subtitle track will be marked as default.
  3182. </p></dd>
  3183. <dt><span>&lsquo;<samp>passthrough</samp>&rsquo;</span></dt>
  3184. <dd><p>In this mode the FlagDefault is set if and only if the AV_DISPOSITION_DEFAULT
  3185. flag is set in the disposition of the corresponding stream.
  3186. </p></dd>
  3187. </dl>
  3188. </dd>
  3189. <dt><span><samp>flipped_raw_rgb</samp></span></dt>
  3190. <dd><p>If set to true, store positive height for raw RGB bitmaps, which indicates
  3191. bitmap is stored bottom-up. Note that this option does not flip the bitmap
  3192. which has to be done manually beforehand, e.g. by using the vflip filter.
  3193. Default is <var>false</var> and indicates bitmap is stored top down.
  3194. </p>
  3195. </dd>
  3196. </dl>
  3197. <span id="md5"></span><a name="md5-1"></a>
  3198. <h3 class="section">4.21 md5<span class="pull-right"><a class="anchor hidden-xs" href="#md5-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-md5-1" aria-hidden="true">TOC</a></span></h3>
  3199. <p>MD5 testing format.
  3200. </p>
  3201. <p>This is a variant of the <a href="#hash">hash</a> muxer. Unlike that muxer, it
  3202. defaults to using the MD5 hash function.
  3203. </p>
  3204. <a name="Examples-9"></a>
  3205. <h4 class="subsection">4.21.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-9" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-9" aria-hidden="true">TOC</a></span></h4>
  3206. <p>To compute the MD5 hash of the input converted to raw
  3207. audio and video, and store it in the file <samp>out.md5</samp>:
  3208. </p><div class="example">
  3209. <pre class="example">ffmpeg -i INPUT -f md5 out.md5
  3210. </pre></div>
  3211. <p>You can print the MD5 to stdout with the command:
  3212. </p><div class="example">
  3213. <pre class="example">ffmpeg -i INPUT -f md5 -
  3214. </pre></div>
  3215. <p>See also the <a href="#hash">hash</a> and <a href="#framemd5">framemd5</a> muxers.
  3216. </p>
  3217. <a name="mov_002c-mp4_002c-ismv"></a>
  3218. <h3 class="section">4.22 mov, mp4, ismv<span class="pull-right"><a class="anchor hidden-xs" href="#mov_002c-mp4_002c-ismv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mov_002c-mp4_002c-ismv" aria-hidden="true">TOC</a></span></h3>
  3219. <p>MOV/MP4/ISMV (Smooth Streaming) muxer.
  3220. </p>
  3221. <p>The mov/mp4/ismv muxer supports fragmentation. Normally, a MOV/MP4
  3222. file has all the metadata about all packets stored in one location
  3223. (written at the end of the file, it can be moved to the start for
  3224. better playback by adding <var>faststart</var> to the <var>movflags</var>, or
  3225. using the <code>qt-faststart</code> tool). A fragmented
  3226. file consists of a number of fragments, where packets and metadata
  3227. about these packets are stored together. Writing a fragmented
  3228. file has the advantage that the file is decodable even if the
  3229. writing is interrupted (while a normal MOV/MP4 is undecodable if
  3230. it is not properly finished), and it requires less memory when writing
  3231. very long files (since writing normal MOV/MP4 files stores info about
  3232. every single packet in memory until the file is closed). The downside
  3233. is that it is less compatible with other applications.
  3234. </p>
  3235. <a name="Options-13"></a>
  3236. <h4 class="subsection">4.22.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-13" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-13" aria-hidden="true">TOC</a></span></h4>
  3237. <p>Fragmentation is enabled by setting one of the AVOptions that define
  3238. how to cut the file into fragments:
  3239. </p>
  3240. <dl compact="compact">
  3241. <dt><span><samp>-moov_size <var>bytes</var></samp></span></dt>
  3242. <dd><p>Reserves space for the moov atom at the beginning of the file instead of placing the
  3243. moov atom at the end. If the space reserved is insufficient, muxing will fail.
  3244. </p></dd>
  3245. <dt><span><samp>-movflags frag_keyframe</samp></span></dt>
  3246. <dd><p>Start a new fragment at each video keyframe.
  3247. </p></dd>
  3248. <dt><span><samp>-frag_duration <var>duration</var></samp></span></dt>
  3249. <dd><p>Create fragments that are <var>duration</var> microseconds long.
  3250. </p></dd>
  3251. <dt><span><samp>-frag_size <var>size</var></samp></span></dt>
  3252. <dd><p>Create fragments that contain up to <var>size</var> bytes of payload data.
  3253. </p></dd>
  3254. <dt><span><samp>-movflags frag_custom</samp></span></dt>
  3255. <dd><p>Allow the caller to manually choose when to cut fragments, by
  3256. calling <code>av_write_frame(ctx, NULL)</code> to write a fragment with
  3257. the packets written so far. (This is only useful with other
  3258. applications integrating libavformat, not from <code>ffmpeg</code>.)
  3259. </p></dd>
  3260. <dt><span><samp>-min_frag_duration <var>duration</var></samp></span></dt>
  3261. <dd><p>Don&rsquo;t create fragments that are shorter than <var>duration</var> microseconds long.
  3262. </p></dd>
  3263. </dl>
  3264. <p>If more than one condition is specified, fragments are cut when
  3265. one of the specified conditions is fulfilled. The exception to this is
  3266. <code>-min_frag_duration</code>, which has to be fulfilled for any of the other
  3267. conditions to apply.
  3268. </p>
  3269. <p>Additionally, the way the output file is written can be adjusted
  3270. through a few other options:
  3271. </p>
  3272. <dl compact="compact">
  3273. <dt><span><samp>-movflags empty_moov</samp></span></dt>
  3274. <dd><p>Write an initial moov atom directly at the start of the file, without
  3275. describing any samples in it. Generally, an mdat/moov pair is written
  3276. at the start of the file, as a normal MOV/MP4 file, containing only
  3277. a short portion of the file. With this option set, there is no initial
  3278. mdat atom, and the moov atom only describes the tracks but has
  3279. a zero duration.
  3280. </p>
  3281. <p>This option is implicitly set when writing ismv (Smooth Streaming) files.
  3282. </p></dd>
  3283. <dt><span><samp>-movflags separate_moof</samp></span></dt>
  3284. <dd><p>Write a separate moof (movie fragment) atom for each track. Normally,
  3285. packets for all tracks are written in a moof atom (which is slightly
  3286. more efficient), but with this option set, the muxer writes one moof/mdat
  3287. pair for each track, making it easier to separate tracks.
  3288. </p>
  3289. <p>This option is implicitly set when writing ismv (Smooth Streaming) files.
  3290. </p></dd>
  3291. <dt><span><samp>-movflags skip_sidx</samp></span></dt>
  3292. <dd><p>Skip writing of sidx atom. When bitrate overhead due to sidx atom is high,
  3293. this option could be used for cases where sidx atom is not mandatory.
  3294. When global_sidx flag is enabled, this option will be ignored.
  3295. </p></dd>
  3296. <dt><span><samp>-movflags faststart</samp></span></dt>
  3297. <dd><p>Run a second pass moving the index (moov atom) to the beginning of the file.
  3298. This operation can take a while, and will not work in various situations such
  3299. as fragmented output, thus it is not enabled by default.
  3300. </p></dd>
  3301. <dt><span><samp>-movflags rtphint</samp></span></dt>
  3302. <dd><p>Add RTP hinting tracks to the output file.
  3303. </p></dd>
  3304. <dt><span><samp>-movflags disable_chpl</samp></span></dt>
  3305. <dd><p>Disable Nero chapter markers (chpl atom). Normally, both Nero chapters
  3306. and a QuickTime chapter track are written to the file. With this option
  3307. set, only the QuickTime chapter track will be written. Nero chapters can
  3308. cause failures when the file is reprocessed with certain tagging programs, like
  3309. mp3Tag 2.61a and iTunes 11.3, most likely other versions are affected as well.
  3310. </p></dd>
  3311. <dt><span><samp>-movflags omit_tfhd_offset</samp></span></dt>
  3312. <dd><p>Do not write any absolute base_data_offset in tfhd atoms. This avoids
  3313. tying fragments to absolute byte positions in the file/streams.
  3314. </p></dd>
  3315. <dt><span><samp>-movflags default_base_moof</samp></span></dt>
  3316. <dd><p>Similarly to the omit_tfhd_offset, this flag avoids writing the
  3317. absolute base_data_offset field in tfhd atoms, but does so by using
  3318. the new default-base-is-moof flag instead. This flag is new from
  3319. 14496-12:2012. This may make the fragments easier to parse in certain
  3320. circumstances (avoiding basing track fragment location calculations
  3321. on the implicit end of the previous track fragment).
  3322. </p></dd>
  3323. <dt><span><samp>-write_tmcd</samp></span></dt>
  3324. <dd><p>Specify <code>on</code> to force writing a timecode track, <code>off</code> to disable it
  3325. and <code>auto</code> to write a timecode track only for mov and mp4 output (default).
  3326. </p></dd>
  3327. <dt><span><samp>-movflags negative_cts_offsets</samp></span></dt>
  3328. <dd><p>Enables utilization of version 1 of the CTTS box, in which the CTS offsets can
  3329. be negative. This enables the initial sample to have DTS/CTS of zero, and
  3330. reduces the need for edit lists for some cases such as video tracks with
  3331. B-frames. Additionally, eases conformance with the DASH-IF interoperability
  3332. guidelines.
  3333. </p>
  3334. <p>This option is implicitly set when writing ismv (Smooth Streaming) files.
  3335. </p>
  3336. </dd>
  3337. <dt><span><samp>-write_btrt <var>bool</var></samp></span></dt>
  3338. <dd><p>Force or disable writing bitrate box inside stsd box of a track.
  3339. The box contains decoding buffer size (in bytes), maximum bitrate and
  3340. average bitrate for the track. The box will be skipped if none of these values
  3341. can be computed.
  3342. Default is <code>-1</code> or <code>auto</code>, which will write the box only in MP4 mode.
  3343. </p>
  3344. </dd>
  3345. <dt><span><samp>-write_prft</samp></span></dt>
  3346. <dd><p>Write producer time reference box (PRFT) with a specified time source for the
  3347. NTP field in the PRFT box. Set value as &lsquo;<samp>wallclock</samp>&rsquo; to specify timesource
  3348. as wallclock time and &lsquo;<samp>pts</samp>&rsquo; to specify timesource as input packets&rsquo; PTS
  3349. values.
  3350. </p>
  3351. <p>Setting value to &lsquo;<samp>pts</samp>&rsquo; is applicable only for a live encoding use case,
  3352. where PTS values are set as as wallclock time at the source. For example, an
  3353. encoding use case with decklink capture source where <samp>video_pts</samp> and
  3354. <samp>audio_pts</samp> are set to &lsquo;<samp>abs_wallclock</samp>&rsquo;.
  3355. </p>
  3356. </dd>
  3357. <dt><span><samp>-empty_hdlr_name <var>bool</var></samp></span></dt>
  3358. <dd><p>Enable to skip writing the name inside a <code>hdlr</code> box.
  3359. Default is <code>false</code>.
  3360. </p>
  3361. </dd>
  3362. <dt><span><samp>-movie_timescale <var>scale</var></samp></span></dt>
  3363. <dd><p>Set the timescale written in the movie header box (<code>mvhd</code>).
  3364. Range is 1 to INT_MAX. Default is 1000.
  3365. </p>
  3366. </dd>
  3367. <dt><span><samp>-video_track_timescale <var>scale</var></samp></span></dt>
  3368. <dd><p>Set the timescale used for video tracks. Range is 0 to INT_MAX.
  3369. If set to <code>0</code>, the timescale is automatically set based on
  3370. the native stream time base. Default is 0.
  3371. </p></dd>
  3372. </dl>
  3373. <a name="Example"></a>
  3374. <h4 class="subsection">4.22.2 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example" aria-hidden="true">TOC</a></span></h4>
  3375. <p>Smooth Streaming content can be pushed in real time to a publishing
  3376. point on IIS with this muxer. Example:
  3377. </p><div class="example">
  3378. <pre class="example">ffmpeg -re <var>&lt;normal input/transcoding options&gt;</var> -movflags isml+frag_keyframe -f ismv http://server/publishingpoint.isml/Streams(Encoder1)
  3379. </pre></div>
  3380. <a name="mp3"></a>
  3381. <h3 class="section">4.23 mp3<span class="pull-right"><a class="anchor hidden-xs" href="#mp3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mp3" aria-hidden="true">TOC</a></span></h3>
  3382. <p>The MP3 muxer writes a raw MP3 stream with the following optional features:
  3383. </p><ul>
  3384. <li> An ID3v2 metadata header at the beginning (enabled by default). Versions 2.3 and
  3385. 2.4 are supported, the <code>id3v2_version</code> private option controls which one is
  3386. used (3 or 4). Setting <code>id3v2_version</code> to 0 disables the ID3v2 header
  3387. completely.
  3388. <p>The muxer supports writing attached pictures (APIC frames) to the ID3v2 header.
  3389. The pictures are supplied to the muxer in form of a video stream with a single
  3390. packet. There can be any number of those streams, each will correspond to a
  3391. single APIC frame. The stream metadata tags <var>title</var> and <var>comment</var> map
  3392. to APIC <var>description</var> and <var>picture type</var> respectively. See
  3393. <a href="http://id3.org/id3v2.4.0-frames">http://id3.org/id3v2.4.0-frames</a> for allowed picture types.
  3394. </p>
  3395. <p>Note that the APIC frames must be written at the beginning, so the muxer will
  3396. buffer the audio frames until it gets all the pictures. It is therefore advised
  3397. to provide the pictures as soon as possible to avoid excessive buffering.
  3398. </p>
  3399. </li><li> A Xing/LAME frame right after the ID3v2 header (if present). It is enabled by
  3400. default, but will be written only if the output is seekable. The
  3401. <code>write_xing</code> private option can be used to disable it. The frame contains
  3402. various information that may be useful to the decoder, like the audio duration
  3403. or encoder delay.
  3404. </li><li> A legacy ID3v1 tag at the end of the file (disabled by default). It may be
  3405. enabled with the <code>write_id3v1</code> private option, but as its capabilities are
  3406. very limited, its usage is not recommended.
  3407. </li></ul>
  3408. <p>Examples:
  3409. </p>
  3410. <p>Write an mp3 with an ID3v2.3 header and an ID3v1 footer:
  3411. </p><div class="example">
  3412. <pre class="example">ffmpeg -i INPUT -id3v2_version 3 -write_id3v1 1 out.mp3
  3413. </pre></div>
  3414. <p>To attach a picture to an mp3 file select both the audio and the picture stream
  3415. with <code>map</code>:
  3416. </p><div class="example">
  3417. <pre class="example">ffmpeg -i input.mp3 -i cover.png -c copy -map 0 -map 1
  3418. -metadata:s:v title=&quot;Album cover&quot; -metadata:s:v comment=&quot;Cover (Front)&quot; out.mp3
  3419. </pre></div>
  3420. <p>Write a &quot;clean&quot; MP3 without any extra features:
  3421. </p><div class="example">
  3422. <pre class="example">ffmpeg -i input.wav -write_xing 0 -id3v2_version 0 out.mp3
  3423. </pre></div>
  3424. <a name="mpegts-1"></a>
  3425. <h3 class="section">4.24 mpegts<span class="pull-right"><a class="anchor hidden-xs" href="#mpegts-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mpegts-1" aria-hidden="true">TOC</a></span></h3>
  3426. <p>MPEG transport stream muxer.
  3427. </p>
  3428. <p>This muxer implements ISO 13818-1 and part of ETSI EN 300 468.
  3429. </p>
  3430. <p>The recognized metadata settings in mpegts muxer are <code>service_provider</code>
  3431. and <code>service_name</code>. If they are not set the default for
  3432. <code>service_provider</code> is &lsquo;<samp>FFmpeg</samp>&rsquo; and the default for
  3433. <code>service_name</code> is &lsquo;<samp>Service01</samp>&rsquo;.
  3434. </p>
  3435. <a name="Options-14"></a>
  3436. <h4 class="subsection">4.24.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-14" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-14" aria-hidden="true">TOC</a></span></h4>
  3437. <p>The muxer options are:
  3438. </p>
  3439. <dl compact="compact">
  3440. <dt><span><samp>mpegts_transport_stream_id <var>integer</var></samp></span></dt>
  3441. <dd><p>Set the &lsquo;<samp>transport_stream_id</samp>&rsquo;. This identifies a transponder in DVB.
  3442. Default is <code>0x0001</code>.
  3443. </p>
  3444. </dd>
  3445. <dt><span><samp>mpegts_original_network_id <var>integer</var></samp></span></dt>
  3446. <dd><p>Set the &lsquo;<samp>original_network_id</samp>&rsquo;. This is unique identifier of a
  3447. network in DVB. Its main use is in the unique identification of a service
  3448. through the path &lsquo;<samp>Original_Network_ID, Transport_Stream_ID</samp>&rsquo;. Default
  3449. is <code>0x0001</code>.
  3450. </p>
  3451. </dd>
  3452. <dt><span><samp>mpegts_service_id <var>integer</var></samp></span></dt>
  3453. <dd><p>Set the &lsquo;<samp>service_id</samp>&rsquo;, also known as program in DVB. Default is
  3454. <code>0x0001</code>.
  3455. </p>
  3456. </dd>
  3457. <dt><span><samp>mpegts_service_type <var>integer</var></samp></span></dt>
  3458. <dd><p>Set the program &lsquo;<samp>service_type</samp>&rsquo;. Default is <code>digital_tv</code>.
  3459. Accepts the following options:
  3460. </p><dl compact="compact">
  3461. <dt><span>&lsquo;<samp>hex_value</samp>&rsquo;</span></dt>
  3462. <dd><p>Any hexadecimal value between <code>0x01</code> and <code>0xff</code> as defined in
  3463. ETSI 300 468.
  3464. </p></dd>
  3465. <dt><span>&lsquo;<samp>digital_tv</samp>&rsquo;</span></dt>
  3466. <dd><p>Digital TV service.
  3467. </p></dd>
  3468. <dt><span>&lsquo;<samp>digital_radio</samp>&rsquo;</span></dt>
  3469. <dd><p>Digital Radio service.
  3470. </p></dd>
  3471. <dt><span>&lsquo;<samp>teletext</samp>&rsquo;</span></dt>
  3472. <dd><p>Teletext service.
  3473. </p></dd>
  3474. <dt><span>&lsquo;<samp>advanced_codec_digital_radio</samp>&rsquo;</span></dt>
  3475. <dd><p>Advanced Codec Digital Radio service.
  3476. </p></dd>
  3477. <dt><span>&lsquo;<samp>mpeg2_digital_hdtv</samp>&rsquo;</span></dt>
  3478. <dd><p>MPEG2 Digital HDTV service.
  3479. </p></dd>
  3480. <dt><span>&lsquo;<samp>advanced_codec_digital_sdtv</samp>&rsquo;</span></dt>
  3481. <dd><p>Advanced Codec Digital SDTV service.
  3482. </p></dd>
  3483. <dt><span>&lsquo;<samp>advanced_codec_digital_hdtv</samp>&rsquo;</span></dt>
  3484. <dd><p>Advanced Codec Digital HDTV service.
  3485. </p></dd>
  3486. </dl>
  3487. </dd>
  3488. <dt><span><samp>mpegts_pmt_start_pid <var>integer</var></samp></span></dt>
  3489. <dd><p>Set the first PID for PMTs. Default is <code>0x1000</code>, minimum is <code>0x0020</code>,
  3490. maximum is <code>0x1ffa</code>. This option has no effect in m2ts mode where the PMT
  3491. PID is fixed <code>0x0100</code>.
  3492. </p>
  3493. </dd>
  3494. <dt><span><samp>mpegts_start_pid <var>integer</var></samp></span></dt>
  3495. <dd><p>Set the first PID for elementary streams. Default is <code>0x0100</code>, minimum is
  3496. <code>0x0020</code>, maximum is <code>0x1ffa</code>. This option has no effect in m2ts mode
  3497. where the elementary stream PIDs are fixed.
  3498. </p>
  3499. </dd>
  3500. <dt><span><samp>mpegts_m2ts_mode <var>boolean</var></samp></span></dt>
  3501. <dd><p>Enable m2ts mode if set to <code>1</code>. Default value is <code>-1</code> which
  3502. disables m2ts mode.
  3503. </p>
  3504. </dd>
  3505. <dt><span><samp>muxrate <var>integer</var></samp></span></dt>
  3506. <dd><p>Set a constant muxrate. Default is VBR.
  3507. </p>
  3508. </dd>
  3509. <dt><span><samp>pes_payload_size <var>integer</var></samp></span></dt>
  3510. <dd><p>Set minimum PES packet payload in bytes. Default is <code>2930</code>.
  3511. </p>
  3512. </dd>
  3513. <dt><span><samp>mpegts_flags <var>flags</var></samp></span></dt>
  3514. <dd><p>Set mpegts flags. Accepts the following options:
  3515. </p><dl compact="compact">
  3516. <dt><span>&lsquo;<samp>resend_headers</samp>&rsquo;</span></dt>
  3517. <dd><p>Reemit PAT/PMT before writing the next packet.
  3518. </p></dd>
  3519. <dt><span>&lsquo;<samp>latm</samp>&rsquo;</span></dt>
  3520. <dd><p>Use LATM packetization for AAC.
  3521. </p></dd>
  3522. <dt><span>&lsquo;<samp>pat_pmt_at_frames</samp>&rsquo;</span></dt>
  3523. <dd><p>Reemit PAT and PMT at each video frame.
  3524. </p></dd>
  3525. <dt><span>&lsquo;<samp>system_b</samp>&rsquo;</span></dt>
  3526. <dd><p>Conform to System B (DVB) instead of System A (ATSC).
  3527. </p></dd>
  3528. <dt><span>&lsquo;<samp>initial_discontinuity</samp>&rsquo;</span></dt>
  3529. <dd><p>Mark the initial packet of each stream as discontinuity.
  3530. </p></dd>
  3531. <dt><span>&lsquo;<samp>nit</samp>&rsquo;</span></dt>
  3532. <dd><p>Emit NIT table.
  3533. </p></dd>
  3534. <dt><span>&lsquo;<samp>omit_rai</samp>&rsquo;</span></dt>
  3535. <dd><p>Disable writing of random access indicator.
  3536. </p></dd>
  3537. </dl>
  3538. </dd>
  3539. <dt><span><samp>mpegts_copyts <var>boolean</var></samp></span></dt>
  3540. <dd><p>Preserve original timestamps, if value is set to <code>1</code>. Default value
  3541. is <code>-1</code>, which results in shifting timestamps so that they start from 0.
  3542. </p>
  3543. </dd>
  3544. <dt><span><samp>omit_video_pes_length <var>boolean</var></samp></span></dt>
  3545. <dd><p>Omit the PES packet length for video packets. Default is <code>1</code> (true).
  3546. </p>
  3547. </dd>
  3548. <dt><span><samp>pcr_period <var>integer</var></samp></span></dt>
  3549. <dd><p>Override the default PCR retransmission time in milliseconds. Default is
  3550. <code>-1</code> which means that the PCR interval will be determined automatically:
  3551. 20 ms is used for CBR streams, the highest multiple of the frame duration which
  3552. is less than 100 ms is used for VBR streams.
  3553. </p>
  3554. </dd>
  3555. <dt><span><samp>pat_period <var>duration</var></samp></span></dt>
  3556. <dd><p>Maximum time in seconds between PAT/PMT tables. Default is <code>0.1</code>.
  3557. </p>
  3558. </dd>
  3559. <dt><span><samp>sdt_period <var>duration</var></samp></span></dt>
  3560. <dd><p>Maximum time in seconds between SDT tables. Default is <code>0.5</code>.
  3561. </p>
  3562. </dd>
  3563. <dt><span><samp>nit_period <var>duration</var></samp></span></dt>
  3564. <dd><p>Maximum time in seconds between NIT tables. Default is <code>0.5</code>.
  3565. </p>
  3566. </dd>
  3567. <dt><span><samp>tables_version <var>integer</var></samp></span></dt>
  3568. <dd><p>Set PAT, PMT, SDT and NIT version (default <code>0</code>, valid values are from 0 to 31, inclusively).
  3569. This option allows updating stream structure so that standard consumer may
  3570. detect the change. To do so, reopen output <code>AVFormatContext</code> (in case of API
  3571. usage) or restart <code>ffmpeg</code> instance, cyclically changing
  3572. <samp>tables_version</samp> value:
  3573. </p>
  3574. <div class="example">
  3575. <pre class="example">ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udp://1.1.1.1:1111
  3576. ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
  3577. ...
  3578. ffmpeg -i source3.ts -codec copy -f mpegts -tables_version 31 udp://1.1.1.1:1111
  3579. ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udp://1.1.1.1:1111
  3580. ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
  3581. ...
  3582. </pre></div>
  3583. </dd>
  3584. </dl>
  3585. <a name="Example-1"></a>
  3586. <h4 class="subsection">4.24.2 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-1" aria-hidden="true">TOC</a></span></h4>
  3587. <div class="example">
  3588. <pre class="example">ffmpeg -i file.mpg -c copy \
  3589. -mpegts_original_network_id 0x1122 \
  3590. -mpegts_transport_stream_id 0x3344 \
  3591. -mpegts_service_id 0x5566 \
  3592. -mpegts_pmt_start_pid 0x1500 \
  3593. -mpegts_start_pid 0x150 \
  3594. -metadata service_provider=&quot;Some provider&quot; \
  3595. -metadata service_name=&quot;Some Channel&quot; \
  3596. out.ts
  3597. </pre></div>
  3598. <a name="mxf_002c-mxf_005fd10_002c-mxf_005fopatom"></a>
  3599. <h3 class="section">4.25 mxf, mxf_d10, mxf_opatom<span class="pull-right"><a class="anchor hidden-xs" href="#mxf_002c-mxf_005fd10_002c-mxf_005fopatom" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mxf_002c-mxf_005fd10_002c-mxf_005fopatom" aria-hidden="true">TOC</a></span></h3>
  3600. <p>MXF muxer.
  3601. </p>
  3602. <a name="Options-15"></a>
  3603. <h4 class="subsection">4.25.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-15" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-15" aria-hidden="true">TOC</a></span></h4>
  3604. <p>The muxer options are:
  3605. </p>
  3606. <dl compact="compact">
  3607. <dt><span><samp>store_user_comments <var>bool</var></samp></span></dt>
  3608. <dd><p>Set if user comments should be stored if available or never.
  3609. IRT D-10 does not allow user comments. The default is thus to write them for
  3610. mxf and mxf_opatom but not for mxf_d10
  3611. </p></dd>
  3612. </dl>
  3613. <a name="null"></a>
  3614. <h3 class="section">4.26 null<span class="pull-right"><a class="anchor hidden-xs" href="#null" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-null" aria-hidden="true">TOC</a></span></h3>
  3615. <p>Null muxer.
  3616. </p>
  3617. <p>This muxer does not generate any output file, it is mainly useful for
  3618. testing or benchmarking purposes.
  3619. </p>
  3620. <p>For example to benchmark decoding with <code>ffmpeg</code> you can use the
  3621. command:
  3622. </p><div class="example">
  3623. <pre class="example">ffmpeg -benchmark -i INPUT -f null out.null
  3624. </pre></div>
  3625. <p>Note that the above command does not read or write the <samp>out.null</samp>
  3626. file, but specifying the output file is required by the <code>ffmpeg</code>
  3627. syntax.
  3628. </p>
  3629. <p>Alternatively you can write the command as:
  3630. </p><div class="example">
  3631. <pre class="example">ffmpeg -benchmark -i INPUT -f null -
  3632. </pre></div>
  3633. <a name="nut"></a>
  3634. <h3 class="section">4.27 nut<span class="pull-right"><a class="anchor hidden-xs" href="#nut" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-nut" aria-hidden="true">TOC</a></span></h3>
  3635. <dl compact="compact">
  3636. <dt><span><samp>-syncpoints <var>flags</var></samp></span></dt>
  3637. <dd><p>Change the syncpoint usage in nut:
  3638. </p><dl compact="compact">
  3639. <dt><span><samp><var>default</var> use the normal low-overhead seeking aids.</samp></span></dt>
  3640. <dt><span><samp><var>none</var> do not use the syncpoints at all, reducing the overhead but making the stream non-seekable;</samp></span></dt>
  3641. <dd><p>Use of this option is not recommended, as the resulting files are very damage
  3642. sensitive and seeking is not possible. Also in general the overhead from
  3643. syncpoints is negligible. Note, -<code>write_index</code> 0 can be used to disable
  3644. all growing data tables, allowing to mux endless streams with limited memory
  3645. and without these disadvantages.
  3646. </p></dd>
  3647. <dt><span><samp><var>timestamped</var> extend the syncpoint with a wallclock field.</samp></span></dt>
  3648. </dl>
  3649. <p>The <var>none</var> and <var>timestamped</var> flags are experimental.
  3650. </p></dd>
  3651. <dt><span><samp>-write_index <var>bool</var></samp></span></dt>
  3652. <dd><p>Write index at the end, the default is to write an index.
  3653. </p></dd>
  3654. </dl>
  3655. <div class="example">
  3656. <pre class="example">ffmpeg -i INPUT -f_strict experimental -syncpoints none - | processor
  3657. </pre></div>
  3658. <a name="ogg"></a>
  3659. <h3 class="section">4.28 ogg<span class="pull-right"><a class="anchor hidden-xs" href="#ogg" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ogg" aria-hidden="true">TOC</a></span></h3>
  3660. <p>Ogg container muxer.
  3661. </p>
  3662. <dl compact="compact">
  3663. <dt><span><samp>-page_duration <var>duration</var></samp></span></dt>
  3664. <dd><p>Preferred page duration, in microseconds. The muxer will attempt to create
  3665. pages that are approximately <var>duration</var> microseconds long. This allows the
  3666. user to compromise between seek granularity and container overhead. The default
  3667. is 1 second. A value of 0 will fill all segments, making pages as large as
  3668. possible. A value of 1 will effectively use 1 packet-per-page in most
  3669. situations, giving a small seek granularity at the cost of additional container
  3670. overhead.
  3671. </p></dd>
  3672. <dt><span><samp>-serial_offset <var>value</var></samp></span></dt>
  3673. <dd><p>Serial value from which to set the streams serial number.
  3674. Setting it to different and sufficiently large values ensures that the produced
  3675. ogg files can be safely chained.
  3676. </p>
  3677. </dd>
  3678. </dl>
  3679. <span id="raw-muxers"></span><a name="raw-muxers-1"></a>
  3680. <h3 class="section">4.29 raw muxers<span class="pull-right"><a class="anchor hidden-xs" href="#raw-muxers-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-raw-muxers-1" aria-hidden="true">TOC</a></span></h3>
  3681. <p>Raw muxers accept a single stream matching the designated codec. They do not store timestamps or metadata.
  3682. The recognized extension is the same as the muxer name unless indicated otherwise.
  3683. </p>
  3684. <a name="ac3"></a>
  3685. <h4 class="subsection">4.29.1 ac3<span class="pull-right"><a class="anchor hidden-xs" href="#ac3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ac3" aria-hidden="true">TOC</a></span></h4>
  3686. <p>Dolby Digital, also known as AC-3, audio.
  3687. </p>
  3688. <a name="adx"></a>
  3689. <h4 class="subsection">4.29.2 adx<span class="pull-right"><a class="anchor hidden-xs" href="#adx" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adx" aria-hidden="true">TOC</a></span></h4>
  3690. <p>CRI Middleware ADX audio.
  3691. </p>
  3692. <p>This muxer will write out the total sample count near the start of the first packet
  3693. when the output is seekable and the count can be stored in 32 bits.
  3694. </p>
  3695. <a name="aptx"></a>
  3696. <h4 class="subsection">4.29.3 aptx<span class="pull-right"><a class="anchor hidden-xs" href="#aptx" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aptx" aria-hidden="true">TOC</a></span></h4>
  3697. <p>aptX (Audio Processing Technology for Bluetooth) audio.
  3698. </p>
  3699. <a name="aptx_005fhd"></a>
  3700. <h4 class="subsection">4.29.4 aptx_hd<span class="pull-right"><a class="anchor hidden-xs" href="#aptx_005fhd" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aptx_005fhd" aria-hidden="true">TOC</a></span></h4>
  3701. <p>aptX HD (Audio Processing Technology for Bluetooth) audio.
  3702. </p>
  3703. <p>Extensions: aptxhd
  3704. </p>
  3705. <a name="avs2"></a>
  3706. <h4 class="subsection">4.29.5 avs2<span class="pull-right"><a class="anchor hidden-xs" href="#avs2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-avs2" aria-hidden="true">TOC</a></span></h4>
  3707. <p>AVS2-P2/IEEE1857.4 video.
  3708. </p>
  3709. <p>Extensions: avs, avs2
  3710. </p>
  3711. <a name="cavsvideo"></a>
  3712. <h4 class="subsection">4.29.6 cavsvideo<span class="pull-right"><a class="anchor hidden-xs" href="#cavsvideo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-cavsvideo" aria-hidden="true">TOC</a></span></h4>
  3713. <p>Chinese AVS (Audio Video Standard) video.
  3714. </p>
  3715. <p>Extensions: cavs
  3716. </p>
  3717. <a name="codec2raw"></a>
  3718. <h4 class="subsection">4.29.7 codec2raw<span class="pull-right"><a class="anchor hidden-xs" href="#codec2raw" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-codec2raw" aria-hidden="true">TOC</a></span></h4>
  3719. <p>Codec 2 audio.
  3720. </p>
  3721. <p>No extension is registered so format name has to be supplied e.g. with the ffmpeg CLI tool <code>-f codec2raw</code>.
  3722. </p>
  3723. <a name="data"></a>
  3724. <h4 class="subsection">4.29.8 data<span class="pull-right"><a class="anchor hidden-xs" href="#data" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-data" aria-hidden="true">TOC</a></span></h4>
  3725. <p>Data muxer accepts a single stream with any codec of any type.
  3726. The input stream has to be selected using the <code>-map</code> option with the ffmpeg CLI tool.
  3727. </p>
  3728. <p>No extension is registered so format name has to be supplied e.g. with the ffmpeg CLI tool <code>-f data</code>.
  3729. </p>
  3730. <a name="dirac"></a>
  3731. <h4 class="subsection">4.29.9 dirac<span class="pull-right"><a class="anchor hidden-xs" href="#dirac" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dirac" aria-hidden="true">TOC</a></span></h4>
  3732. <p>BBC Dirac video. The Dirac Pro codec is a subset and is standardized as SMPTE VC-2.
  3733. </p>
  3734. <p>Extensions: drc, vc2
  3735. </p>
  3736. <a name="dnxhd"></a>
  3737. <h4 class="subsection">4.29.10 dnxhd<span class="pull-right"><a class="anchor hidden-xs" href="#dnxhd" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dnxhd" aria-hidden="true">TOC</a></span></h4>
  3738. <p>Avid DNxHD video. It is standardized as SMPTE VC-3. Accepts DNxHR streams.
  3739. </p>
  3740. <p>Extensions: dnxhd, dnxhr
  3741. </p>
  3742. <a name="dts"></a>
  3743. <h4 class="subsection">4.29.11 dts<span class="pull-right"><a class="anchor hidden-xs" href="#dts" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dts" aria-hidden="true">TOC</a></span></h4>
  3744. <p>DTS Coherent Acoustics (DCA) audio.
  3745. </p>
  3746. <a name="eac3"></a>
  3747. <h4 class="subsection">4.29.12 eac3<span class="pull-right"><a class="anchor hidden-xs" href="#eac3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-eac3" aria-hidden="true">TOC</a></span></h4>
  3748. <p>Dolby Digital Plus, also known as Enhanced AC-3, audio.
  3749. </p>
  3750. <a name="g722"></a>
  3751. <h4 class="subsection">4.29.13 g722<span class="pull-right"><a class="anchor hidden-xs" href="#g722" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-g722" aria-hidden="true">TOC</a></span></h4>
  3752. <p>ITU-T G.722 audio.
  3753. </p>
  3754. <a name="g723_005f1"></a>
  3755. <h4 class="subsection">4.29.14 g723_1<span class="pull-right"><a class="anchor hidden-xs" href="#g723_005f1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-g723_005f1" aria-hidden="true">TOC</a></span></h4>
  3756. <p>ITU-T G.723.1 audio.
  3757. </p>
  3758. <p>Extensions: tco, rco
  3759. </p>
  3760. <a name="g726"></a>
  3761. <h4 class="subsection">4.29.15 g726<span class="pull-right"><a class="anchor hidden-xs" href="#g726" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-g726" aria-hidden="true">TOC</a></span></h4>
  3762. <p>ITU-T G.726 big-endian (&quot;left-justified&quot;) audio.
  3763. </p>
  3764. <p>No extension is registered so format name has to be supplied e.g. with the ffmpeg CLI tool <code>-f g726</code>.
  3765. </p>
  3766. <a name="g726le"></a>
  3767. <h4 class="subsection">4.29.16 g726le<span class="pull-right"><a class="anchor hidden-xs" href="#g726le" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-g726le" aria-hidden="true">TOC</a></span></h4>
  3768. <p>ITU-T G.726 little-endian (&quot;right-justified&quot;) audio.
  3769. </p>
  3770. <p>No extension is registered so format name has to be supplied e.g. with the ffmpeg CLI tool <code>-f g726le</code>.
  3771. </p>
  3772. <a name="gsm"></a>
  3773. <h4 class="subsection">4.29.17 gsm<span class="pull-right"><a class="anchor hidden-xs" href="#gsm" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gsm" aria-hidden="true">TOC</a></span></h4>
  3774. <p>Global System for Mobile Communications audio.
  3775. </p>
  3776. <a name="h261"></a>
  3777. <h4 class="subsection">4.29.18 h261<span class="pull-right"><a class="anchor hidden-xs" href="#h261" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-h261" aria-hidden="true">TOC</a></span></h4>
  3778. <p>ITU-T H.261 video.
  3779. </p>
  3780. <a name="h263"></a>
  3781. <h4 class="subsection">4.29.19 h263<span class="pull-right"><a class="anchor hidden-xs" href="#h263" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-h263" aria-hidden="true">TOC</a></span></h4>
  3782. <p>ITU-T H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2 video.
  3783. </p>
  3784. <a name="h264"></a>
  3785. <h4 class="subsection">4.29.20 h264<span class="pull-right"><a class="anchor hidden-xs" href="#h264" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-h264" aria-hidden="true">TOC</a></span></h4>
  3786. <p>ITU-T H.264 / MPEG-4 Part 10 AVC video. Bitstream shall be converted to Annex B syntax if it&rsquo;s in length-prefixed mode.
  3787. </p>
  3788. <p>Extensions: h264, 264
  3789. </p>
  3790. <a name="hevc"></a>
  3791. <h4 class="subsection">4.29.21 hevc<span class="pull-right"><a class="anchor hidden-xs" href="#hevc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hevc" aria-hidden="true">TOC</a></span></h4>
  3792. <p>ITU-T H.265 / MPEG-H Part 2 HEVC video. Bitstream shall be converted to Annex B syntax if it&rsquo;s in length-prefixed mode.
  3793. </p>
  3794. <p>Extensions: hevc, h265, 265
  3795. </p>
  3796. <a name="m4v"></a>
  3797. <h4 class="subsection">4.29.22 m4v<span class="pull-right"><a class="anchor hidden-xs" href="#m4v" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-m4v" aria-hidden="true">TOC</a></span></h4>
  3798. <p>MPEG-4 Part 2 video.
  3799. </p>
  3800. <a name="mjpeg"></a>
  3801. <h4 class="subsection">4.29.23 mjpeg<span class="pull-right"><a class="anchor hidden-xs" href="#mjpeg" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mjpeg" aria-hidden="true">TOC</a></span></h4>
  3802. <p>Motion JPEG video.
  3803. </p>
  3804. <p>Extensions: mjpg, mjpeg
  3805. </p>
  3806. <a name="mlp"></a>
  3807. <h4 class="subsection">4.29.24 mlp<span class="pull-right"><a class="anchor hidden-xs" href="#mlp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mlp" aria-hidden="true">TOC</a></span></h4>
  3808. <p>Meridian Lossless Packing, also known as Packed PCM, audio.
  3809. </p>
  3810. <a name="mp2"></a>
  3811. <h4 class="subsection">4.29.25 mp2<span class="pull-right"><a class="anchor hidden-xs" href="#mp2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mp2" aria-hidden="true">TOC</a></span></h4>
  3812. <p>MPEG-1 Audio Layer II audio.
  3813. </p>
  3814. <p>Extensions: mp2, m2a, mpa
  3815. </p>
  3816. <a name="mpeg1video"></a>
  3817. <h4 class="subsection">4.29.26 mpeg1video<span class="pull-right"><a class="anchor hidden-xs" href="#mpeg1video" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mpeg1video" aria-hidden="true">TOC</a></span></h4>
  3818. <p>MPEG-1 Part 2 video.
  3819. </p>
  3820. <p>Extensions: mpg, mpeg, m1v
  3821. </p>
  3822. <a name="mpeg2video"></a>
  3823. <h4 class="subsection">4.29.27 mpeg2video<span class="pull-right"><a class="anchor hidden-xs" href="#mpeg2video" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mpeg2video" aria-hidden="true">TOC</a></span></h4>
  3824. <p>ITU-T H.262 / MPEG-2 Part 2 video.
  3825. </p>
  3826. <p>Extensions: m2v
  3827. </p>
  3828. <a name="obu"></a>
  3829. <h4 class="subsection">4.29.28 obu<span class="pull-right"><a class="anchor hidden-xs" href="#obu" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-obu" aria-hidden="true">TOC</a></span></h4>
  3830. <p>AV1 low overhead Open Bitstream Units muxer. Temporal delimiter OBUs will be inserted in all temporal units of the stream.
  3831. </p>
  3832. <a name="rawvideo-1"></a>
  3833. <h4 class="subsection">4.29.29 rawvideo<span class="pull-right"><a class="anchor hidden-xs" href="#rawvideo-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rawvideo-1" aria-hidden="true">TOC</a></span></h4>
  3834. <p>Raw uncompressed video.
  3835. </p>
  3836. <p>Extensions: yuv, rgb
  3837. </p>
  3838. <a name="sbc"></a>
  3839. <h4 class="subsection">4.29.30 sbc<span class="pull-right"><a class="anchor hidden-xs" href="#sbc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sbc" aria-hidden="true">TOC</a></span></h4>
  3840. <p>Bluetooth SIG low-complexity subband codec audio.
  3841. </p>
  3842. <p>Extensions: sbc, msbc
  3843. </p>
  3844. <a name="truehd"></a>
  3845. <h4 class="subsection">4.29.31 truehd<span class="pull-right"><a class="anchor hidden-xs" href="#truehd" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-truehd" aria-hidden="true">TOC</a></span></h4>
  3846. <p>Dolby TrueHD audio.
  3847. </p>
  3848. <p>Extensions: thd
  3849. </p>
  3850. <a name="vc1"></a>
  3851. <h4 class="subsection">4.29.32 vc1<span class="pull-right"><a class="anchor hidden-xs" href="#vc1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vc1" aria-hidden="true">TOC</a></span></h4>
  3852. <p>SMPTE 421M / VC-1 video.
  3853. </p>
  3854. <span id="segment"></span><a name="segment_002c-stream_005fsegment_002c-ssegment"></a>
  3855. <h3 class="section">4.30 segment, stream_segment, ssegment<span class="pull-right"><a class="anchor hidden-xs" href="#segment_002c-stream_005fsegment_002c-ssegment" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-segment_002c-stream_005fsegment_002c-ssegment" aria-hidden="true">TOC</a></span></h3>
  3856. <p>Basic stream segmenter.
  3857. </p>
  3858. <p>This muxer outputs streams to a number of separate files of nearly
  3859. fixed duration. Output filename pattern can be set in a fashion
  3860. similar to <a href="#image2">image2</a>, or by using a <code>strftime</code> template if
  3861. the <samp>strftime</samp> option is enabled.
  3862. </p>
  3863. <p><code>stream_segment</code> is a variant of the muxer used to write to
  3864. streaming output formats, i.e. which do not require global headers,
  3865. and is recommended for outputting e.g. to MPEG transport stream segments.
  3866. <code>ssegment</code> is a shorter alias for <code>stream_segment</code>.
  3867. </p>
  3868. <p>Every segment starts with a keyframe of the selected reference stream,
  3869. which is set through the <samp>reference_stream</samp> option.
  3870. </p>
  3871. <p>Note that if you want accurate splitting for a video file, you need to
  3872. make the input key frames correspond to the exact splitting times
  3873. expected by the segmenter, or the segment muxer will start the new
  3874. segment with the key frame found next after the specified start
  3875. time.
  3876. </p>
  3877. <p>The segment muxer works best with a single constant frame rate video.
  3878. </p>
  3879. <p>Optionally it can generate a list of the created segments, by setting
  3880. the option <var>segment_list</var>. The list type is specified by the
  3881. <var>segment_list_type</var> option. The entry filenames in the segment
  3882. list are set by default to the basename of the corresponding segment
  3883. files.
  3884. </p>
  3885. <p>See also the <a href="#hls">hls</a> muxer, which provides a more specific
  3886. implementation for HLS segmentation.
  3887. </p>
  3888. <a name="Options-16"></a>
  3889. <h4 class="subsection">4.30.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-16" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-16" aria-hidden="true">TOC</a></span></h4>
  3890. <p>The segment muxer supports the following options:
  3891. </p>
  3892. <dl compact="compact">
  3893. <dt><span><samp>increment_tc <var>1|0</var></samp></span></dt>
  3894. <dd><p>if set to <code>1</code>, increment timecode between each segment
  3895. If this is selected, the input need to have
  3896. a timecode in the first video stream. Default value is
  3897. <code>0</code>.
  3898. </p>
  3899. </dd>
  3900. <dt><span><samp>reference_stream <var>specifier</var></samp></span></dt>
  3901. <dd><p>Set the reference stream, as specified by the string <var>specifier</var>.
  3902. If <var>specifier</var> is set to <code>auto</code>, the reference is chosen
  3903. automatically. Otherwise it must be a stream specifier (see the &ldquo;Stream
  3904. specifiers&rdquo; chapter in the ffmpeg manual) which specifies the
  3905. reference stream. The default value is <code>auto</code>.
  3906. </p>
  3907. </dd>
  3908. <dt><span><samp>segment_format <var>format</var></samp></span></dt>
  3909. <dd><p>Override the inner container format, by default it is guessed by the filename
  3910. extension.
  3911. </p>
  3912. </dd>
  3913. <dt><span><samp>segment_format_options <var>options_list</var></samp></span></dt>
  3914. <dd><p>Set output format options using a :-separated list of key=value
  3915. parameters. Values containing the <code>:</code> special character must be
  3916. escaped.
  3917. </p>
  3918. </dd>
  3919. <dt><span><samp>segment_list <var>name</var></samp></span></dt>
  3920. <dd><p>Generate also a listfile named <var>name</var>. If not specified no
  3921. listfile is generated.
  3922. </p>
  3923. </dd>
  3924. <dt><span><samp>segment_list_flags <var>flags</var></samp></span></dt>
  3925. <dd><p>Set flags affecting the segment list generation.
  3926. </p>
  3927. <p>It currently supports the following flags:
  3928. </p><dl compact="compact">
  3929. <dt><span>&lsquo;<samp>cache</samp>&rsquo;</span></dt>
  3930. <dd><p>Allow caching (only affects M3U8 list files).
  3931. </p>
  3932. </dd>
  3933. <dt><span>&lsquo;<samp>live</samp>&rsquo;</span></dt>
  3934. <dd><p>Allow live-friendly file generation.
  3935. </p></dd>
  3936. </dl>
  3937. </dd>
  3938. <dt><span><samp>segment_list_size <var>size</var></samp></span></dt>
  3939. <dd><p>Update the list file so that it contains at most <var>size</var>
  3940. segments. If 0 the list file will contain all the segments. Default
  3941. value is 0.
  3942. </p>
  3943. </dd>
  3944. <dt><span><samp>segment_list_entry_prefix <var>prefix</var></samp></span></dt>
  3945. <dd><p>Prepend <var>prefix</var> to each entry. Useful to generate absolute paths.
  3946. By default no prefix is applied.
  3947. </p>
  3948. </dd>
  3949. <dt><span><samp>segment_list_type <var>type</var></samp></span></dt>
  3950. <dd><p>Select the listing format.
  3951. </p>
  3952. <p>The following values are recognized:
  3953. </p><dl compact="compact">
  3954. <dt><span>&lsquo;<samp>flat</samp>&rsquo;</span></dt>
  3955. <dd><p>Generate a flat list for the created segments, one segment per line.
  3956. </p>
  3957. </dd>
  3958. <dt><span>&lsquo;<samp>csv, ext</samp>&rsquo;</span></dt>
  3959. <dd><p>Generate a list for the created segments, one segment per line,
  3960. each line matching the format (comma-separated values):
  3961. </p><div class="example">
  3962. <pre class="example"><var>segment_filename</var>,<var>segment_start_time</var>,<var>segment_end_time</var>
  3963. </pre></div>
  3964. <p><var>segment_filename</var> is the name of the output file generated by the
  3965. muxer according to the provided pattern. CSV escaping (according to
  3966. RFC4180) is applied if required.
  3967. </p>
  3968. <p><var>segment_start_time</var> and <var>segment_end_time</var> specify
  3969. the segment start and end time expressed in seconds.
  3970. </p>
  3971. <p>A list file with the suffix <code>&quot;.csv&quot;</code> or <code>&quot;.ext&quot;</code> will
  3972. auto-select this format.
  3973. </p>
  3974. <p>&lsquo;<samp>ext</samp>&rsquo; is deprecated in favor or &lsquo;<samp>csv</samp>&rsquo;.
  3975. </p>
  3976. </dd>
  3977. <dt><span>&lsquo;<samp>ffconcat</samp>&rsquo;</span></dt>
  3978. <dd><p>Generate an ffconcat file for the created segments. The resulting file
  3979. can be read using the FFmpeg <a href="#concat">concat</a> demuxer.
  3980. </p>
  3981. <p>A list file with the suffix <code>&quot;.ffcat&quot;</code> or <code>&quot;.ffconcat&quot;</code> will
  3982. auto-select this format.
  3983. </p>
  3984. </dd>
  3985. <dt><span>&lsquo;<samp>m3u8</samp>&rsquo;</span></dt>
  3986. <dd><p>Generate an extended M3U8 file, version 3, compliant with
  3987. <a href="http://tools.ietf.org/id/draft-pantos-http-live-streaming">http://tools.ietf.org/id/draft-pantos-http-live-streaming</a>.
  3988. </p>
  3989. <p>A list file with the suffix <code>&quot;.m3u8&quot;</code> will auto-select this format.
  3990. </p></dd>
  3991. </dl>
  3992. <p>If not specified the type is guessed from the list file name suffix.
  3993. </p>
  3994. </dd>
  3995. <dt><span><samp>segment_time <var>time</var></samp></span></dt>
  3996. <dd><p>Set segment duration to <var>time</var>, the value must be a duration
  3997. specification. Default value is &quot;2&quot;. See also the
  3998. <samp>segment_times</samp> option.
  3999. </p>
  4000. <p>Note that splitting may not be accurate, unless you force the
  4001. reference stream key-frames at the given time. See the introductory
  4002. notice and the examples below.
  4003. </p>
  4004. </dd>
  4005. <dt><span><samp>min_seg_duration <var>time</var></samp></span></dt>
  4006. <dd><p>Set minimum segment duration to <var>time</var>, the value must be a duration
  4007. specification. This prevents the muxer ending segments at a duration below
  4008. this value. Only effective with <code>segment_time</code>. Default value is &quot;0&quot;.
  4009. </p>
  4010. </dd>
  4011. <dt><span><samp>segment_atclocktime <var>1|0</var></samp></span></dt>
  4012. <dd><p>If set to &quot;1&quot; split at regular clock time intervals starting from 00:00
  4013. o&rsquo;clock. The <var>time</var> value specified in <samp>segment_time</samp> is
  4014. used for setting the length of the splitting interval.
  4015. </p>
  4016. <p>For example with <samp>segment_time</samp> set to &quot;900&quot; this makes it possible
  4017. to create files at 12:00 o&rsquo;clock, 12:15, 12:30, etc.
  4018. </p>
  4019. <p>Default value is &quot;0&quot;.
  4020. </p>
  4021. </dd>
  4022. <dt><span><samp>segment_clocktime_offset <var>duration</var></samp></span></dt>
  4023. <dd><p>Delay the segment splitting times with the specified duration when using
  4024. <samp>segment_atclocktime</samp>.
  4025. </p>
  4026. <p>For example with <samp>segment_time</samp> set to &quot;900&quot; and
  4027. <samp>segment_clocktime_offset</samp> set to &quot;300&quot; this makes it possible to
  4028. create files at 12:05, 12:20, 12:35, etc.
  4029. </p>
  4030. <p>Default value is &quot;0&quot;.
  4031. </p>
  4032. </dd>
  4033. <dt><span><samp>segment_clocktime_wrap_duration <var>duration</var></samp></span></dt>
  4034. <dd><p>Force the segmenter to only start a new segment if a packet reaches the muxer
  4035. within the specified duration after the segmenting clock time. This way you
  4036. can make the segmenter more resilient to backward local time jumps, such as
  4037. leap seconds or transition to standard time from daylight savings time.
  4038. </p>
  4039. <p>Default is the maximum possible duration which means starting a new segment
  4040. regardless of the elapsed time since the last clock time.
  4041. </p>
  4042. </dd>
  4043. <dt><span><samp>segment_time_delta <var>delta</var></samp></span></dt>
  4044. <dd><p>Specify the accuracy time when selecting the start time for a
  4045. segment, expressed as a duration specification. Default value is &quot;0&quot;.
  4046. </p>
  4047. <p>When delta is specified a key-frame will start a new segment if its
  4048. PTS satisfies the relation:
  4049. </p><div class="example">
  4050. <pre class="example">PTS &gt;= start_time - time_delta
  4051. </pre></div>
  4052. <p>This option is useful when splitting video content, which is always
  4053. split at GOP boundaries, in case a key frame is found just before the
  4054. specified split time.
  4055. </p>
  4056. <p>In particular may be used in combination with the <samp>ffmpeg</samp> option
  4057. <var>force_key_frames</var>. The key frame times specified by
  4058. <var>force_key_frames</var> may not be set accurately because of rounding
  4059. issues, with the consequence that a key frame time may result set just
  4060. before the specified time. For constant frame rate videos a value of
  4061. 1/(2*<var>frame_rate</var>) should address the worst case mismatch between
  4062. the specified time and the time set by <var>force_key_frames</var>.
  4063. </p>
  4064. </dd>
  4065. <dt><span><samp>segment_times <var>times</var></samp></span></dt>
  4066. <dd><p>Specify a list of split points. <var>times</var> contains a list of comma
  4067. separated duration specifications, in increasing order. See also
  4068. the <samp>segment_time</samp> option.
  4069. </p>
  4070. </dd>
  4071. <dt><span><samp>segment_frames <var>frames</var></samp></span></dt>
  4072. <dd><p>Specify a list of split video frame numbers. <var>frames</var> contains a
  4073. list of comma separated integer numbers, in increasing order.
  4074. </p>
  4075. <p>This option specifies to start a new segment whenever a reference
  4076. stream key frame is found and the sequential number (starting from 0)
  4077. of the frame is greater or equal to the next value in the list.
  4078. </p>
  4079. </dd>
  4080. <dt><span><samp>segment_wrap <var>limit</var></samp></span></dt>
  4081. <dd><p>Wrap around segment index once it reaches <var>limit</var>.
  4082. </p>
  4083. </dd>
  4084. <dt><span><samp>segment_start_number <var>number</var></samp></span></dt>
  4085. <dd><p>Set the sequence number of the first segment. Defaults to <code>0</code>.
  4086. </p>
  4087. </dd>
  4088. <dt><span><samp>strftime <var>1|0</var></samp></span></dt>
  4089. <dd><p>Use the <code>strftime</code> function to define the name of the new
  4090. segments to write. If this is selected, the output segment name must
  4091. contain a <code>strftime</code> function template. Default value is
  4092. <code>0</code>.
  4093. </p>
  4094. </dd>
  4095. <dt><span><samp>break_non_keyframes <var>1|0</var></samp></span></dt>
  4096. <dd><p>If enabled, allow segments to start on frames other than keyframes. This
  4097. improves behavior on some players when the time between keyframes is
  4098. inconsistent, but may make things worse on others, and can cause some oddities
  4099. during seeking. Defaults to <code>0</code>.
  4100. </p>
  4101. </dd>
  4102. <dt><span><samp>reset_timestamps <var>1|0</var></samp></span></dt>
  4103. <dd><p>Reset timestamps at the beginning of each segment, so that each segment
  4104. will start with near-zero timestamps. It is meant to ease the playback
  4105. of the generated segments. May not work with some combinations of
  4106. muxers/codecs. It is set to <code>0</code> by default.
  4107. </p>
  4108. </dd>
  4109. <dt><span><samp>initial_offset <var>offset</var></samp></span></dt>
  4110. <dd><p>Specify timestamp offset to apply to the output packet timestamps. The
  4111. argument must be a time duration specification, and defaults to 0.
  4112. </p>
  4113. </dd>
  4114. <dt><span><samp>write_empty_segments <var>1|0</var></samp></span></dt>
  4115. <dd><p>If enabled, write an empty segment if there are no packets during the period a
  4116. segment would usually span. Otherwise, the segment will be filled with the next
  4117. packet written. Defaults to <code>0</code>.
  4118. </p></dd>
  4119. </dl>
  4120. <p>Make sure to require a closed GOP when encoding and to set the GOP
  4121. size to fit your segment time constraint.
  4122. </p>
  4123. <a name="Examples-10"></a>
  4124. <h4 class="subsection">4.30.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-10" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-10" aria-hidden="true">TOC</a></span></h4>
  4125. <ul>
  4126. <li> Remux the content of file <samp>in.mkv</samp> to a list of segments
  4127. <samp>out-000.nut</samp>, <samp>out-001.nut</samp>, etc., and write the list of
  4128. generated segments to <samp>out.list</samp>:
  4129. <div class="example">
  4130. <pre class="example">ffmpeg -i in.mkv -codec hevc -flags +cgop -g 60 -map 0 -f segment -segment_list out.list out%03d.nut
  4131. </pre></div>
  4132. </li><li> Segment input and set output format options for the output segments:
  4133. <div class="example">
  4134. <pre class="example">ffmpeg -i in.mkv -f segment -segment_time 10 -segment_format_options movflags=+faststart out%03d.mp4
  4135. </pre></div>
  4136. </li><li> Segment the input file according to the split points specified by the
  4137. <var>segment_times</var> option:
  4138. <div class="example">
  4139. <pre class="example">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
  4140. </pre></div>
  4141. </li><li> Use the <code>ffmpeg</code> <samp>force_key_frames</samp>
  4142. option to force key frames in the input at the specified location, together
  4143. with the segment option <samp>segment_time_delta</samp> to account for
  4144. possible roundings operated when setting key frame times.
  4145. <div class="example">
  4146. <pre class="example">ffmpeg -i in.mkv -force_key_frames 1,2,3,5,8,13,21 -codec:v mpeg4 -codec:a pcm_s16le -map 0 \
  4147. -f segment -segment_list out.csv -segment_times 1,2,3,5,8,13,21 -segment_time_delta 0.05 out%03d.nut
  4148. </pre></div>
  4149. <p>In order to force key frames on the input file, transcoding is
  4150. required.
  4151. </p>
  4152. </li><li> Segment the input file by splitting the input file according to the
  4153. frame numbers sequence specified with the <samp>segment_frames</samp> option:
  4154. <div class="example">
  4155. <pre class="example">ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.csv -segment_frames 100,200,300,500,800 out%03d.nut
  4156. </pre></div>
  4157. </li><li> Convert the <samp>in.mkv</samp> to TS segments using the <code>libx264</code>
  4158. and <code>aac</code> encoders:
  4159. <div class="example">
  4160. <pre class="example">ffmpeg -i in.mkv -map 0 -codec:v libx264 -codec:a aac -f ssegment -segment_list out.list out%03d.ts
  4161. </pre></div>
  4162. </li><li> Segment the input file, and create an M3U8 live playlist (can be used
  4163. as live HLS source):
  4164. <div class="example">
  4165. <pre class="example">ffmpeg -re -i in.mkv -codec copy -map 0 -f segment -segment_list playlist.m3u8 \
  4166. -segment_list_flags +live -segment_time 10 out%03d.mkv
  4167. </pre></div>
  4168. </li></ul>
  4169. <a name="smoothstreaming"></a>
  4170. <h3 class="section">4.31 smoothstreaming<span class="pull-right"><a class="anchor hidden-xs" href="#smoothstreaming" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-smoothstreaming" aria-hidden="true">TOC</a></span></h3>
  4171. <p>Smooth Streaming muxer generates a set of files (Manifest, chunks) suitable for serving with conventional web server.
  4172. </p>
  4173. <dl compact="compact">
  4174. <dt><span><samp>window_size</samp></span></dt>
  4175. <dd><p>Specify the number of fragments kept in the manifest. Default 0 (keep all).
  4176. </p>
  4177. </dd>
  4178. <dt><span><samp>extra_window_size</samp></span></dt>
  4179. <dd><p>Specify the number of fragments kept outside of the manifest before removing from disk. Default 5.
  4180. </p>
  4181. </dd>
  4182. <dt><span><samp>lookahead_count</samp></span></dt>
  4183. <dd><p>Specify the number of lookahead fragments. Default 2.
  4184. </p>
  4185. </dd>
  4186. <dt><span><samp>min_frag_duration</samp></span></dt>
  4187. <dd><p>Specify the minimum fragment duration (in microseconds). Default 5000000.
  4188. </p>
  4189. </dd>
  4190. <dt><span><samp>remove_at_exit</samp></span></dt>
  4191. <dd><p>Specify whether to remove all fragments when finished. Default 0 (do not remove).
  4192. </p>
  4193. </dd>
  4194. </dl>
  4195. <span id="streamhash"></span><a name="streamhash-1"></a>
  4196. <h3 class="section">4.32 streamhash<span class="pull-right"><a class="anchor hidden-xs" href="#streamhash-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-streamhash-1" aria-hidden="true">TOC</a></span></h3>
  4197. <p>Per stream hash testing format.
  4198. </p>
  4199. <p>This muxer computes and prints a cryptographic hash of all the input frames,
  4200. on a per-stream basis. This can be used for equality checks without having
  4201. to do a complete binary comparison.
  4202. </p>
  4203. <p>By default audio frames are converted to signed 16-bit raw audio and
  4204. video frames to raw video before computing the hash, but the output
  4205. of explicit conversions to other codecs can also be used. Timestamps
  4206. are ignored. It uses the SHA-256 cryptographic hash function by default,
  4207. but supports several other algorithms.
  4208. </p>
  4209. <p>The output of the muxer consists of one line per stream of the form:
  4210. <var>streamindex</var>,<var>streamtype</var>,<var>algo</var>=<var>hash</var>, where
  4211. <var>streamindex</var> is the index of the mapped stream, <var>streamtype</var> is a
  4212. single character indicating the type of stream, <var>algo</var> is a short string
  4213. representing the hash function used, and <var>hash</var> is a hexadecimal number
  4214. representing the computed hash.
  4215. </p>
  4216. <dl compact="compact">
  4217. <dt><span><samp>hash <var>algorithm</var></samp></span></dt>
  4218. <dd><p>Use the cryptographic hash function specified by the string <var>algorithm</var>.
  4219. Supported values include <code>MD5</code>, <code>murmur3</code>, <code>RIPEMD128</code>,
  4220. <code>RIPEMD160</code>, <code>RIPEMD256</code>, <code>RIPEMD320</code>, <code>SHA160</code>,
  4221. <code>SHA224</code>, <code>SHA256</code> (default), <code>SHA512/224</code>, <code>SHA512/256</code>,
  4222. <code>SHA384</code>, <code>SHA512</code>, <code>CRC32</code> and <code>adler32</code>.
  4223. </p>
  4224. </dd>
  4225. </dl>
  4226. <a name="Examples-11"></a>
  4227. <h4 class="subsection">4.32.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-11" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-11" aria-hidden="true">TOC</a></span></h4>
  4228. <p>To compute the SHA-256 hash of the input converted to raw audio and
  4229. video, and store it in the file <samp>out.sha256</samp>:
  4230. </p><div class="example">
  4231. <pre class="example">ffmpeg -i INPUT -f streamhash out.sha256
  4232. </pre></div>
  4233. <p>To print an MD5 hash to stdout use the command:
  4234. </p><div class="example">
  4235. <pre class="example">ffmpeg -i INPUT -f streamhash -hash md5 -
  4236. </pre></div>
  4237. <p>See also the <a href="#hash">hash</a> and <a href="#framehash">framehash</a> muxers.
  4238. </p>
  4239. <span id="tee"></span><a name="tee-1"></a>
  4240. <h3 class="section">4.33 tee<span class="pull-right"><a class="anchor hidden-xs" href="#tee-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tee-1" aria-hidden="true">TOC</a></span></h3>
  4241. <p>The tee muxer can be used to write the same data to several outputs, such as files or streams.
  4242. It can be used, for example, to stream a video over a network and save it to disk at the same time.
  4243. </p>
  4244. <p>It is different from specifying several outputs to the <code>ffmpeg</code>
  4245. command-line tool. With the tee muxer, the audio and video data will be encoded only once.
  4246. With conventional multiple outputs, multiple encoding operations in parallel are initiated,
  4247. which can be a very expensive process. The tee muxer is not useful when using the libavformat API
  4248. directly because it is then possible to feed the same packets to several muxers directly.
  4249. </p>
  4250. <p>Since the tee muxer does not represent any particular output format, ffmpeg cannot auto-select
  4251. output streams. So all streams intended for output must be specified using <code>-map</code>. See
  4252. the examples below.
  4253. </p>
  4254. <p>Some encoders may need different options depending on the output format;
  4255. the auto-detection of this can not work with the tee muxer, so they need to be explicitly specified.
  4256. The main example is the <samp>global_header</samp> flag.
  4257. </p>
  4258. <p>The slave outputs are specified in the file name given to the muxer,
  4259. separated by &rsquo;|&rsquo;. If any of the slave name contains the &rsquo;|&rsquo; separator,
  4260. leading or trailing spaces or any special character, those must be
  4261. escaped (see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#quoting_005fand_005fescaping">(ffmpeg-utils)the &quot;Quoting and escaping&quot;
  4262. section in the ffmpeg-utils(1) manual</a>).
  4263. </p>
  4264. <a name="Options-17"></a>
  4265. <h4 class="subsection">4.33.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-17" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-17" aria-hidden="true">TOC</a></span></h4>
  4266. <dl compact="compact">
  4267. <dt><span><samp>use_fifo <var>bool</var></samp></span></dt>
  4268. <dd><p>If set to 1, slave outputs will be processed in separate threads using the <a href="#fifo">fifo</a>
  4269. muxer. This allows to compensate for different speed/latency/reliability of
  4270. outputs and setup transparent recovery. By default this feature is turned off.
  4271. </p>
  4272. </dd>
  4273. <dt><span><samp>fifo_options</samp></span></dt>
  4274. <dd><p>Options to pass to fifo pseudo-muxer instances. See <a href="#fifo">fifo</a>.
  4275. </p>
  4276. </dd>
  4277. </dl>
  4278. <p>Muxer options can be specified for each slave by prepending them as a list of
  4279. <var>key</var>=<var>value</var> pairs separated by &rsquo;:&rsquo;, between square brackets. If
  4280. the options values contain a special character or the &rsquo;:&rsquo; separator, they
  4281. must be escaped; note that this is a second level escaping.
  4282. </p>
  4283. <p>The following special options are also recognized:
  4284. </p><dl compact="compact">
  4285. <dt><span><samp>f</samp></span></dt>
  4286. <dd><p>Specify the format name. Required if it cannot be guessed from the
  4287. output URL.
  4288. </p>
  4289. </dd>
  4290. <dt><span><samp>bsfs[/<var>spec</var>]</samp></span></dt>
  4291. <dd><p>Specify a list of bitstream filters to apply to the specified
  4292. output.
  4293. </p>
  4294. <p>It is possible to specify to which streams a given bitstream filter
  4295. applies, by appending a stream specifier to the option separated by
  4296. <code>/</code>. <var>spec</var> must be a stream specifier (see <a href="#Format-stream-specifiers">Format stream specifiers</a>).
  4297. </p>
  4298. <p>If the stream specifier is not specified, the bitstream filters will be
  4299. applied to all streams in the output. This will cause that output operation
  4300. to fail if the output contains streams to which the bitstream filter cannot
  4301. be applied e.g. <code>h264_mp4toannexb</code> being applied to an output containing an audio stream.
  4302. </p>
  4303. <p>Options for a bitstream filter must be specified in the form of <code>opt=value</code>.
  4304. </p>
  4305. <p>Several bitstream filters can be specified, separated by &quot;,&quot;.
  4306. </p>
  4307. </dd>
  4308. <dt><span><samp>use_fifo <var>bool</var></samp></span></dt>
  4309. <dd><p>This allows to override tee muxer use_fifo option for individual slave muxer.
  4310. </p>
  4311. </dd>
  4312. <dt><span><samp>fifo_options</samp></span></dt>
  4313. <dd><p>This allows to override tee muxer fifo_options for individual slave muxer.
  4314. See <a href="#fifo">fifo</a>.
  4315. </p>
  4316. </dd>
  4317. <dt><span><samp>select</samp></span></dt>
  4318. <dd><p>Select the streams that should be mapped to the slave output,
  4319. specified by a stream specifier. If not specified, this defaults to
  4320. all the mapped streams. This will cause that output operation to fail
  4321. if the output format does not accept all mapped streams.
  4322. </p>
  4323. <p>You may use multiple stream specifiers separated by commas (<code>,</code>) e.g.: <code>a:0,v</code>
  4324. </p>
  4325. </dd>
  4326. <dt><span><samp>onfail</samp></span></dt>
  4327. <dd><p>Specify behaviour on output failure. This can be set to either <code>abort</code> (which is
  4328. default) or <code>ignore</code>. <code>abort</code> will cause whole process to fail in case of failure
  4329. on this slave output. <code>ignore</code> will ignore failure on this output, so other outputs
  4330. will continue without being affected.
  4331. </p></dd>
  4332. </dl>
  4333. <a name="Examples-12"></a>
  4334. <h4 class="subsection">4.33.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-12" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-12" aria-hidden="true">TOC</a></span></h4>
  4335. <ul>
  4336. <li> Encode something and both archive it in a WebM file and stream it
  4337. as MPEG-TS over UDP:
  4338. <div class="example">
  4339. <pre class="example">ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
  4340. &quot;archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/&quot;
  4341. </pre></div>
  4342. </li><li> As above, but continue streaming even if output to local file fails
  4343. (for example local drive fills up):
  4344. <div class="example">
  4345. <pre class="example">ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
  4346. &quot;[onfail=ignore]archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/&quot;
  4347. </pre></div>
  4348. </li><li> Use <code>ffmpeg</code> to encode the input, and send the output
  4349. to three different destinations. The <code>dump_extra</code> bitstream
  4350. filter is used to add extradata information to all the output video
  4351. keyframes packets, as requested by the MPEG-TS format. The select
  4352. option is applied to <samp>out.aac</samp> in order to make it contain only
  4353. audio packets.
  4354. <div class="example">
  4355. <pre class="example">ffmpeg -i ... -map 0 -flags +global_header -c:v libx264 -c:a aac
  4356. -f tee &quot;[bsfs/v=dump_extra=freq=keyframe]out.ts|[movflags=+faststart]out.mp4|[select=a]out.aac&quot;
  4357. </pre></div>
  4358. </li><li> As above, but select only stream <code>a:1</code> for the audio output. Note
  4359. that a second level escaping must be performed, as &quot;:&quot; is a special
  4360. character used to separate options.
  4361. <div class="example">
  4362. <pre class="example">ffmpeg -i ... -map 0 -flags +global_header -c:v libx264 -c:a aac
  4363. -f tee &quot;[bsfs/v=dump_extra=freq=keyframe]out.ts|[movflags=+faststart]out.mp4|[select=\'a:1\']out.aac&quot;
  4364. </pre></div>
  4365. </li></ul>
  4366. <a name="webm_005fchunk"></a>
  4367. <h3 class="section">4.34 webm_chunk<span class="pull-right"><a class="anchor hidden-xs" href="#webm_005fchunk" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-webm_005fchunk" aria-hidden="true">TOC</a></span></h3>
  4368. <p>WebM Live Chunk Muxer.
  4369. </p>
  4370. <p>This muxer writes out WebM headers and chunks as separate files which can be
  4371. consumed by clients that support WebM Live streams via DASH.
  4372. </p>
  4373. <a name="Options-18"></a>
  4374. <h4 class="subsection">4.34.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-18" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-18" aria-hidden="true">TOC</a></span></h4>
  4375. <p>This muxer supports the following options:
  4376. </p>
  4377. <dl compact="compact">
  4378. <dt><span><samp>chunk_start_index</samp></span></dt>
  4379. <dd><p>Index of the first chunk (defaults to 0).
  4380. </p>
  4381. </dd>
  4382. <dt><span><samp>header</samp></span></dt>
  4383. <dd><p>Filename of the header where the initialization data will be written.
  4384. </p>
  4385. </dd>
  4386. <dt><span><samp>audio_chunk_duration</samp></span></dt>
  4387. <dd><p>Duration of each audio chunk in milliseconds (defaults to 5000).
  4388. </p></dd>
  4389. </dl>
  4390. <a name="Example-2"></a>
  4391. <h4 class="subsection">4.34.2 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-2" aria-hidden="true">TOC</a></span></h4>
  4392. <div class="example">
  4393. <pre class="example">ffmpeg -f v4l2 -i /dev/video0 \
  4394. -f alsa -i hw:0 \
  4395. -map 0:0 \
  4396. -c:v libvpx-vp9 \
  4397. -s 640x360 -keyint_min 30 -g 30 \
  4398. -f webm_chunk \
  4399. -header webm_live_video_360.hdr \
  4400. -chunk_start_index 1 \
  4401. webm_live_video_360_%d.chk \
  4402. -map 1:0 \
  4403. -c:a libvorbis \
  4404. -b:a 128k \
  4405. -f webm_chunk \
  4406. -header webm_live_audio_128.hdr \
  4407. -chunk_start_index 1 \
  4408. -audio_chunk_duration 1000 \
  4409. webm_live_audio_128_%d.chk
  4410. </pre></div>
  4411. <a name="webm_005fdash_005fmanifest"></a>
  4412. <h3 class="section">4.35 webm_dash_manifest<span class="pull-right"><a class="anchor hidden-xs" href="#webm_005fdash_005fmanifest" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-webm_005fdash_005fmanifest" aria-hidden="true">TOC</a></span></h3>
  4413. <p>WebM DASH Manifest muxer.
  4414. </p>
  4415. <p>This muxer implements the WebM DASH Manifest specification to generate the DASH
  4416. manifest XML. It also supports manifest generation for DASH live streams.
  4417. </p>
  4418. <p>For more information see:
  4419. </p>
  4420. <ul>
  4421. <li> WebM DASH Specification: <a href="https://sites.google.com/a/webmproject.org/wiki/adaptive-streaming/webm-dash-specification">https://sites.google.com/a/webmproject.org/wiki/adaptive-streaming/webm-dash-specification</a>
  4422. </li><li> ISO DASH Specification: <a href="http://standards.iso.org/ittf/PubliclyAvailableStandards/c065274_ISO_IEC_23009-1_2014.zip">http://standards.iso.org/ittf/PubliclyAvailableStandards/c065274_ISO_IEC_23009-1_2014.zip</a>
  4423. </li></ul>
  4424. <a name="Options-19"></a>
  4425. <h4 class="subsection">4.35.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-19" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-19" aria-hidden="true">TOC</a></span></h4>
  4426. <p>This muxer supports the following options:
  4427. </p>
  4428. <dl compact="compact">
  4429. <dt><span><samp>adaptation_sets</samp></span></dt>
  4430. <dd><p>This option has the following syntax: &quot;id=x,streams=a,b,c id=y,streams=d,e&quot; where x and y are the
  4431. unique identifiers of the adaptation sets and a,b,c,d and e are the indices of the corresponding
  4432. audio and video streams. Any number of adaptation sets can be added using this option.
  4433. </p>
  4434. </dd>
  4435. <dt><span><samp>live</samp></span></dt>
  4436. <dd><p>Set this to 1 to create a live stream DASH Manifest. Default: 0.
  4437. </p>
  4438. </dd>
  4439. <dt><span><samp>chunk_start_index</samp></span></dt>
  4440. <dd><p>Start index of the first chunk. This will go in the &lsquo;<samp>startNumber</samp>&rsquo; attribute
  4441. of the &lsquo;<samp>SegmentTemplate</samp>&rsquo; element in the manifest. Default: 0.
  4442. </p>
  4443. </dd>
  4444. <dt><span><samp>chunk_duration_ms</samp></span></dt>
  4445. <dd><p>Duration of each chunk in milliseconds. This will go in the &lsquo;<samp>duration</samp>&rsquo;
  4446. attribute of the &lsquo;<samp>SegmentTemplate</samp>&rsquo; element in the manifest. Default: 1000.
  4447. </p>
  4448. </dd>
  4449. <dt><span><samp>utc_timing_url</samp></span></dt>
  4450. <dd><p>URL of the page that will return the UTC timestamp in ISO format. This will go
  4451. in the &lsquo;<samp>value</samp>&rsquo; attribute of the &lsquo;<samp>UTCTiming</samp>&rsquo; element in the manifest.
  4452. Default: None.
  4453. </p>
  4454. </dd>
  4455. <dt><span><samp>time_shift_buffer_depth</samp></span></dt>
  4456. <dd><p>Smallest time (in seconds) shifting buffer for which any Representation is
  4457. guaranteed to be available. This will go in the &lsquo;<samp>timeShiftBufferDepth</samp>&rsquo;
  4458. attribute of the &lsquo;<samp>MPD</samp>&rsquo; element. Default: 60.
  4459. </p>
  4460. </dd>
  4461. <dt><span><samp>minimum_update_period</samp></span></dt>
  4462. <dd><p>Minimum update period (in seconds) of the manifest. This will go in the
  4463. &lsquo;<samp>minimumUpdatePeriod</samp>&rsquo; attribute of the &lsquo;<samp>MPD</samp>&rsquo; element. Default: 0.
  4464. </p>
  4465. </dd>
  4466. </dl>
  4467. <a name="Example-3"></a>
  4468. <h4 class="subsection">4.35.2 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-3" aria-hidden="true">TOC</a></span></h4>
  4469. <div class="example">
  4470. <pre class="example">ffmpeg -f webm_dash_manifest -i video1.webm \
  4471. -f webm_dash_manifest -i video2.webm \
  4472. -f webm_dash_manifest -i audio1.webm \
  4473. -f webm_dash_manifest -i audio2.webm \
  4474. -map 0 -map 1 -map 2 -map 3 \
  4475. -c copy \
  4476. -f webm_dash_manifest \
  4477. -adaptation_sets &quot;id=0,streams=0,1 id=1,streams=2,3&quot; \
  4478. manifest.xml
  4479. </pre></div>
  4480. <a name="Metadata-1"></a>
  4481. <h2 class="chapter">5 Metadata<span class="pull-right"><a class="anchor hidden-xs" href="#Metadata-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Metadata-1" aria-hidden="true">TOC</a></span></h2>
  4482. <p>FFmpeg is able to dump metadata from media files into a simple UTF-8-encoded
  4483. INI-like text file and then load it back using the metadata muxer/demuxer.
  4484. </p>
  4485. <p>The file format is as follows:
  4486. </p><ol>
  4487. <li> A file consists of a header and a number of metadata tags divided into sections,
  4488. each on its own line.
  4489. </li><li> The header is a &lsquo;<samp>;FFMETADATA</samp>&rsquo; string, followed by a version number (now 1).
  4490. </li><li> Metadata tags are of the form &lsquo;<samp>key=value</samp>&rsquo;
  4491. </li><li> Immediately after header follows global metadata
  4492. </li><li> After global metadata there may be sections with per-stream/per-chapter
  4493. metadata.
  4494. </li><li> A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in
  4495. brackets (&lsquo;<samp>[</samp>&rsquo;, &lsquo;<samp>]</samp>&rsquo;) and ends with next section or end of file.
  4496. </li><li> At the beginning of a chapter section there may be an optional timebase to be
  4497. used for start/end values. It must be in form
  4498. &lsquo;<samp>TIMEBASE=<var>num</var>/<var>den</var></samp>&rsquo;, where <var>num</var> and <var>den</var> are
  4499. integers. If the timebase is missing then start/end times are assumed to
  4500. be in nanoseconds.
  4501. <p>Next a chapter section must contain chapter start and end times in form
  4502. &lsquo;<samp>START=<var>num</var></samp>&rsquo;, &lsquo;<samp>END=<var>num</var></samp>&rsquo;, where <var>num</var> is a positive
  4503. integer.
  4504. </p>
  4505. </li><li> Empty lines and lines starting with &lsquo;<samp>;</samp>&rsquo; or &lsquo;<samp>#</samp>&rsquo; are ignored.
  4506. </li><li> Metadata keys or values containing special characters (&lsquo;<samp>=</samp>&rsquo;, &lsquo;<samp>;</samp>&rsquo;,
  4507. &lsquo;<samp>#</samp>&rsquo;, &lsquo;<samp>\</samp>&rsquo; and a newline) must be escaped with a backslash &lsquo;<samp>\</samp>&rsquo;.
  4508. </li><li> Note that whitespace in metadata (e.g. &lsquo;<samp>foo = bar</samp>&rsquo;) is considered to be
  4509. a part of the tag (in the example above key is &lsquo;<samp>foo </samp>&rsquo;, value is
  4510. &lsquo;<samp> bar</samp>&rsquo;).
  4511. </li></ol>
  4512. <p>A ffmetadata file might look like this:
  4513. </p><div class="example">
  4514. <pre class="example">;FFMETADATA1
  4515. title=bike\\shed
  4516. ;this is a comment
  4517. artist=FFmpeg troll team
  4518. [CHAPTER]
  4519. TIMEBASE=1/1000
  4520. START=0
  4521. #chapter ends at 0:01:00
  4522. END=60000
  4523. title=chapter \#1
  4524. [STREAM]
  4525. title=multi\
  4526. line
  4527. </pre></div>
  4528. <p>By using the ffmetadata muxer and demuxer it is possible to extract
  4529. metadata from an input file to an ffmetadata file, and then transcode
  4530. the file into an output file with the edited ffmetadata file.
  4531. </p>
  4532. <p>Extracting an ffmetadata file with <samp>ffmpeg</samp> goes as follows:
  4533. </p><div class="example">
  4534. <pre class="example">ffmpeg -i INPUT -f ffmetadata FFMETADATAFILE
  4535. </pre></div>
  4536. <p>Reinserting edited metadata information from the FFMETADATAFILE file can
  4537. be done as:
  4538. </p><div class="example">
  4539. <pre class="example">ffmpeg -i INPUT -i FFMETADATAFILE -map_metadata 1 -codec copy OUTPUT
  4540. </pre></div>
  4541. <a name="See-Also"></a>
  4542. <h2 class="chapter">6 See Also<span class="pull-right"><a class="anchor hidden-xs" href="#See-Also" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-See-Also" aria-hidden="true">TOC</a></span></h2>
  4543. <p><a href="ffmpeg.html">ffmpeg</a>, <a href="ffplay.html">ffplay</a>, <a href="ffprobe.html">ffprobe</a>,
  4544. <a href="libavformat.html">libavformat</a>
  4545. </p>
  4546. <a name="Authors"></a>
  4547. <h2 class="chapter">7 Authors<span class="pull-right"><a class="anchor hidden-xs" href="#Authors" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Authors" aria-hidden="true">TOC</a></span></h2>
  4548. <p>The FFmpeg developers.
  4549. </p>
  4550. <p>For details about the authorship, see the Git history of the project
  4551. (https://git.ffmpeg.org/ffmpeg), e.g. by typing the command
  4552. <code>git log</code> in the FFmpeg source directory, or browsing the
  4553. online repository at <a href="https://git.ffmpeg.org/ffmpeg">https://git.ffmpeg.org/ffmpeg</a>.
  4554. </p>
  4555. <p>Maintainers for the specific components are listed in the file
  4556. <samp>MAINTAINERS</samp> in the source code tree.
  4557. </p>
  4558. <p style="font-size: small;">
  4559. This document was generated using <a href="https://www.gnu.org/software/texinfo/"><em>makeinfo</em></a>.
  4560. </p>
  4561. </div>
  4562. </body>
  4563. </html>