ffmpeg-bitstream-filters.html 60 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363
  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 7.1.1 -->
  4. <head>
  5. <meta charset="utf-8">
  6. <title>
  7. FFmpeg Bitstream Filters 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 Bitstream Filters Documentation
  17. </h1>
  18. <a name="SEC_Top"></a>
  19. <div class="element-contents" id="SEC_Contents">
  20. <h2 class="contents-heading">Table of Contents</h2>
  21. <div class="contents">
  22. <ul class="toc-numbered-mark">
  23. <li><a id="toc-Description" href="#Description">1 Description</a></li>
  24. <li><a id="toc-Bitstream-Filters" href="#Bitstream-Filters">2 Bitstream Filters</a>
  25. <ul class="toc-numbered-mark">
  26. <li><a id="toc-aac_005fadtstoasc" href="#aac_005fadtstoasc">2.1 aac_adtstoasc</a></li>
  27. <li><a id="toc-av1_005fmetadata" href="#av1_005fmetadata">2.2 av1_metadata</a></li>
  28. <li><a id="toc-chomp" href="#chomp">2.3 chomp</a></li>
  29. <li><a id="toc-dca_005fcore" href="#dca_005fcore">2.4 dca_core</a></li>
  30. <li><a id="toc-dovi_005frpu" href="#dovi_005frpu">2.5 dovi_rpu</a></li>
  31. <li><a id="toc-dump_005fextra" href="#dump_005fextra">2.6 dump_extra</a></li>
  32. <li><a id="toc-dv_005ferror_005fmarker" href="#dv_005ferror_005fmarker">2.7 dv_error_marker</a></li>
  33. <li><a id="toc-eac3_005fcore" href="#eac3_005fcore">2.8 eac3_core</a></li>
  34. <li><a id="toc-eia608_005fto_005fsmpte436m" href="#eia608_005fto_005fsmpte436m">2.9 eia608_to_smpte436m</a></li>
  35. <li><a id="toc-extract_005fextradata" href="#extract_005fextradata">2.10 extract_extradata</a></li>
  36. <li><a id="toc-filter_005funits" href="#filter_005funits">2.11 filter_units</a></li>
  37. <li><a id="toc-hapqa_005fextract" href="#hapqa_005fextract">2.12 hapqa_extract</a></li>
  38. <li><a id="toc-h264_005fmetadata" href="#h264_005fmetadata">2.13 h264_metadata</a></li>
  39. <li><a id="toc-h264_005fmp4toannexb" href="#h264_005fmp4toannexb">2.14 h264_mp4toannexb</a></li>
  40. <li><a id="toc-h264_005fredundant_005fpps" href="#h264_005fredundant_005fpps">2.15 h264_redundant_pps</a></li>
  41. <li><a id="toc-hevc_005fmetadata" href="#hevc_005fmetadata">2.16 hevc_metadata</a></li>
  42. <li><a id="toc-hevc_005fmp4toannexb" href="#hevc_005fmp4toannexb">2.17 hevc_mp4toannexb</a></li>
  43. <li><a id="toc-imxdump" href="#imxdump">2.18 imxdump</a></li>
  44. <li><a id="toc-mjpeg2jpeg" href="#mjpeg2jpeg">2.19 mjpeg2jpeg</a></li>
  45. <li><a id="toc-mjpegadump" href="#mjpegadump">2.20 mjpegadump</a></li>
  46. <li><a id="toc-mov2textsub-1" href="#mov2textsub-1">2.21 mov2textsub</a></li>
  47. <li><a id="toc-mpeg2_005fmetadata" href="#mpeg2_005fmetadata">2.22 mpeg2_metadata</a></li>
  48. <li><a id="toc-mpeg4_005funpack_005fbframes" href="#mpeg4_005funpack_005fbframes">2.23 mpeg4_unpack_bframes</a></li>
  49. <li><a id="toc-noise" href="#noise">2.24 noise</a>
  50. <ul class="toc-numbered-mark">
  51. <li><a id="toc-Examples" href="#Examples">2.24.1 Examples</a></li>
  52. </ul></li>
  53. <li><a id="toc-null" href="#null">2.25 null</a></li>
  54. <li><a id="toc-pcm_005frechunk" href="#pcm_005frechunk">2.26 pcm_rechunk</a></li>
  55. <li><a id="toc-pgs_005fframe_005fmerge" href="#pgs_005fframe_005fmerge">2.27 pgs_frame_merge</a></li>
  56. <li><a id="toc-prores_005fmetadata" href="#prores_005fmetadata">2.28 prores_metadata</a></li>
  57. <li><a id="toc-remove_005fextra" href="#remove_005fextra">2.29 remove_extra</a></li>
  58. <li><a id="toc-setts" href="#setts">2.30 setts</a></li>
  59. <li><a id="toc-showinfo" href="#showinfo">2.31 showinfo</a></li>
  60. <li><a id="toc-smpte436m_005fto_005feia608" href="#smpte436m_005fto_005feia608">2.32 smpte436m_to_eia608</a></li>
  61. <li><a id="toc-text2movsub-1" href="#text2movsub-1">2.33 text2movsub</a></li>
  62. <li><a id="toc-trace_005fheaders" href="#trace_005fheaders">2.34 trace_headers</a></li>
  63. <li><a id="toc-truehd_005fcore" href="#truehd_005fcore">2.35 truehd_core</a></li>
  64. <li><a id="toc-vp9_005fmetadata" href="#vp9_005fmetadata">2.36 vp9_metadata</a></li>
  65. <li><a id="toc-vp9_005fsuperframe" href="#vp9_005fsuperframe">2.37 vp9_superframe</a></li>
  66. <li><a id="toc-vp9_005fsuperframe_005fsplit" href="#vp9_005fsuperframe_005fsplit">2.38 vp9_superframe_split</a></li>
  67. <li><a id="toc-vp9_005fraw_005freorder" href="#vp9_005fraw_005freorder">2.39 vp9_raw_reorder</a></li>
  68. </ul></li>
  69. <li><a id="toc-See-Also" href="#See-Also">3 See Also</a></li>
  70. <li><a id="toc-Authors" href="#Authors">4 Authors</a></li>
  71. </ul>
  72. </div>
  73. </div>
  74. <a name="Description"></a>
  75. <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>
  76. <p>This document describes the bitstream filters provided by the
  77. libavcodec library.
  78. </p>
  79. <p>A bitstream filter operates on the encoded stream data, and performs
  80. bitstream level modifications without performing decoding.
  81. </p>
  82. <a name="Bitstream-Filters"></a>
  83. <h2 class="chapter">2 Bitstream Filters<span class="pull-right"><a class="anchor hidden-xs" href="#Bitstream-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Bitstream-Filters" aria-hidden="true">TOC</a></span></h2>
  84. <p>When you configure your FFmpeg build, all the supported bitstream
  85. filters are enabled by default. You can list all available ones using
  86. the configure option <code class="code">--list-bsfs</code>.
  87. </p>
  88. <p>You can disable all the bitstream filters using the configure option
  89. <code class="code">--disable-bsfs</code>, and selectively enable any bitstream filter using
  90. the option <code class="code">--enable-bsf=BSF</code>, or you can disable a particular
  91. bitstream filter using the option <code class="code">--disable-bsf=BSF</code>.
  92. </p>
  93. <p>The option <code class="code">-bsfs</code> of the ff* tools will display the list of
  94. all the supported bitstream filters included in your build.
  95. </p>
  96. <p>The ff* tools have a -bsf option applied per stream, taking a
  97. comma-separated list of filters, whose parameters follow the filter
  98. name after a &rsquo;=&rsquo;.
  99. </p>
  100. <div class="example">
  101. <pre class="example-preformatted">ffmpeg -i INPUT -c:v copy -bsf:v filter1[=opt1=str1:opt2=str2][,filter2] OUTPUT
  102. </pre></div>
  103. <p>Below is a description of the currently available bitstream filters,
  104. with their parameters, if any.
  105. </p>
  106. <a name="aac_005fadtstoasc"></a>
  107. <h3 class="section">2.1 aac_adtstoasc<span class="pull-right"><a class="anchor hidden-xs" href="#aac_005fadtstoasc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aac_005fadtstoasc" aria-hidden="true">TOC</a></span></h3>
  108. <p>Convert MPEG-2/4 AAC ADTS to an MPEG-4 Audio Specific Configuration
  109. bitstream.
  110. </p>
  111. <p>This filter creates an MPEG-4 AudioSpecificConfig from an MPEG-2/4
  112. ADTS header and removes the ADTS header.
  113. </p>
  114. <p>This filter is required for example when copying an AAC stream from a
  115. raw ADTS AAC or an MPEG-TS container to MP4A-LATM, to an FLV file, or
  116. to MOV/MP4 files and related formats such as 3GP or M4A. Please note
  117. that it is auto-inserted for MP4A-LATM and MOV/MP4 and related formats.
  118. </p>
  119. <a name="av1_005fmetadata"></a>
  120. <h3 class="section">2.2 av1_metadata<span class="pull-right"><a class="anchor hidden-xs" href="#av1_005fmetadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-av1_005fmetadata" aria-hidden="true">TOC</a></span></h3>
  121. <p>Modify metadata embedded in an AV1 stream.
  122. </p>
  123. <dl class="table">
  124. <dt><samp class="option">td</samp></dt>
  125. <dd><p>Insert or remove temporal delimiter OBUs in all temporal units of the
  126. stream.
  127. </p>
  128. <dl class="table">
  129. <dt>&lsquo;<samp class="samp">insert</samp>&rsquo;</dt>
  130. <dd><p>Insert a TD at the beginning of every TU which does not already have one.
  131. </p></dd>
  132. <dt>&lsquo;<samp class="samp">remove</samp>&rsquo;</dt>
  133. <dd><p>Remove the TD from the beginning of every TU which has one.
  134. </p></dd>
  135. </dl>
  136. </dd>
  137. <dt><samp class="option">color_primaries</samp></dt>
  138. <dt><samp class="option">transfer_characteristics</samp></dt>
  139. <dt><samp class="option">matrix_coefficients</samp></dt>
  140. <dd><p>Set the color description fields in the stream (see AV1 section 6.4.2).
  141. </p>
  142. </dd>
  143. <dt><samp class="option">color_range</samp></dt>
  144. <dd><p>Set the color range in the stream (see AV1 section 6.4.2; note that
  145. this cannot be set for streams using BT.709 primaries, sRGB transfer
  146. characteristic and identity (RGB) matrix coefficients).
  147. </p><dl class="table">
  148. <dt>&lsquo;<samp class="samp">tv</samp>&rsquo;</dt>
  149. <dd><p>Limited range.
  150. </p></dd>
  151. <dt>&lsquo;<samp class="samp">pc</samp>&rsquo;</dt>
  152. <dd><p>Full range.
  153. </p></dd>
  154. </dl>
  155. </dd>
  156. <dt><samp class="option">chroma_sample_position</samp></dt>
  157. <dd><p>Set the chroma sample location in the stream (see AV1 section 6.4.2).
  158. This can only be set for 4:2:0 streams.
  159. </p>
  160. <dl class="table">
  161. <dt>&lsquo;<samp class="samp">vertical</samp>&rsquo;</dt>
  162. <dd><p>Left position (matching the default in MPEG-2 and H.264).
  163. </p></dd>
  164. <dt>&lsquo;<samp class="samp">colocated</samp>&rsquo;</dt>
  165. <dd><p>Top-left position.
  166. </p></dd>
  167. </dl>
  168. </dd>
  169. <dt><samp class="option">tick_rate</samp></dt>
  170. <dd><p>Set the tick rate (<em class="emph">time_scale / num_units_in_display_tick</em>) in
  171. the timing info in the sequence header.
  172. </p></dd>
  173. <dt><samp class="option">num_ticks_per_picture</samp></dt>
  174. <dd><p>Set the number of ticks in each picture, to indicate that the stream
  175. has a fixed framerate. Ignored if <samp class="option">tick_rate</samp> is not also set.
  176. </p>
  177. </dd>
  178. <dt><samp class="option">delete_padding</samp></dt>
  179. <dd><p>Deletes Padding OBUs.
  180. </p>
  181. </dd>
  182. </dl>
  183. <a name="chomp"></a>
  184. <h3 class="section">2.3 chomp<span class="pull-right"><a class="anchor hidden-xs" href="#chomp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chomp" aria-hidden="true">TOC</a></span></h3>
  185. <p>Remove zero padding at the end of a packet.
  186. </p>
  187. <a name="dca_005fcore"></a>
  188. <h3 class="section">2.4 dca_core<span class="pull-right"><a class="anchor hidden-xs" href="#dca_005fcore" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dca_005fcore" aria-hidden="true">TOC</a></span></h3>
  189. <p>Extract the core from a DCA/DTS stream, dropping extensions such as
  190. DTS-HD.
  191. </p>
  192. <a name="dovi_005frpu"></a>
  193. <h3 class="section">2.5 dovi_rpu<span class="pull-right"><a class="anchor hidden-xs" href="#dovi_005frpu" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dovi_005frpu" aria-hidden="true">TOC</a></span></h3>
  194. <p>Manipulate Dolby Vision metadata in a HEVC/AV1 bitstream, optionally enabling
  195. metadata compression.
  196. </p>
  197. <dl class="table">
  198. <dt><samp class="option">strip</samp></dt>
  199. <dd><p>If enabled, strip all Dolby Vision metadata (configuration record + RPU data
  200. blocks) from the stream.
  201. </p></dd>
  202. <dt><samp class="option">compression</samp></dt>
  203. <dd><p>Which compression level to enable.
  204. </p><dl class="table">
  205. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  206. <dd><p>No metadata compression.
  207. </p></dd>
  208. <dt>&lsquo;<samp class="samp">limited</samp>&rsquo;</dt>
  209. <dd><p>Limited metadata compression scheme. Should be compatible with most devices.
  210. This is the default.
  211. </p></dd>
  212. <dt>&lsquo;<samp class="samp">extended</samp>&rsquo;</dt>
  213. <dd><p>Extended metadata compression. Devices are not required to support this. Note
  214. that this level currently behaves the same as &lsquo;<samp class="samp">limited</samp>&rsquo; in libavcodec.
  215. </p></dd>
  216. </dl>
  217. </dd>
  218. </dl>
  219. <a name="dump_005fextra"></a>
  220. <h3 class="section">2.6 dump_extra<span class="pull-right"><a class="anchor hidden-xs" href="#dump_005fextra" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dump_005fextra" aria-hidden="true">TOC</a></span></h3>
  221. <p>Add extradata to the beginning of the filtered packets except when
  222. said packets already exactly begin with the extradata that is intended
  223. to be added.
  224. </p>
  225. <dl class="table">
  226. <dt><samp class="option">freq</samp></dt>
  227. <dd><p>The additional argument specifies which packets should be filtered.
  228. It accepts the values:
  229. </p><dl class="table">
  230. <dt>&lsquo;<samp class="samp">k</samp>&rsquo;</dt>
  231. <dt>&lsquo;<samp class="samp">keyframe</samp>&rsquo;</dt>
  232. <dd><p>add extradata to all key packets
  233. </p>
  234. </dd>
  235. <dt>&lsquo;<samp class="samp">e</samp>&rsquo;</dt>
  236. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  237. <dd><p>add extradata to all packets
  238. </p></dd>
  239. </dl>
  240. </dd>
  241. </dl>
  242. <p>If not specified it is assumed &lsquo;<samp class="samp">k</samp>&rsquo;.
  243. </p>
  244. <p>For example the following <code class="command">ffmpeg</code> command forces a global
  245. header (thus disabling individual packet headers) in the H.264 packets
  246. generated by the <code class="code">libx264</code> encoder, but corrects them by adding
  247. the header stored in extradata to the key packets:
  248. </p><div class="example">
  249. <pre class="example-preformatted">ffmpeg -i INPUT -map 0 -flags:v +global_header -c:v libx264 -bsf:v dump_extra out.ts
  250. </pre></div>
  251. <a name="dv_005ferror_005fmarker"></a>
  252. <h3 class="section">2.7 dv_error_marker<span class="pull-right"><a class="anchor hidden-xs" href="#dv_005ferror_005fmarker" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dv_005ferror_005fmarker" aria-hidden="true">TOC</a></span></h3>
  253. <p>Blocks in DV which are marked as damaged are replaced by blocks of the specified color.
  254. </p>
  255. <dl class="table">
  256. <dt><samp class="option">color</samp></dt>
  257. <dd><p>The color to replace damaged blocks by
  258. </p></dd>
  259. <dt><samp class="option">sta</samp></dt>
  260. <dd><p>A 16 bit mask which specifies which of the 16 possible error status values are
  261. to be replaced by colored blocks. 0xFFFE is the default which replaces all non 0
  262. error status values.
  263. </p><dl class="table">
  264. <dt>&lsquo;<samp class="samp">ok</samp>&rsquo;</dt>
  265. <dd><p>No error, no concealment
  266. </p></dd>
  267. <dt>&lsquo;<samp class="samp">err</samp>&rsquo;</dt>
  268. <dd><p>Error, No concealment
  269. </p></dd>
  270. <dt>&lsquo;<samp class="samp">res</samp>&rsquo;</dt>
  271. <dd><p>Reserved
  272. </p></dd>
  273. <dt>&lsquo;<samp class="samp">notok</samp>&rsquo;</dt>
  274. <dd><p>Error or concealment
  275. </p></dd>
  276. <dt>&lsquo;<samp class="samp">notres</samp>&rsquo;</dt>
  277. <dd><p>Not reserved
  278. </p></dd>
  279. <dt>&lsquo;<samp class="samp">Aa, Ba, Ca, Ab, Bb, Cb, A, B, C, a, b, erri, erru</samp>&rsquo;</dt>
  280. <dd><p>The specific error status code
  281. </p></dd>
  282. </dl>
  283. <p>see page 44-46 or section 5.5 of
  284. <a class="url" href="http://web.archive.org/web/20060927044735/http://www.smpte.org/smpte_store/standards/pdf/s314m.pdf">http://web.archive.org/web/20060927044735/http://www.smpte.org/smpte_store/standards/pdf/s314m.pdf</a>
  285. </p>
  286. </dd>
  287. </dl>
  288. <a name="eac3_005fcore"></a>
  289. <h3 class="section">2.8 eac3_core<span class="pull-right"><a class="anchor hidden-xs" href="#eac3_005fcore" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-eac3_005fcore" aria-hidden="true">TOC</a></span></h3>
  290. <p>Extract the core from a E-AC-3 stream, dropping extra channels.
  291. </p>
  292. <a name="eia608_005fto_005fsmpte436m"></a>
  293. <h3 class="section">2.9 eia608_to_smpte436m<span class="pull-right"><a class="anchor hidden-xs" href="#eia608_005fto_005fsmpte436m" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-eia608_005fto_005fsmpte436m" aria-hidden="true">TOC</a></span></h3>
  294. <p>Convert from a <code class="code">EIA_608</code> stream to a <code class="code">SMPTE_436M_ANC</code> data stream, wrapping the closed captions in CTA-708 CDP VANC packets.
  295. </p>
  296. <dl class="table">
  297. <dt><samp class="option">line_number</samp></dt>
  298. <dd><p>Choose which line number the generated VANC packets should go on. You generally want either line 9 (the default) or 11.
  299. </p></dd>
  300. <dt><samp class="option">wrapping_type</samp></dt>
  301. <dd><p>Choose the SMPTE 436M wrapping type, defaults to &lsquo;<samp class="samp">vanc_frame</samp>&rsquo;.
  302. It accepts the values:
  303. </p><dl class="table">
  304. <dt>&lsquo;<samp class="samp">vanc_frame</samp>&rsquo;</dt>
  305. <dd><p>VANC frame (interlaced or segmented progressive frame)
  306. </p></dd>
  307. <dt>&lsquo;<samp class="samp">vanc_field_1</samp>&rsquo;</dt>
  308. <dt>&lsquo;<samp class="samp">vanc_field_2</samp>&rsquo;</dt>
  309. <dt>&lsquo;<samp class="samp">vanc_progressive_frame</samp>&rsquo;</dt>
  310. </dl>
  311. </dd>
  312. <dt><samp class="option">sample_coding</samp></dt>
  313. <dd><p>Choose the SMPTE 436M sample coding, defaults to &lsquo;<samp class="samp">8bit_luma</samp>&rsquo;.
  314. It accepts the values:
  315. </p><dl class="table">
  316. <dt>&lsquo;<samp class="samp">8bit_luma</samp>&rsquo;</dt>
  317. <dd><p>8-bit component luma samples
  318. </p></dd>
  319. <dt>&lsquo;<samp class="samp">8bit_color_diff</samp>&rsquo;</dt>
  320. <dd><p>8-bit component color difference samples
  321. </p></dd>
  322. <dt>&lsquo;<samp class="samp">8bit_luma_and_color_diff</samp>&rsquo;</dt>
  323. <dd><p>8-bit component luma and color difference samples
  324. </p></dd>
  325. <dt>&lsquo;<samp class="samp">10bit_luma</samp>&rsquo;</dt>
  326. <dd><p>10-bit component luma samples
  327. </p></dd>
  328. <dt>&lsquo;<samp class="samp">10bit_color_diff</samp>&rsquo;</dt>
  329. <dd><p>10-bit component color difference samples
  330. </p></dd>
  331. <dt>&lsquo;<samp class="samp">10bit_luma_and_color_diff</samp>&rsquo;</dt>
  332. <dd><p>10-bit component luma and color difference samples
  333. </p></dd>
  334. <dt>&lsquo;<samp class="samp">8bit_luma_parity_error</samp>&rsquo;</dt>
  335. <dd><p>8-bit component luma samples with parity error
  336. </p></dd>
  337. <dt>&lsquo;<samp class="samp">8bit_color_diff_parity_error</samp>&rsquo;</dt>
  338. <dd><p>8-bit component color difference samples with parity error
  339. </p></dd>
  340. <dt>&lsquo;<samp class="samp">8bit_luma_and_color_diff_parity_error</samp>&rsquo;</dt>
  341. <dd><p>8-bit component luma and color difference samples with parity error
  342. </p></dd>
  343. </dl>
  344. </dd>
  345. <dt><samp class="option">initial_cdp_sequence_cntr</samp></dt>
  346. <dd><p>The initial value of the CDP&rsquo;s 16-bit unsigned integer <code class="code">cdp_hdr_sequence_cntr</code> and <code class="code">cdp_ftr_sequence_cntr</code> fields. Defaults to 0.
  347. </p></dd>
  348. <dt><samp class="option">cdp_frame_rate</samp></dt>
  349. <dd><p>Set the CDP&rsquo;s <code class="code">cdp_frame_rate</code> field. This doesn&rsquo;t actually change the timing of the data stream, it just changes the values inserted in that field in the generated CDP packets. Defaults to &lsquo;<samp class="samp">30000/1001</samp>&rsquo;.
  350. </p></dd>
  351. </dl>
  352. <a name="extract_005fextradata"></a>
  353. <h3 class="section">2.10 extract_extradata<span class="pull-right"><a class="anchor hidden-xs" href="#extract_005fextradata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-extract_005fextradata" aria-hidden="true">TOC</a></span></h3>
  354. <p>Extract the in-band extradata.
  355. </p>
  356. <p>Certain codecs allow the long-term headers (e.g. MPEG-2 sequence headers,
  357. or H.264/HEVC (VPS/)SPS/PPS) to be transmitted either &quot;in-band&quot; (i.e. as a part
  358. of the bitstream containing the coded frames) or &quot;out of band&quot; (e.g. on the
  359. container level). This latter form is called &quot;extradata&quot; in FFmpeg terminology.
  360. </p>
  361. <p>This bitstream filter detects the in-band headers and makes them available as
  362. extradata.
  363. </p>
  364. <dl class="table">
  365. <dt><samp class="option">remove</samp></dt>
  366. <dd><p>When this option is enabled, the long-term headers are removed from the
  367. bitstream after extraction.
  368. </p></dd>
  369. </dl>
  370. <a name="filter_005funits"></a>
  371. <h3 class="section">2.11 filter_units<span class="pull-right"><a class="anchor hidden-xs" href="#filter_005funits" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-filter_005funits" aria-hidden="true">TOC</a></span></h3>
  372. <p>Remove units with types in or not in a given set from the stream.
  373. </p>
  374. <dl class="table">
  375. <dt><samp class="option">pass_types</samp></dt>
  376. <dd><p>List of unit types or ranges of unit types to pass through while removing
  377. all others. This is specified as a &rsquo;|&rsquo;-separated list of unit type values
  378. or ranges of values with &rsquo;-&rsquo;.
  379. </p>
  380. </dd>
  381. <dt><samp class="option">remove_types</samp></dt>
  382. <dd><p>Identical to <samp class="option">pass_types</samp>, except the units in the given set
  383. removed and all others passed through.
  384. </p></dd>
  385. </dl>
  386. <p>The types used by pass_types and remove_types correspond to NAL unit types
  387. (nal_unit_type) in H.264, HEVC and H.266 (see Table 7-1 in the H.264
  388. and HEVC specifications or Table 5 in the H.266 specification), to
  389. marker values for JPEG (without 0xFF prefix) and to start codes without
  390. start code prefix (i.e. the byte following the 0x000001) for MPEG-2.
  391. For VP8 and VP9, every unit has type zero.
  392. </p>
  393. <p>Extradata is unchanged by this transformation, but note that if the stream
  394. contains inline parameter sets then the output may be unusable if they are
  395. removed.
  396. </p>
  397. <p>For example, to remove all non-VCL NAL units from an H.264 stream:
  398. </p><div class="example">
  399. <pre class="example-preformatted">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=pass_types=1-5' OUTPUT
  400. </pre></div>
  401. <p>To remove all AUDs, SEI and filler from an H.265 stream:
  402. </p><div class="example">
  403. <pre class="example-preformatted">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=35|38-40' OUTPUT
  404. </pre></div>
  405. <p>To remove all user data from a MPEG-2 stream, including Closed Captions:
  406. </p><div class="example">
  407. <pre class="example-preformatted">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=178' OUTPUT
  408. </pre></div>
  409. <p>To remove all SEI from a H264 stream, including Closed Captions:
  410. </p><div class="example">
  411. <pre class="example-preformatted">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=6' OUTPUT
  412. </pre></div>
  413. <p>To remove all prefix and suffix SEI from a HEVC stream, including Closed Captions and dynamic HDR:
  414. </p><div class="example">
  415. <pre class="example-preformatted">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=39|40' OUTPUT
  416. </pre></div>
  417. <a name="hapqa_005fextract"></a>
  418. <h3 class="section">2.12 hapqa_extract<span class="pull-right"><a class="anchor hidden-xs" href="#hapqa_005fextract" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hapqa_005fextract" aria-hidden="true">TOC</a></span></h3>
  419. <p>Extract Rgb or Alpha part of an HAPQA file, without recompression, in order to create an HAPQ or an HAPAlphaOnly file.
  420. </p>
  421. <dl class="table">
  422. <dt><samp class="option">texture</samp></dt>
  423. <dd><p>Specifies the texture to keep.
  424. </p>
  425. <dl class="table">
  426. <dt><samp class="option">color</samp></dt>
  427. <dt><samp class="option">alpha</samp></dt>
  428. </dl>
  429. </dd>
  430. </dl>
  431. <p>Convert HAPQA to HAPQ
  432. </p><div class="example">
  433. <pre class="example-preformatted">ffmpeg -i hapqa_inputfile.mov -c copy -bsf:v hapqa_extract=texture=color -tag:v HapY -metadata:s:v:0 encoder=&quot;HAPQ&quot; hapq_file.mov
  434. </pre></div>
  435. <p>Convert HAPQA to HAPAlphaOnly
  436. </p><div class="example">
  437. <pre class="example-preformatted">ffmpeg -i hapqa_inputfile.mov -c copy -bsf:v hapqa_extract=texture=alpha -tag:v HapA -metadata:s:v:0 encoder=&quot;HAPAlpha Only&quot; hapalphaonly_file.mov
  438. </pre></div>
  439. <a name="h264_005fmetadata"></a>
  440. <h3 class="section">2.13 h264_metadata<span class="pull-right"><a class="anchor hidden-xs" href="#h264_005fmetadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-h264_005fmetadata" aria-hidden="true">TOC</a></span></h3>
  441. <p>Modify metadata embedded in an H.264 stream.
  442. </p>
  443. <dl class="table">
  444. <dt><samp class="option">aud</samp></dt>
  445. <dd><p>Insert or remove AUD NAL units in all access units of the stream.
  446. </p>
  447. <dl class="table">
  448. <dt>&lsquo;<samp class="samp">pass</samp>&rsquo;</dt>
  449. <dt>&lsquo;<samp class="samp">insert</samp>&rsquo;</dt>
  450. <dt>&lsquo;<samp class="samp">remove</samp>&rsquo;</dt>
  451. </dl>
  452. <p>Default is pass.
  453. </p>
  454. </dd>
  455. <dt><samp class="option">sample_aspect_ratio</samp></dt>
  456. <dd><p>Set the sample aspect ratio of the stream in the VUI parameters.
  457. See H.264 table E-1.
  458. </p>
  459. </dd>
  460. <dt><samp class="option">overscan_appropriate_flag</samp></dt>
  461. <dd><p>Set whether the stream is suitable for display using overscan
  462. or not (see H.264 section E.2.1).
  463. </p>
  464. </dd>
  465. <dt><samp class="option">video_format</samp></dt>
  466. <dt><samp class="option">video_full_range_flag</samp></dt>
  467. <dd><p>Set the video format in the stream (see H.264 section E.2.1 and
  468. table E-2).
  469. </p>
  470. </dd>
  471. <dt><samp class="option">colour_primaries</samp></dt>
  472. <dt><samp class="option">transfer_characteristics</samp></dt>
  473. <dt><samp class="option">matrix_coefficients</samp></dt>
  474. <dd><p>Set the colour description in the stream (see H.264 section E.2.1
  475. and tables E-3, E-4 and E-5).
  476. </p>
  477. </dd>
  478. <dt><samp class="option">chroma_sample_loc_type</samp></dt>
  479. <dd><p>Set the chroma sample location in the stream (see H.264 section
  480. E.2.1 and figure E-1).
  481. </p>
  482. </dd>
  483. <dt><samp class="option">tick_rate</samp></dt>
  484. <dd><p>Set the tick rate (time_scale / num_units_in_tick) in the VUI
  485. parameters. This is the smallest time unit representable in the
  486. stream, and in many cases represents the field rate of the stream
  487. (double the frame rate).
  488. </p></dd>
  489. <dt><samp class="option">fixed_frame_rate_flag</samp></dt>
  490. <dd><p>Set whether the stream has fixed framerate - typically this indicates
  491. that the framerate is exactly half the tick rate, but the exact
  492. meaning is dependent on interlacing and the picture structure (see
  493. H.264 section E.2.1 and table E-6).
  494. </p></dd>
  495. <dt><samp class="option">zero_new_constraint_set_flags</samp></dt>
  496. <dd><p>Zero constraint_set4_flag and constraint_set5_flag in the SPS. These
  497. bits were reserved in a previous version of the H.264 spec, and thus
  498. some hardware decoders require these to be zero. The result of zeroing
  499. this is still a valid bitstream.
  500. </p>
  501. </dd>
  502. <dt><samp class="option">crop_left</samp></dt>
  503. <dt><samp class="option">crop_right</samp></dt>
  504. <dt><samp class="option">crop_top</samp></dt>
  505. <dt><samp class="option">crop_bottom</samp></dt>
  506. <dd><p>Set the frame cropping offsets in the SPS. These values will replace
  507. the current ones if the stream is already cropped.
  508. </p>
  509. <p>These fields are set in pixels. Note that some sizes may not be
  510. representable if the chroma is subsampled or the stream is interlaced
  511. (see H.264 section 7.4.2.1.1).
  512. </p>
  513. </dd>
  514. <dt><samp class="option">sei_user_data</samp></dt>
  515. <dd><p>Insert a string as SEI unregistered user data. The argument must
  516. be of the form <em class="emph">UUID+string</em>, where the UUID is as hex digits
  517. possibly separated by hyphens, and the string can be anything.
  518. </p>
  519. <p>For example, &lsquo;<samp class="samp">086f3693-b7b3-4f2c-9653-21492feee5b8+hello</samp>&rsquo; will
  520. insert the string &ldquo;hello&rdquo; associated with the given UUID.
  521. </p>
  522. </dd>
  523. <dt><samp class="option">delete_filler</samp></dt>
  524. <dd><p>Deletes both filler NAL units and filler SEI messages.
  525. </p>
  526. </dd>
  527. <dt><samp class="option">display_orientation</samp></dt>
  528. <dd><p>Insert, extract or remove Display orientation SEI messages.
  529. See H.264 section D.1.27 and D.2.27 for syntax and semantics.
  530. </p>
  531. <dl class="table">
  532. <dt>&lsquo;<samp class="samp">pass</samp>&rsquo;</dt>
  533. <dt>&lsquo;<samp class="samp">insert</samp>&rsquo;</dt>
  534. <dt>&lsquo;<samp class="samp">remove</samp>&rsquo;</dt>
  535. <dt>&lsquo;<samp class="samp">extract</samp>&rsquo;</dt>
  536. </dl>
  537. <p>Default is pass.
  538. </p>
  539. <p>Insert mode works in conjunction with <code class="code">rotate</code> and <code class="code">flip</code> options.
  540. Any pre-existing Display orientation messages will be removed in insert or remove mode.
  541. Extract mode attaches the display matrix to the packet as side data.
  542. </p>
  543. </dd>
  544. <dt><samp class="option">rotate</samp></dt>
  545. <dd><p>Set rotation in display orientation SEI (anticlockwise angle in degrees).
  546. Range is -360 to +360. Default is NaN.
  547. </p>
  548. </dd>
  549. <dt><samp class="option">flip</samp></dt>
  550. <dd><p>Set flip in display orientation SEI.
  551. </p>
  552. <dl class="table">
  553. <dt>&lsquo;<samp class="samp">horizontal</samp>&rsquo;</dt>
  554. <dt>&lsquo;<samp class="samp">vertical</samp>&rsquo;</dt>
  555. </dl>
  556. <p>Default is unset.
  557. </p>
  558. </dd>
  559. <dt><samp class="option">level</samp></dt>
  560. <dd><p>Set the level in the SPS. Refer to H.264 section A.3 and tables A-1
  561. to A-5.
  562. </p>
  563. <p>The argument must be the name of a level (for example, &lsquo;<samp class="samp">4.2</samp>&rsquo;), a
  564. level_idc value (for example, &lsquo;<samp class="samp">42</samp>&rsquo;), or the special name &lsquo;<samp class="samp">auto</samp>&rsquo;
  565. indicating that the filter should attempt to guess the level from the
  566. input stream properties.
  567. </p>
  568. </dd>
  569. </dl>
  570. <a name="h264_005fmp4toannexb"></a>
  571. <h3 class="section">2.14 h264_mp4toannexb<span class="pull-right"><a class="anchor hidden-xs" href="#h264_005fmp4toannexb" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-h264_005fmp4toannexb" aria-hidden="true">TOC</a></span></h3>
  572. <p>Convert an H.264 bitstream from length prefixed mode to start code
  573. prefixed mode (as defined in the Annex B of the ITU-T H.264
  574. specification).
  575. </p>
  576. <p>This is required by some streaming formats, typically the MPEG-2
  577. transport stream format (muxer <code class="code">mpegts</code>).
  578. </p>
  579. <p>For example to remux an MP4 file containing an H.264 stream to mpegts
  580. format with <code class="command">ffmpeg</code>, you can use the command:
  581. </p>
  582. <div class="example">
  583. <pre class="example-preformatted">ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
  584. </pre></div>
  585. <p>Please note that this filter is auto-inserted for MPEG-TS (muxer
  586. <code class="code">mpegts</code>) and raw H.264 (muxer <code class="code">h264</code>) output formats.
  587. </p>
  588. <a name="h264_005fredundant_005fpps"></a>
  589. <h3 class="section">2.15 h264_redundant_pps<span class="pull-right"><a class="anchor hidden-xs" href="#h264_005fredundant_005fpps" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-h264_005fredundant_005fpps" aria-hidden="true">TOC</a></span></h3>
  590. <p>This applies a specific fixup to some Blu-ray BDMV H264 streams
  591. which contain redundant PPSs. The PPSs modify irrelevant parameters
  592. of the stream, confusing other transformations which require
  593. the correct extradata.
  594. </p>
  595. <p>The encoder used on these impacted streams adds extra PPSs throughout
  596. the stream, varying the initial QP and whether weighted prediction
  597. was enabled. This causes issues after copying the stream into
  598. a global header container, as the starting PPS is not suitable
  599. for the rest of the stream. One side effect, for example,
  600. is seeking will return garbled output until a new PPS appears.
  601. </p>
  602. <p>This BSF removes the extra PPSs and rewrites the slice headers
  603. such that the stream uses a single leading PPS in the global header,
  604. which resolves the issue.
  605. </p>
  606. <a name="hevc_005fmetadata"></a>
  607. <h3 class="section">2.16 hevc_metadata<span class="pull-right"><a class="anchor hidden-xs" href="#hevc_005fmetadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hevc_005fmetadata" aria-hidden="true">TOC</a></span></h3>
  608. <p>Modify metadata embedded in an HEVC stream.
  609. </p>
  610. <dl class="table">
  611. <dt><samp class="option">aud</samp></dt>
  612. <dd><p>Insert or remove AUD NAL units in all access units of the stream.
  613. </p>
  614. <dl class="table">
  615. <dt>&lsquo;<samp class="samp">insert</samp>&rsquo;</dt>
  616. <dt>&lsquo;<samp class="samp">remove</samp>&rsquo;</dt>
  617. </dl>
  618. </dd>
  619. <dt><samp class="option">sample_aspect_ratio</samp></dt>
  620. <dd><p>Set the sample aspect ratio in the stream in the VUI parameters.
  621. </p>
  622. </dd>
  623. <dt><samp class="option">video_format</samp></dt>
  624. <dt><samp class="option">video_full_range_flag</samp></dt>
  625. <dd><p>Set the video format in the stream (see H.265 section E.3.1 and
  626. table E.2).
  627. </p>
  628. </dd>
  629. <dt><samp class="option">colour_primaries</samp></dt>
  630. <dt><samp class="option">transfer_characteristics</samp></dt>
  631. <dt><samp class="option">matrix_coefficients</samp></dt>
  632. <dd><p>Set the colour description in the stream (see H.265 section E.3.1
  633. and tables E.3, E.4 and E.5).
  634. </p>
  635. </dd>
  636. <dt><samp class="option">chroma_sample_loc_type</samp></dt>
  637. <dd><p>Set the chroma sample location in the stream (see H.265 section
  638. E.3.1 and figure E.1).
  639. </p>
  640. </dd>
  641. <dt><samp class="option">tick_rate</samp></dt>
  642. <dd><p>Set the tick rate in the VPS and VUI parameters (time_scale /
  643. num_units_in_tick). Combined with <samp class="option">num_ticks_poc_diff_one</samp>, this can
  644. set a constant framerate in the stream. Note that it is likely to be
  645. overridden by container parameters when the stream is in a container.
  646. </p>
  647. </dd>
  648. <dt><samp class="option">num_ticks_poc_diff_one</samp></dt>
  649. <dd><p>Set poc_proportional_to_timing_flag in VPS and VUI and use this value
  650. to set num_ticks_poc_diff_one_minus1 (see H.265 sections 7.4.3.1 and
  651. E.3.1). Ignored if <samp class="option">tick_rate</samp> is not also set.
  652. </p>
  653. </dd>
  654. <dt><samp class="option">crop_left</samp></dt>
  655. <dt><samp class="option">crop_right</samp></dt>
  656. <dt><samp class="option">crop_top</samp></dt>
  657. <dt><samp class="option">crop_bottom</samp></dt>
  658. <dd><p>Set the conformance window cropping offsets in the SPS. These values
  659. will replace the current ones if the stream is already cropped.
  660. </p>
  661. <p>These fields are set in pixels. Note that some sizes may not be
  662. representable if the chroma is subsampled (H.265 section 7.4.3.2.1).
  663. </p>
  664. </dd>
  665. <dt><samp class="option">width</samp></dt>
  666. <dt><samp class="option">height</samp></dt>
  667. <dd><p>Set width and height after crop.
  668. </p>
  669. </dd>
  670. <dt><samp class="option">level</samp></dt>
  671. <dd><p>Set the level in the VPS and SPS. See H.265 section A.4 and tables
  672. A.6 and A.7.
  673. </p>
  674. <p>The argument must be the name of a level (for example, &lsquo;<samp class="samp">5.1</samp>&rsquo;), a
  675. <em class="emph">general_level_idc</em> value (for example, &lsquo;<samp class="samp">153</samp>&rsquo; for level 5.1),
  676. or the special name &lsquo;<samp class="samp">auto</samp>&rsquo; indicating that the filter should
  677. attempt to guess the level from the input stream properties.
  678. </p>
  679. </dd>
  680. </dl>
  681. <a name="hevc_005fmp4toannexb"></a>
  682. <h3 class="section">2.17 hevc_mp4toannexb<span class="pull-right"><a class="anchor hidden-xs" href="#hevc_005fmp4toannexb" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hevc_005fmp4toannexb" aria-hidden="true">TOC</a></span></h3>
  683. <p>Convert an HEVC/H.265 bitstream from length prefixed mode to start code
  684. prefixed mode (as defined in the Annex B of the ITU-T H.265
  685. specification).
  686. </p>
  687. <p>This is required by some streaming formats, typically the MPEG-2
  688. transport stream format (muxer <code class="code">mpegts</code>).
  689. </p>
  690. <p>For example to remux an MP4 file containing an HEVC stream to mpegts
  691. format with <code class="command">ffmpeg</code>, you can use the command:
  692. </p>
  693. <div class="example">
  694. <pre class="example-preformatted">ffmpeg -i INPUT.mp4 -codec copy -bsf:v hevc_mp4toannexb OUTPUT.ts
  695. </pre></div>
  696. <p>Please note that this filter is auto-inserted for MPEG-TS (muxer
  697. <code class="code">mpegts</code>) and raw HEVC/H.265 (muxer <code class="code">h265</code> or
  698. <code class="code">hevc</code>) output formats.
  699. </p>
  700. <a name="imxdump"></a>
  701. <h3 class="section">2.18 imxdump<span class="pull-right"><a class="anchor hidden-xs" href="#imxdump" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-imxdump" aria-hidden="true">TOC</a></span></h3>
  702. <p>Modifies the bitstream to fit in MOV and to be usable by the Final Cut
  703. Pro decoder. This filter only applies to the mpeg2video codec, and is
  704. likely not needed for Final Cut Pro 7 and newer with the appropriate
  705. <samp class="option">-tag:v</samp>.
  706. </p>
  707. <p>For example, to remux 30 MB/sec NTSC IMX to MOV:
  708. </p>
  709. <div class="example">
  710. <pre class="example-preformatted">ffmpeg -i input.mxf -c copy -bsf:v imxdump -tag:v mx3n output.mov
  711. </pre></div>
  712. <a name="mjpeg2jpeg"></a>
  713. <h3 class="section">2.19 mjpeg2jpeg<span class="pull-right"><a class="anchor hidden-xs" href="#mjpeg2jpeg" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mjpeg2jpeg" aria-hidden="true">TOC</a></span></h3>
  714. <p>Convert MJPEG/AVI1 packets to full JPEG/JFIF packets.
  715. </p>
  716. <p>MJPEG is a video codec wherein each video frame is essentially a
  717. JPEG image. The individual frames can be extracted without loss,
  718. e.g. by
  719. </p>
  720. <div class="example">
  721. <pre class="example-preformatted">ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
  722. </pre></div>
  723. <p>Unfortunately, these chunks are incomplete JPEG images, because
  724. they lack the DHT segment required for decoding. Quoting from
  725. <a class="url" href="http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml">http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml</a>:
  726. </p>
  727. <p>Avery Lee, writing in the rec.video.desktop newsgroup in 2001,
  728. commented that &quot;MJPEG, or at least the MJPEG in AVIs having the
  729. MJPG fourcc, is restricted JPEG with a fixed &ndash; and *omitted* &ndash;
  730. Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2,
  731. and it must use basic Huffman encoding, not arithmetic or
  732. progressive. . . . You can indeed extract the MJPEG frames and
  733. decode them with a regular JPEG decoder, but you have to prepend
  734. the DHT segment to them, or else the decoder won&rsquo;t have any idea
  735. how to decompress the data. The exact table necessary is given in
  736. the OpenDML spec.&quot;
  737. </p>
  738. <p>This bitstream filter patches the header of frames extracted from an MJPEG
  739. stream (carrying the AVI1 header ID and lacking a DHT segment) to
  740. produce fully qualified JPEG images.
  741. </p>
  742. <div class="example">
  743. <pre class="example-preformatted">ffmpeg -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpg
  744. exiftran -i -9 frame*.jpg
  745. ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
  746. </pre></div>
  747. <a name="mjpegadump"></a>
  748. <h3 class="section">2.20 mjpegadump<span class="pull-right"><a class="anchor hidden-xs" href="#mjpegadump" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mjpegadump" aria-hidden="true">TOC</a></span></h3>
  749. <p>Add an MJPEG A header to the bitstream, to enable decoding by
  750. Quicktime.
  751. </p>
  752. <a class="anchor" id="mov2textsub"></a><a name="mov2textsub-1"></a>
  753. <h3 class="section">2.21 mov2textsub<span class="pull-right"><a class="anchor hidden-xs" href="#mov2textsub-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mov2textsub-1" aria-hidden="true">TOC</a></span></h3>
  754. <p>Extract a representable text file from MOV subtitles, stripping the
  755. metadata header from each subtitle packet.
  756. </p>
  757. <p>See also the <a class="ref" href="#text2movsub">text2movsub</a> filter.
  758. </p>
  759. <a name="mpeg2_005fmetadata"></a>
  760. <h3 class="section">2.22 mpeg2_metadata<span class="pull-right"><a class="anchor hidden-xs" href="#mpeg2_005fmetadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mpeg2_005fmetadata" aria-hidden="true">TOC</a></span></h3>
  761. <p>Modify metadata embedded in an MPEG-2 stream.
  762. </p>
  763. <dl class="table">
  764. <dt><samp class="option">display_aspect_ratio</samp></dt>
  765. <dd><p>Set the display aspect ratio in the stream.
  766. </p>
  767. <p>The following fixed values are supported:
  768. </p><dl class="table">
  769. <dt><samp class="option">4/3</samp></dt>
  770. <dt><samp class="option">16/9</samp></dt>
  771. <dt><samp class="option">221/100</samp></dt>
  772. </dl>
  773. <p>Any other value will result in square pixels being signalled instead
  774. (see H.262 section 6.3.3 and table 6-3).
  775. </p>
  776. </dd>
  777. <dt><samp class="option">frame_rate</samp></dt>
  778. <dd><p>Set the frame rate in the stream. This is constructed from a table
  779. of known values combined with a small multiplier and divisor - if
  780. the supplied value is not exactly representable, the nearest
  781. representable value will be used instead (see H.262 section 6.3.3
  782. and table 6-4).
  783. </p>
  784. </dd>
  785. <dt><samp class="option">video_format</samp></dt>
  786. <dd><p>Set the video format in the stream (see H.262 section 6.3.6 and
  787. table 6-6).
  788. </p>
  789. </dd>
  790. <dt><samp class="option">colour_primaries</samp></dt>
  791. <dt><samp class="option">transfer_characteristics</samp></dt>
  792. <dt><samp class="option">matrix_coefficients</samp></dt>
  793. <dd><p>Set the colour description in the stream (see H.262 section 6.3.6
  794. and tables 6-7, 6-8 and 6-9).
  795. </p>
  796. </dd>
  797. </dl>
  798. <a name="mpeg4_005funpack_005fbframes"></a>
  799. <h3 class="section">2.23 mpeg4_unpack_bframes<span class="pull-right"><a class="anchor hidden-xs" href="#mpeg4_005funpack_005fbframes" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mpeg4_005funpack_005fbframes" aria-hidden="true">TOC</a></span></h3>
  800. <p>Unpack DivX-style packed B-frames.
  801. </p>
  802. <p>DivX-style packed B-frames are not valid MPEG-4 and were only a
  803. workaround for the broken Video for Windows subsystem.
  804. They use more space, can cause minor AV sync issues, require more
  805. CPU power to decode (unless the player has some decoded picture queue
  806. to compensate the 2,0,2,0 frame per packet style) and cause
  807. trouble if copied into a standard container like mp4 or mpeg-ps/ts,
  808. because MPEG-4 decoders may not be able to decode them, since they are
  809. not valid MPEG-4.
  810. </p>
  811. <p>For example to fix an AVI file containing an MPEG-4 stream with
  812. DivX-style packed B-frames using <code class="command">ffmpeg</code>, you can use the command:
  813. </p>
  814. <div class="example">
  815. <pre class="example-preformatted">ffmpeg -i INPUT.avi -codec copy -bsf:v mpeg4_unpack_bframes OUTPUT.avi
  816. </pre></div>
  817. <a name="noise"></a>
  818. <h3 class="section">2.24 noise<span class="pull-right"><a class="anchor hidden-xs" href="#noise" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-noise" aria-hidden="true">TOC</a></span></h3>
  819. <p>Damages the contents of packets or simply drops them without damaging the
  820. container. Can be used for fuzzing or testing error resilience/concealment.
  821. </p>
  822. <p>Parameters:
  823. </p><dl class="table">
  824. <dt><samp class="option">amount</samp></dt>
  825. <dd><p>Accepts an expression whose evaluation per-packet determines how often bytes in that
  826. packet will be modified. A value below 0 will result in a variable frequency.
  827. Default is 0 which results in no modification. However, if neither amount nor drop is specified,
  828. amount will be set to <var class="var">-1</var>. See below for accepted variables.
  829. </p></dd>
  830. <dt><samp class="option">drop</samp></dt>
  831. <dd><p>Accepts an expression evaluated per-packet whose value determines whether that packet is dropped.
  832. Evaluation to a positive value results in the packet being dropped. Evaluation to a negative
  833. value results in a variable chance of it being dropped, roughly inverse in proportion to the magnitude
  834. of the value. Default is 0 which results in no drops. See below for accepted variables.
  835. </p></dd>
  836. <dt><samp class="option">dropamount</samp></dt>
  837. <dd><p>Accepts a non-negative integer, which assigns a variable chance of it being dropped, roughly inverse
  838. in proportion to the value. Default is 0 which results in no drops. This option is kept for backwards
  839. compatibility and is equivalent to setting drop to a negative value with the same magnitude
  840. i.e. <code class="code">dropamount=4</code> is the same as <code class="code">drop=-4</code>. Ignored if drop is also specified.
  841. </p></dd>
  842. </dl>
  843. <p>Both <code class="code">amount</code> and <code class="code">drop</code> accept expressions containing the following variables:
  844. </p>
  845. <dl class="table">
  846. <dt>&lsquo;<samp class="samp">n</samp>&rsquo;</dt>
  847. <dd><p>The index of the packet, starting from zero.
  848. </p></dd>
  849. <dt>&lsquo;<samp class="samp">tb</samp>&rsquo;</dt>
  850. <dd><p>The timebase for packet timestamps.
  851. </p></dd>
  852. <dt>&lsquo;<samp class="samp">pts</samp>&rsquo;</dt>
  853. <dd><p>Packet presentation timestamp.
  854. </p></dd>
  855. <dt>&lsquo;<samp class="samp">dts</samp>&rsquo;</dt>
  856. <dd><p>Packet decoding timestamp.
  857. </p></dd>
  858. <dt>&lsquo;<samp class="samp">nopts</samp>&rsquo;</dt>
  859. <dd><p>Constant representing AV_NOPTS_VALUE.
  860. </p></dd>
  861. <dt>&lsquo;<samp class="samp">startpts</samp>&rsquo;</dt>
  862. <dd><p>First non-AV_NOPTS_VALUE PTS seen in the stream.
  863. </p></dd>
  864. <dt>&lsquo;<samp class="samp">startdts</samp>&rsquo;</dt>
  865. <dd><p>First non-AV_NOPTS_VALUE DTS seen in the stream.
  866. </p></dd>
  867. <dt>&lsquo;<samp class="samp">duration</samp>&rsquo;</dt>
  868. <dt>&lsquo;<samp class="samp">d</samp>&rsquo;</dt>
  869. <dd><p>Packet duration, in timebase units.
  870. </p></dd>
  871. <dt>&lsquo;<samp class="samp">pos</samp>&rsquo;</dt>
  872. <dd><p>Packet position in input; may be -1 when unknown or not set.
  873. </p></dd>
  874. <dt>&lsquo;<samp class="samp">size</samp>&rsquo;</dt>
  875. <dd><p>Packet size, in bytes.
  876. </p></dd>
  877. <dt>&lsquo;<samp class="samp">key</samp>&rsquo;</dt>
  878. <dd><p>Whether packet is marked as a keyframe.
  879. </p></dd>
  880. <dt>&lsquo;<samp class="samp">state</samp>&rsquo;</dt>
  881. <dd><p>A pseudo random integer, primarily derived from the content of packet payload.
  882. </p></dd>
  883. </dl>
  884. <a name="Examples"></a>
  885. <h4 class="subsection">2.24.1 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>
  886. <p>Apply modification to every byte but don&rsquo;t drop any packets.
  887. </p><div class="example">
  888. <pre class="example-preformatted">ffmpeg -i INPUT -c copy -bsf noise=1 output.mkv
  889. </pre></div>
  890. <p>Drop every video packet not marked as a keyframe after timestamp 30s but do not
  891. modify any of the remaining packets.
  892. </p><div class="example">
  893. <pre class="example-preformatted">ffmpeg -i INPUT -c copy -bsf:v noise=drop='gt(pts*tb\,30)*not(key)' output.mkv
  894. </pre></div>
  895. <p>Drop one second of audio every 10 seconds and add some random noise to the rest.
  896. </p><div class="example">
  897. <pre class="example-preformatted">ffmpeg -i INPUT -c copy -bsf:a noise=amount=-1:drop='between(mod(pts*tb\,10)\,9\,10)' output.mkv
  898. </pre></div>
  899. <a name="null"></a>
  900. <h3 class="section">2.25 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>
  901. <p>This bitstream filter passes the packets through unchanged.
  902. </p>
  903. <a name="pcm_005frechunk"></a>
  904. <h3 class="section">2.26 pcm_rechunk<span class="pull-right"><a class="anchor hidden-xs" href="#pcm_005frechunk" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pcm_005frechunk" aria-hidden="true">TOC</a></span></h3>
  905. <p>Repacketize PCM audio to a fixed number of samples per packet or a fixed packet
  906. rate per second. This is similar to the <a data-manual="ffmpeg-filters" href="ffmpeg-filters.html#asetnsamples">asetnsamples audio
  907. filter</a> but works on audio packets instead of audio frames.
  908. </p>
  909. <dl class="table">
  910. <dt><samp class="option">nb_out_samples, n</samp></dt>
  911. <dd><p>Set the number of samples per each output audio packet. The number is intended
  912. as the number of samples <em class="emph">per each channel</em>. Default value is 1024.
  913. </p>
  914. </dd>
  915. <dt><samp class="option">pad, p</samp></dt>
  916. <dd><p>If set to 1, the filter will pad the last audio packet with silence, so that it
  917. will contain the same number of samples (or roughly the same number of samples,
  918. see <samp class="option">frame_rate</samp>) as the previous ones. Default value is 1.
  919. </p>
  920. </dd>
  921. <dt><samp class="option">frame_rate, r</samp></dt>
  922. <dd><p>This option makes the filter output a fixed number of packets per second instead
  923. of a fixed number of samples per packet. If the audio sample rate is not
  924. divisible by the frame rate then the number of samples will not be constant but
  925. will vary slightly so that each packet will start as close to the frame
  926. boundary as possible. Using this option has precedence over <samp class="option">nb_out_samples</samp>.
  927. </p></dd>
  928. </dl>
  929. <p>You can generate the well known 1602-1601-1602-1601-1602 pattern of 48kHz audio
  930. for NTSC frame rate using the <samp class="option">frame_rate</samp> option.
  931. </p><div class="example">
  932. <pre class="example-preformatted">ffmpeg -f lavfi -i sine=r=48000:d=1 -c pcm_s16le -bsf pcm_rechunk=r=30000/1001 -f framecrc -
  933. </pre></div>
  934. <a name="pgs_005fframe_005fmerge"></a>
  935. <h3 class="section">2.27 pgs_frame_merge<span class="pull-right"><a class="anchor hidden-xs" href="#pgs_005fframe_005fmerge" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pgs_005fframe_005fmerge" aria-hidden="true">TOC</a></span></h3>
  936. <p>Merge a sequence of PGS Subtitle segments ending with an &quot;end of display set&quot;
  937. segment into a single packet.
  938. </p>
  939. <p>This is required by some containers that support PGS subtitles
  940. (muxer <code class="code">matroska</code>).
  941. </p>
  942. <a name="prores_005fmetadata"></a>
  943. <h3 class="section">2.28 prores_metadata<span class="pull-right"><a class="anchor hidden-xs" href="#prores_005fmetadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-prores_005fmetadata" aria-hidden="true">TOC</a></span></h3>
  944. <p>Modify color property metadata embedded in prores stream.
  945. </p>
  946. <dl class="table">
  947. <dt><samp class="option">color_primaries</samp></dt>
  948. <dd><p>Set the color primaries.
  949. Available values are:
  950. </p>
  951. <dl class="table">
  952. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  953. <dd><p>Keep the same color primaries property (default).
  954. </p>
  955. </dd>
  956. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  957. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  958. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  959. <dd><p>BT601 625
  960. </p>
  961. </dd>
  962. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  963. <dd><p>BT601 525
  964. </p>
  965. </dd>
  966. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  967. <dt>&lsquo;<samp class="samp">smpte431</samp>&rsquo;</dt>
  968. <dd><p>DCI P3
  969. </p>
  970. </dd>
  971. <dt>&lsquo;<samp class="samp">smpte432</samp>&rsquo;</dt>
  972. <dd><p>P3 D65
  973. </p>
  974. </dd>
  975. </dl>
  976. </dd>
  977. <dt><samp class="option">transfer_characteristics</samp></dt>
  978. <dd><p>Set the color transfer.
  979. Available values are:
  980. </p>
  981. <dl class="table">
  982. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  983. <dd><p>Keep the same transfer characteristics property (default).
  984. </p>
  985. </dd>
  986. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  987. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  988. <dd><p>BT 601, BT 709, BT 2020
  989. </p></dd>
  990. <dt>&lsquo;<samp class="samp">smpte2084</samp>&rsquo;</dt>
  991. <dd><p>SMPTE ST 2084
  992. </p></dd>
  993. <dt>&lsquo;<samp class="samp">arib-std-b67</samp>&rsquo;</dt>
  994. <dd><p>ARIB STD-B67
  995. </p></dd>
  996. </dl>
  997. </dd>
  998. <dt><samp class="option">matrix_coefficients</samp></dt>
  999. <dd><p>Set the matrix coefficient.
  1000. Available values are:
  1001. </p>
  1002. <dl class="table">
  1003. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  1004. <dd><p>Keep the same colorspace property (default).
  1005. </p>
  1006. </dd>
  1007. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  1008. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  1009. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  1010. <dd><p>BT 601
  1011. </p>
  1012. </dd>
  1013. <dt>&lsquo;<samp class="samp">bt2020nc</samp>&rsquo;</dt>
  1014. </dl>
  1015. </dd>
  1016. </dl>
  1017. <p>Set Rec709 colorspace for each frame of the file
  1018. </p><div class="example">
  1019. <pre class="example-preformatted">ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt709:color_trc=bt709:colorspace=bt709 output.mov
  1020. </pre></div>
  1021. <p>Set Hybrid Log-Gamma parameters for each frame of the file
  1022. </p><div class="example">
  1023. <pre class="example-preformatted">ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt2020:color_trc=arib-std-b67:colorspace=bt2020nc output.mov
  1024. </pre></div>
  1025. <a name="remove_005fextra"></a>
  1026. <h3 class="section">2.29 remove_extra<span class="pull-right"><a class="anchor hidden-xs" href="#remove_005fextra" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-remove_005fextra" aria-hidden="true">TOC</a></span></h3>
  1027. <p>Remove extradata from packets.
  1028. </p>
  1029. <p>It accepts the following parameter:
  1030. </p><dl class="table">
  1031. <dt><samp class="option">freq</samp></dt>
  1032. <dd><p>Set which frame types to remove extradata from.
  1033. </p>
  1034. <dl class="table">
  1035. <dt>&lsquo;<samp class="samp">k</samp>&rsquo;</dt>
  1036. <dd><p>Remove extradata from non-keyframes only.
  1037. </p>
  1038. </dd>
  1039. <dt>&lsquo;<samp class="samp">keyframe</samp>&rsquo;</dt>
  1040. <dd><p>Remove extradata from keyframes only.
  1041. </p>
  1042. </dd>
  1043. <dt>&lsquo;<samp class="samp">e, all</samp>&rsquo;</dt>
  1044. <dd><p>Remove extradata from all frames.
  1045. </p>
  1046. </dd>
  1047. </dl>
  1048. </dd>
  1049. </dl>
  1050. <a name="setts"></a>
  1051. <h3 class="section">2.30 setts<span class="pull-right"><a class="anchor hidden-xs" href="#setts" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-setts" aria-hidden="true">TOC</a></span></h3>
  1052. <p>Set PTS and DTS in packets.
  1053. </p>
  1054. <p>It accepts the following parameters:
  1055. </p><dl class="table">
  1056. <dt><samp class="option">ts</samp></dt>
  1057. <dt><samp class="option">pts</samp></dt>
  1058. <dt><samp class="option">dts</samp></dt>
  1059. <dd><p>Set expressions for PTS, DTS or both.
  1060. </p></dd>
  1061. <dt><samp class="option">duration</samp></dt>
  1062. <dd><p>Set expression for duration.
  1063. </p></dd>
  1064. <dt><samp class="option">time_base</samp></dt>
  1065. <dd><p>Set output time base.
  1066. </p></dd>
  1067. <dt><samp class="option">prescale</samp></dt>
  1068. <dd><p>Set whether to convert time fields to user-set output time base before evaluation of expressions. Defaults to 0.
  1069. </p></dd>
  1070. </dl>
  1071. <p>The expressions are evaluated through the eval API and can contain the following
  1072. constants:
  1073. </p>
  1074. <dl class="table">
  1075. <dt><samp class="option">N</samp></dt>
  1076. <dd><p>The count of the input packet. Starting from 0.
  1077. </p>
  1078. </dd>
  1079. <dt><samp class="option">TS</samp></dt>
  1080. <dd><p>The demux timestamp in input in case of <code class="code">ts</code> or <code class="code">dts</code> option or presentation
  1081. timestamp in case of <code class="code">pts</code> option.
  1082. </p>
  1083. </dd>
  1084. <dt><samp class="option">POS</samp></dt>
  1085. <dd><p>The original position in the file of the packet, or undefined if undefined
  1086. for the current packet
  1087. </p>
  1088. </dd>
  1089. <dt><samp class="option">DTS</samp></dt>
  1090. <dd><p>The demux timestamp in input.
  1091. </p>
  1092. </dd>
  1093. <dt><samp class="option">PTS</samp></dt>
  1094. <dd><p>The presentation timestamp in input.
  1095. </p>
  1096. </dd>
  1097. <dt><samp class="option">DURATION</samp></dt>
  1098. <dd><p>The duration in input.
  1099. </p>
  1100. </dd>
  1101. <dt><samp class="option">STARTDTS</samp></dt>
  1102. <dd><p>The DTS of the first packet.
  1103. </p>
  1104. </dd>
  1105. <dt><samp class="option">STARTPTS</samp></dt>
  1106. <dd><p>The PTS of the first packet.
  1107. </p>
  1108. </dd>
  1109. <dt><samp class="option">PREV_INDTS</samp></dt>
  1110. <dd><p>The previous input DTS.
  1111. </p>
  1112. </dd>
  1113. <dt><samp class="option">PREV_INPTS</samp></dt>
  1114. <dd><p>The previous input PTS.
  1115. </p>
  1116. </dd>
  1117. <dt><samp class="option">PREV_INDURATION</samp></dt>
  1118. <dd><p>The previous input duration.
  1119. </p>
  1120. </dd>
  1121. <dt><samp class="option">PREV_OUTDTS</samp></dt>
  1122. <dd><p>The previous output DTS.
  1123. </p>
  1124. </dd>
  1125. <dt><samp class="option">PREV_OUTPTS</samp></dt>
  1126. <dd><p>The previous output PTS.
  1127. </p>
  1128. </dd>
  1129. <dt><samp class="option">PREV_OUTDURATION</samp></dt>
  1130. <dd><p>The previous output duration.
  1131. </p>
  1132. </dd>
  1133. <dt><samp class="option">NEXT_DTS</samp></dt>
  1134. <dd><p>The next input DTS.
  1135. </p>
  1136. </dd>
  1137. <dt><samp class="option">NEXT_PTS</samp></dt>
  1138. <dd><p>The next input PTS.
  1139. </p>
  1140. </dd>
  1141. <dt><samp class="option">NEXT_DURATION</samp></dt>
  1142. <dd><p>The next input duration.
  1143. </p>
  1144. </dd>
  1145. <dt><samp class="option">TB</samp></dt>
  1146. <dd><p>The timebase in which time fields are denominated. The user-set output timebase if prescale is enabled, else the input timebase.
  1147. </p>
  1148. </dd>
  1149. <dt><samp class="option">TB_OUT</samp></dt>
  1150. <dd><p>The output timebase.
  1151. </p>
  1152. </dd>
  1153. <dt><samp class="option">SR</samp></dt>
  1154. <dd><p>The sample rate of stream packet belongs.
  1155. </p>
  1156. </dd>
  1157. <dt><samp class="option">NOPTS</samp></dt>
  1158. <dd><p>The AV_NOPTS_VALUE constant.
  1159. </p></dd>
  1160. </dl>
  1161. <p>For example, to set PTS equal to DTS (not recommended if B-frames are involved):
  1162. </p><div class="example">
  1163. <pre class="example-preformatted">ffmpeg -i INPUT -c:a copy -bsf:a setts=pts=DTS out.mkv
  1164. </pre></div>
  1165. <a name="showinfo"></a>
  1166. <h3 class="section">2.31 showinfo<span class="pull-right"><a class="anchor hidden-xs" href="#showinfo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showinfo" aria-hidden="true">TOC</a></span></h3>
  1167. <p>Log basic packet information. Mainly useful for testing, debugging,
  1168. and development.
  1169. </p>
  1170. <a name="smpte436m_005fto_005feia608"></a>
  1171. <h3 class="section">2.32 smpte436m_to_eia608<span class="pull-right"><a class="anchor hidden-xs" href="#smpte436m_005fto_005feia608" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-smpte436m_005fto_005feia608" aria-hidden="true">TOC</a></span></h3>
  1172. <p>Convert from a <code class="code">SMPTE_436M_ANC</code> data stream to a <code class="code">EIA_608</code> stream,
  1173. extracting the closed captions from CTA-708 CDP VANC packets, and ignoring all other data.
  1174. </p>
  1175. <a class="anchor" id="text2movsub"></a><a name="text2movsub-1"></a>
  1176. <h3 class="section">2.33 text2movsub<span class="pull-right"><a class="anchor hidden-xs" href="#text2movsub-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-text2movsub-1" aria-hidden="true">TOC</a></span></h3>
  1177. <p>Convert text subtitles to MOV subtitles (as used by the <code class="code">mov_text</code>
  1178. codec) with metadata headers.
  1179. </p>
  1180. <p>See also the <a class="ref" href="#mov2textsub">mov2textsub</a> filter.
  1181. </p>
  1182. <a name="trace_005fheaders"></a>
  1183. <h3 class="section">2.34 trace_headers<span class="pull-right"><a class="anchor hidden-xs" href="#trace_005fheaders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-trace_005fheaders" aria-hidden="true">TOC</a></span></h3>
  1184. <p>Log trace output containing all syntax elements in the coded stream
  1185. headers (everything above the level of individual coded blocks).
  1186. This can be useful for debugging low-level stream issues.
  1187. </p>
  1188. <p>Supports AV1, H.264, H.265, (M)JPEG, MPEG-2 and VP9, but depending
  1189. on the build only a subset of these may be available.
  1190. </p>
  1191. <a name="truehd_005fcore"></a>
  1192. <h3 class="section">2.35 truehd_core<span class="pull-right"><a class="anchor hidden-xs" href="#truehd_005fcore" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-truehd_005fcore" aria-hidden="true">TOC</a></span></h3>
  1193. <p>Extract the core from a TrueHD stream, dropping ATMOS data.
  1194. </p>
  1195. <a name="vp9_005fmetadata"></a>
  1196. <h3 class="section">2.36 vp9_metadata<span class="pull-right"><a class="anchor hidden-xs" href="#vp9_005fmetadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vp9_005fmetadata" aria-hidden="true">TOC</a></span></h3>
  1197. <p>Modify metadata embedded in a VP9 stream.
  1198. </p>
  1199. <dl class="table">
  1200. <dt><samp class="option">color_space</samp></dt>
  1201. <dd><p>Set the color space value in the frame header. Note that any frame
  1202. set to RGB will be implicitly set to PC range and that RGB is
  1203. incompatible with profiles 0 and 2.
  1204. </p><dl class="table">
  1205. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  1206. <dt>&lsquo;<samp class="samp">bt601</samp>&rsquo;</dt>
  1207. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  1208. <dt>&lsquo;<samp class="samp">smpte170</samp>&rsquo;</dt>
  1209. <dt>&lsquo;<samp class="samp">smpte240</samp>&rsquo;</dt>
  1210. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  1211. <dt>&lsquo;<samp class="samp">rgb</samp>&rsquo;</dt>
  1212. </dl>
  1213. </dd>
  1214. <dt><samp class="option">color_range</samp></dt>
  1215. <dd><p>Set the color range value in the frame header. Note that any value
  1216. imposed by the color space will take precedence over this value.
  1217. </p><dl class="table">
  1218. <dt>&lsquo;<samp class="samp">tv</samp>&rsquo;</dt>
  1219. <dt>&lsquo;<samp class="samp">pc</samp>&rsquo;</dt>
  1220. </dl>
  1221. </dd>
  1222. </dl>
  1223. <a name="vp9_005fsuperframe"></a>
  1224. <h3 class="section">2.37 vp9_superframe<span class="pull-right"><a class="anchor hidden-xs" href="#vp9_005fsuperframe" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vp9_005fsuperframe" aria-hidden="true">TOC</a></span></h3>
  1225. <p>Merge VP9 invisible (alt-ref) frames back into VP9 superframes. This
  1226. fixes merging of split/segmented VP9 streams where the alt-ref frame
  1227. was split from its visible counterpart.
  1228. </p>
  1229. <a name="vp9_005fsuperframe_005fsplit"></a>
  1230. <h3 class="section">2.38 vp9_superframe_split<span class="pull-right"><a class="anchor hidden-xs" href="#vp9_005fsuperframe_005fsplit" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vp9_005fsuperframe_005fsplit" aria-hidden="true">TOC</a></span></h3>
  1231. <p>Split VP9 superframes into single frames.
  1232. </p>
  1233. <a name="vp9_005fraw_005freorder"></a>
  1234. <h3 class="section">2.39 vp9_raw_reorder<span class="pull-right"><a class="anchor hidden-xs" href="#vp9_005fraw_005freorder" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vp9_005fraw_005freorder" aria-hidden="true">TOC</a></span></h3>
  1235. <p>Given a VP9 stream with correct timestamps but possibly out of order,
  1236. insert additional show-existing-frame packets to correct the ordering.
  1237. </p>
  1238. <a name="See-Also"></a>
  1239. <h2 class="chapter">3 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>
  1240. <p><a class="url" href="ffmpeg.html">ffmpeg</a>, <a class="url" href="ffplay.html">ffplay</a>, <a class="url" href="ffprobe.html">ffprobe</a>,
  1241. <a class="url" href="libavcodec.html">libavcodec</a>
  1242. </p>
  1243. <a name="Authors"></a>
  1244. <h2 class="chapter">4 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>
  1245. <p>The FFmpeg developers.
  1246. </p>
  1247. <p>For details about the authorship, see the Git history of the project
  1248. (https://git.ffmpeg.org/ffmpeg), e.g. by typing the command
  1249. <code class="command">git log</code> in the FFmpeg source directory, or browsing the
  1250. online repository at <a class="url" href="https://git.ffmpeg.org/ffmpeg">https://git.ffmpeg.org/ffmpeg</a>.
  1251. </p>
  1252. <p>Maintainers for the specific components are listed in the file
  1253. <samp class="file">MAINTAINERS</samp> in the source code tree.
  1254. </p>
  1255. <p style="font-size: small;">
  1256. This document was generated using <a class="uref" href="https://www.gnu.org/software/texinfo/"><em class="emph">makeinfo</em></a>.
  1257. </p>
  1258. </div>
  1259. </body>
  1260. </html>