ffmpeg-bitstream-filters.html 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026
  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.7, http://www.gnu.org/software/texinfo/ -->
  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. <div align="center">
  19. </div>
  20. <a name="SEC_Top"></a>
  21. <span id="SEC_Contents"></span>
  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-Bitstream-Filters" href="#Bitstream-Filters">2 Bitstream Filters</a>
  27. <ul class="no-bullet">
  28. <li><a id="toc-aac_005fadtstoasc" href="#aac_005fadtstoasc">2.1 aac_adtstoasc</a></li>
  29. <li><a id="toc-av1_005fmetadata" href="#av1_005fmetadata">2.2 av1_metadata</a></li>
  30. <li><a id="toc-chomp" href="#chomp">2.3 chomp</a></li>
  31. <li><a id="toc-dca_005fcore" href="#dca_005fcore">2.4 dca_core</a></li>
  32. <li><a id="toc-dump_005fextra" href="#dump_005fextra">2.5 dump_extra</a></li>
  33. <li><a id="toc-eac3_005fcore" href="#eac3_005fcore">2.6 eac3_core</a></li>
  34. <li><a id="toc-extract_005fextradata" href="#extract_005fextradata">2.7 extract_extradata</a></li>
  35. <li><a id="toc-filter_005funits" href="#filter_005funits">2.8 filter_units</a></li>
  36. <li><a id="toc-hapqa_005fextract" href="#hapqa_005fextract">2.9 hapqa_extract</a></li>
  37. <li><a id="toc-h264_005fmetadata" href="#h264_005fmetadata">2.10 h264_metadata</a></li>
  38. <li><a id="toc-h264_005fmp4toannexb" href="#h264_005fmp4toannexb">2.11 h264_mp4toannexb</a></li>
  39. <li><a id="toc-h264_005fredundant_005fpps" href="#h264_005fredundant_005fpps">2.12 h264_redundant_pps</a></li>
  40. <li><a id="toc-hevc_005fmetadata" href="#hevc_005fmetadata">2.13 hevc_metadata</a></li>
  41. <li><a id="toc-hevc_005fmp4toannexb" href="#hevc_005fmp4toannexb">2.14 hevc_mp4toannexb</a></li>
  42. <li><a id="toc-imxdump" href="#imxdump">2.15 imxdump</a></li>
  43. <li><a id="toc-mjpeg2jpeg" href="#mjpeg2jpeg">2.16 mjpeg2jpeg</a></li>
  44. <li><a id="toc-mjpegadump" href="#mjpegadump">2.17 mjpegadump</a></li>
  45. <li><a id="toc-mov2textsub-1" href="#mov2textsub-1">2.18 mov2textsub</a></li>
  46. <li><a id="toc-mp3decomp" href="#mp3decomp">2.19 mp3decomp</a></li>
  47. <li><a id="toc-mpeg2_005fmetadata" href="#mpeg2_005fmetadata">2.20 mpeg2_metadata</a></li>
  48. <li><a id="toc-mpeg4_005funpack_005fbframes" href="#mpeg4_005funpack_005fbframes">2.21 mpeg4_unpack_bframes</a></li>
  49. <li><a id="toc-noise" href="#noise">2.22 noise</a></li>
  50. <li><a id="toc-null" href="#null">2.23 null</a></li>
  51. <li><a id="toc-pcm_005frechunk" href="#pcm_005frechunk">2.24 pcm_rechunk</a></li>
  52. <li><a id="toc-prores_005fmetadata" href="#prores_005fmetadata">2.25 prores_metadata</a></li>
  53. <li><a id="toc-remove_005fextra" href="#remove_005fextra">2.26 remove_extra</a></li>
  54. <li><a id="toc-setts" href="#setts">2.27 setts</a></li>
  55. <li><a id="toc-text2movsub-1" href="#text2movsub-1">2.28 text2movsub</a></li>
  56. <li><a id="toc-trace_005fheaders" href="#trace_005fheaders">2.29 trace_headers</a></li>
  57. <li><a id="toc-truehd_005fcore" href="#truehd_005fcore">2.30 truehd_core</a></li>
  58. <li><a id="toc-vp9_005fmetadata" href="#vp9_005fmetadata">2.31 vp9_metadata</a></li>
  59. <li><a id="toc-vp9_005fsuperframe" href="#vp9_005fsuperframe">2.32 vp9_superframe</a></li>
  60. <li><a id="toc-vp9_005fsuperframe_005fsplit" href="#vp9_005fsuperframe_005fsplit">2.33 vp9_superframe_split</a></li>
  61. <li><a id="toc-vp9_005fraw_005freorder" href="#vp9_005fraw_005freorder">2.34 vp9_raw_reorder</a></li>
  62. </ul></li>
  63. <li><a id="toc-See-Also" href="#See-Also">3 See Also</a></li>
  64. <li><a id="toc-Authors" href="#Authors">4 Authors</a></li>
  65. </ul>
  66. </div>
  67. <a name="Description"></a>
  68. <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>
  69. <p>This document describes the bitstream filters provided by the
  70. libavcodec library.
  71. </p>
  72. <p>A bitstream filter operates on the encoded stream data, and performs
  73. bitstream level modifications without performing decoding.
  74. </p>
  75. <a name="Bitstream-Filters"></a>
  76. <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>
  77. <p>When you configure your FFmpeg build, all the supported bitstream
  78. filters are enabled by default. You can list all available ones using
  79. the configure option <code>--list-bsfs</code>.
  80. </p>
  81. <p>You can disable all the bitstream filters using the configure option
  82. <code>--disable-bsfs</code>, and selectively enable any bitstream filter using
  83. the option <code>--enable-bsf=BSF</code>, or you can disable a particular
  84. bitstream filter using the option <code>--disable-bsf=BSF</code>.
  85. </p>
  86. <p>The option <code>-bsfs</code> of the ff* tools will display the list of
  87. all the supported bitstream filters included in your build.
  88. </p>
  89. <p>The ff* tools have a -bsf option applied per stream, taking a
  90. comma-separated list of filters, whose parameters follow the filter
  91. name after a &rsquo;=&rsquo;.
  92. </p>
  93. <div class="example">
  94. <pre class="example">ffmpeg -i INPUT -c:v copy -bsf:v filter1[=opt1=str1:opt2=str2][,filter2] OUTPUT
  95. </pre></div>
  96. <p>Below is a description of the currently available bitstream filters,
  97. with their parameters, if any.
  98. </p>
  99. <a name="aac_005fadtstoasc"></a>
  100. <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>
  101. <p>Convert MPEG-2/4 AAC ADTS to an MPEG-4 Audio Specific Configuration
  102. bitstream.
  103. </p>
  104. <p>This filter creates an MPEG-4 AudioSpecificConfig from an MPEG-2/4
  105. ADTS header and removes the ADTS header.
  106. </p>
  107. <p>This filter is required for example when copying an AAC stream from a
  108. raw ADTS AAC or an MPEG-TS container to MP4A-LATM, to an FLV file, or
  109. to MOV/MP4 files and related formats such as 3GP or M4A. Please note
  110. that it is auto-inserted for MP4A-LATM and MOV/MP4 and related formats.
  111. </p>
  112. <a name="av1_005fmetadata"></a>
  113. <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>
  114. <p>Modify metadata embedded in an AV1 stream.
  115. </p>
  116. <dl compact="compact">
  117. <dt><samp>td</samp></dt>
  118. <dd><p>Insert or remove temporal delimiter OBUs in all temporal units of the
  119. stream.
  120. </p>
  121. <dl compact="compact">
  122. <dt>&lsquo;<samp>insert</samp>&rsquo;</dt>
  123. <dd><p>Insert a TD at the beginning of every TU which does not already have one.
  124. </p></dd>
  125. <dt>&lsquo;<samp>remove</samp>&rsquo;</dt>
  126. <dd><p>Remove the TD from the beginning of every TU which has one.
  127. </p></dd>
  128. </dl>
  129. </dd>
  130. <dt><samp>color_primaries</samp></dt>
  131. <dt><samp>transfer_characteristics</samp></dt>
  132. <dt><samp>matrix_coefficients</samp></dt>
  133. <dd><p>Set the color description fields in the stream (see AV1 section 6.4.2).
  134. </p>
  135. </dd>
  136. <dt><samp>color_range</samp></dt>
  137. <dd><p>Set the color range in the stream (see AV1 section 6.4.2; note that
  138. this cannot be set for streams using BT.709 primaries, sRGB transfer
  139. characteristic and identity (RGB) matrix coefficients).
  140. </p><dl compact="compact">
  141. <dt>&lsquo;<samp>tv</samp>&rsquo;</dt>
  142. <dd><p>Limited range.
  143. </p></dd>
  144. <dt>&lsquo;<samp>pc</samp>&rsquo;</dt>
  145. <dd><p>Full range.
  146. </p></dd>
  147. </dl>
  148. </dd>
  149. <dt><samp>chroma_sample_position</samp></dt>
  150. <dd><p>Set the chroma sample location in the stream (see AV1 section 6.4.2).
  151. This can only be set for 4:2:0 streams.
  152. </p>
  153. <dl compact="compact">
  154. <dt>&lsquo;<samp>vertical</samp>&rsquo;</dt>
  155. <dd><p>Left position (matching the default in MPEG-2 and H.264).
  156. </p></dd>
  157. <dt>&lsquo;<samp>colocated</samp>&rsquo;</dt>
  158. <dd><p>Top-left position.
  159. </p></dd>
  160. </dl>
  161. </dd>
  162. <dt><samp>tick_rate</samp></dt>
  163. <dd><p>Set the tick rate (<em>num_units_in_display_tick / time_scale</em>) in
  164. the timing info in the sequence header.
  165. </p></dd>
  166. <dt><samp>num_ticks_per_picture</samp></dt>
  167. <dd><p>Set the number of ticks in each picture, to indicate that the stream
  168. has a fixed framerate. Ignored if <samp>tick_rate</samp> is not also set.
  169. </p>
  170. </dd>
  171. <dt><samp>delete_padding</samp></dt>
  172. <dd><p>Deletes Padding OBUs.
  173. </p>
  174. </dd>
  175. </dl>
  176. <a name="chomp"></a>
  177. <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>
  178. <p>Remove zero padding at the end of a packet.
  179. </p>
  180. <a name="dca_005fcore"></a>
  181. <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>
  182. <p>Extract the core from a DCA/DTS stream, dropping extensions such as
  183. DTS-HD.
  184. </p>
  185. <a name="dump_005fextra"></a>
  186. <h3 class="section">2.5 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>
  187. <p>Add extradata to the beginning of the filtered packets except when
  188. said packets already exactly begin with the extradata that is intended
  189. to be added.
  190. </p>
  191. <dl compact="compact">
  192. <dt><samp>freq</samp></dt>
  193. <dd><p>The additional argument specifies which packets should be filtered.
  194. It accepts the values:
  195. </p><dl compact="compact">
  196. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  197. <dt>&lsquo;<samp>keyframe</samp>&rsquo;</dt>
  198. <dd><p>add extradata to all key packets
  199. </p>
  200. </dd>
  201. <dt>&lsquo;<samp>e</samp>&rsquo;</dt>
  202. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  203. <dd><p>add extradata to all packets
  204. </p></dd>
  205. </dl>
  206. </dd>
  207. </dl>
  208. <p>If not specified it is assumed &lsquo;<samp>k</samp>&rsquo;.
  209. </p>
  210. <p>For example the following <code>ffmpeg</code> command forces a global
  211. header (thus disabling individual packet headers) in the H.264 packets
  212. generated by the <code>libx264</code> encoder, but corrects them by adding
  213. the header stored in extradata to the key packets:
  214. </p><div class="example">
  215. <pre class="example">ffmpeg -i INPUT -map 0 -flags:v +global_header -c:v libx264 -bsf:v dump_extra out.ts
  216. </pre></div>
  217. <a name="eac3_005fcore"></a>
  218. <h3 class="section">2.6 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>
  219. <p>Extract the core from a E-AC-3 stream, dropping extra channels.
  220. </p>
  221. <a name="extract_005fextradata"></a>
  222. <h3 class="section">2.7 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>
  223. <p>Extract the in-band extradata.
  224. </p>
  225. <p>Certain codecs allow the long-term headers (e.g. MPEG-2 sequence headers,
  226. or H.264/HEVC (VPS/)SPS/PPS) to be transmitted either &quot;in-band&quot; (i.e. as a part
  227. of the bitstream containing the coded frames) or &quot;out of band&quot; (e.g. on the
  228. container level). This latter form is called &quot;extradata&quot; in FFmpeg terminology.
  229. </p>
  230. <p>This bitstream filter detects the in-band headers and makes them available as
  231. extradata.
  232. </p>
  233. <dl compact="compact">
  234. <dt><samp>remove</samp></dt>
  235. <dd><p>When this option is enabled, the long-term headers are removed from the
  236. bitstream after extraction.
  237. </p></dd>
  238. </dl>
  239. <a name="filter_005funits"></a>
  240. <h3 class="section">2.8 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>
  241. <p>Remove units with types in or not in a given set from the stream.
  242. </p>
  243. <dl compact="compact">
  244. <dt><samp>pass_types</samp></dt>
  245. <dd><p>List of unit types or ranges of unit types to pass through while removing
  246. all others. This is specified as a &rsquo;|&rsquo;-separated list of unit type values
  247. or ranges of values with &rsquo;-&rsquo;.
  248. </p>
  249. </dd>
  250. <dt><samp>remove_types</samp></dt>
  251. <dd><p>Identical to <samp>pass_types</samp>, except the units in the given set
  252. removed and all others passed through.
  253. </p></dd>
  254. </dl>
  255. <p>Extradata is unchanged by this transformation, but note that if the stream
  256. contains inline parameter sets then the output may be unusable if they are
  257. removed.
  258. </p>
  259. <p>For example, to remove all non-VCL NAL units from an H.264 stream:
  260. </p><div class="example">
  261. <pre class="example">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=pass_types=1-5' OUTPUT
  262. </pre></div>
  263. <p>To remove all AUDs, SEI and filler from an H.265 stream:
  264. </p><div class="example">
  265. <pre class="example">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=35|38-40' OUTPUT
  266. </pre></div>
  267. <a name="hapqa_005fextract"></a>
  268. <h3 class="section">2.9 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>
  269. <p>Extract Rgb or Alpha part of an HAPQA file, without recompression, in order to create an HAPQ or an HAPAlphaOnly file.
  270. </p>
  271. <dl compact="compact">
  272. <dt><samp>texture</samp></dt>
  273. <dd><p>Specifies the texture to keep.
  274. </p>
  275. <dl compact="compact">
  276. <dt><samp>color</samp></dt>
  277. <dt><samp>alpha</samp></dt>
  278. </dl>
  279. </dd>
  280. </dl>
  281. <p>Convert HAPQA to HAPQ
  282. </p><div class="example">
  283. <pre class="example">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
  284. </pre></div>
  285. <p>Convert HAPQA to HAPAlphaOnly
  286. </p><div class="example">
  287. <pre class="example">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
  288. </pre></div>
  289. <a name="h264_005fmetadata"></a>
  290. <h3 class="section">2.10 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>
  291. <p>Modify metadata embedded in an H.264 stream.
  292. </p>
  293. <dl compact="compact">
  294. <dt><samp>aud</samp></dt>
  295. <dd><p>Insert or remove AUD NAL units in all access units of the stream.
  296. </p>
  297. <dl compact="compact">
  298. <dt>&lsquo;<samp>insert</samp>&rsquo;</dt>
  299. <dt>&lsquo;<samp>remove</samp>&rsquo;</dt>
  300. </dl>
  301. </dd>
  302. <dt><samp>sample_aspect_ratio</samp></dt>
  303. <dd><p>Set the sample aspect ratio of the stream in the VUI parameters.
  304. </p>
  305. </dd>
  306. <dt><samp>overscan_appropriate_flag</samp></dt>
  307. <dd><p>Set whether the stream is suitable for display using overscan
  308. or not (see H.264 section E.2.1).
  309. </p>
  310. </dd>
  311. <dt><samp>video_format</samp></dt>
  312. <dt><samp>video_full_range_flag</samp></dt>
  313. <dd><p>Set the video format in the stream (see H.264 section E.2.1 and
  314. table E-2).
  315. </p>
  316. </dd>
  317. <dt><samp>colour_primaries</samp></dt>
  318. <dt><samp>transfer_characteristics</samp></dt>
  319. <dt><samp>matrix_coefficients</samp></dt>
  320. <dd><p>Set the colour description in the stream (see H.264 section E.2.1
  321. and tables E-3, E-4 and E-5).
  322. </p>
  323. </dd>
  324. <dt><samp>chroma_sample_loc_type</samp></dt>
  325. <dd><p>Set the chroma sample location in the stream (see H.264 section
  326. E.2.1 and figure E-1).
  327. </p>
  328. </dd>
  329. <dt><samp>tick_rate</samp></dt>
  330. <dd><p>Set the tick rate (num_units_in_tick / time_scale) in the VUI
  331. parameters. This is the smallest time unit representable in the
  332. stream, and in many cases represents the field rate of the stream
  333. (double the frame rate).
  334. </p></dd>
  335. <dt><samp>fixed_frame_rate_flag</samp></dt>
  336. <dd><p>Set whether the stream has fixed framerate - typically this indicates
  337. that the framerate is exactly half the tick rate, but the exact
  338. meaning is dependent on interlacing and the picture structure (see
  339. H.264 section E.2.1 and table E-6).
  340. </p>
  341. </dd>
  342. <dt><samp>crop_left</samp></dt>
  343. <dt><samp>crop_right</samp></dt>
  344. <dt><samp>crop_top</samp></dt>
  345. <dt><samp>crop_bottom</samp></dt>
  346. <dd><p>Set the frame cropping offsets in the SPS. These values will replace
  347. the current ones if the stream is already cropped.
  348. </p>
  349. <p>These fields are set in pixels. Note that some sizes may not be
  350. representable if the chroma is subsampled or the stream is interlaced
  351. (see H.264 section 7.4.2.1.1).
  352. </p>
  353. </dd>
  354. <dt><samp>sei_user_data</samp></dt>
  355. <dd><p>Insert a string as SEI unregistered user data. The argument must
  356. be of the form <em>UUID+string</em>, where the UUID is as hex digits
  357. possibly separated by hyphens, and the string can be anything.
  358. </p>
  359. <p>For example, &lsquo;<samp>086f3693-b7b3-4f2c-9653-21492feee5b8+hello</samp>&rsquo; will
  360. insert the string &ldquo;hello&rdquo; associated with the given UUID.
  361. </p>
  362. </dd>
  363. <dt><samp>delete_filler</samp></dt>
  364. <dd><p>Deletes both filler NAL units and filler SEI messages.
  365. </p>
  366. </dd>
  367. <dt><samp>level</samp></dt>
  368. <dd><p>Set the level in the SPS. Refer to H.264 section A.3 and tables A-1
  369. to A-5.
  370. </p>
  371. <p>The argument must be the name of a level (for example, &lsquo;<samp>4.2</samp>&rsquo;), a
  372. level_idc value (for example, &lsquo;<samp>42</samp>&rsquo;), or the special name &lsquo;<samp>auto</samp>&rsquo;
  373. indicating that the filter should attempt to guess the level from the
  374. input stream properties.
  375. </p>
  376. </dd>
  377. </dl>
  378. <a name="h264_005fmp4toannexb"></a>
  379. <h3 class="section">2.11 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>
  380. <p>Convert an H.264 bitstream from length prefixed mode to start code
  381. prefixed mode (as defined in the Annex B of the ITU-T H.264
  382. specification).
  383. </p>
  384. <p>This is required by some streaming formats, typically the MPEG-2
  385. transport stream format (muxer <code>mpegts</code>).
  386. </p>
  387. <p>For example to remux an MP4 file containing an H.264 stream to mpegts
  388. format with <code>ffmpeg</code>, you can use the command:
  389. </p>
  390. <div class="example">
  391. <pre class="example">ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
  392. </pre></div>
  393. <p>Please note that this filter is auto-inserted for MPEG-TS (muxer
  394. <code>mpegts</code>) and raw H.264 (muxer <code>h264</code>) output formats.
  395. </p>
  396. <a name="h264_005fredundant_005fpps"></a>
  397. <h3 class="section">2.12 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>
  398. <p>This applies a specific fixup to some Blu-ray streams which contain
  399. redundant PPSs modifying irrelevant parameters of the stream which
  400. confuse other transformations which require correct extradata.
  401. </p>
  402. <p>A new single global PPS is created, and all of the redundant PPSs
  403. within the stream are removed.
  404. </p>
  405. <a name="hevc_005fmetadata"></a>
  406. <h3 class="section">2.13 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>
  407. <p>Modify metadata embedded in an HEVC stream.
  408. </p>
  409. <dl compact="compact">
  410. <dt><samp>aud</samp></dt>
  411. <dd><p>Insert or remove AUD NAL units in all access units of the stream.
  412. </p>
  413. <dl compact="compact">
  414. <dt>&lsquo;<samp>insert</samp>&rsquo;</dt>
  415. <dt>&lsquo;<samp>remove</samp>&rsquo;</dt>
  416. </dl>
  417. </dd>
  418. <dt><samp>sample_aspect_ratio</samp></dt>
  419. <dd><p>Set the sample aspect ratio in the stream in the VUI parameters.
  420. </p>
  421. </dd>
  422. <dt><samp>video_format</samp></dt>
  423. <dt><samp>video_full_range_flag</samp></dt>
  424. <dd><p>Set the video format in the stream (see H.265 section E.3.1 and
  425. table E.2).
  426. </p>
  427. </dd>
  428. <dt><samp>colour_primaries</samp></dt>
  429. <dt><samp>transfer_characteristics</samp></dt>
  430. <dt><samp>matrix_coefficients</samp></dt>
  431. <dd><p>Set the colour description in the stream (see H.265 section E.3.1
  432. and tables E.3, E.4 and E.5).
  433. </p>
  434. </dd>
  435. <dt><samp>chroma_sample_loc_type</samp></dt>
  436. <dd><p>Set the chroma sample location in the stream (see H.265 section
  437. E.3.1 and figure E.1).
  438. </p>
  439. </dd>
  440. <dt><samp>tick_rate</samp></dt>
  441. <dd><p>Set the tick rate in the VPS and VUI parameters (num_units_in_tick /
  442. time_scale). Combined with <samp>num_ticks_poc_diff_one</samp>, this can
  443. set a constant framerate in the stream. Note that it is likely to be
  444. overridden by container parameters when the stream is in a container.
  445. </p>
  446. </dd>
  447. <dt><samp>num_ticks_poc_diff_one</samp></dt>
  448. <dd><p>Set poc_proportional_to_timing_flag in VPS and VUI and use this value
  449. to set num_ticks_poc_diff_one_minus1 (see H.265 sections 7.4.3.1 and
  450. E.3.1). Ignored if <samp>tick_rate</samp> is not also set.
  451. </p>
  452. </dd>
  453. <dt><samp>crop_left</samp></dt>
  454. <dt><samp>crop_right</samp></dt>
  455. <dt><samp>crop_top</samp></dt>
  456. <dt><samp>crop_bottom</samp></dt>
  457. <dd><p>Set the conformance window cropping offsets in the SPS. These values
  458. will replace the current ones if the stream is already cropped.
  459. </p>
  460. <p>These fields are set in pixels. Note that some sizes may not be
  461. representable if the chroma is subsampled (H.265 section 7.4.3.2.1).
  462. </p>
  463. </dd>
  464. <dt><samp>level</samp></dt>
  465. <dd><p>Set the level in the VPS and SPS. See H.265 section A.4 and tables
  466. A.6 and A.7.
  467. </p>
  468. <p>The argument must be the name of a level (for example, &lsquo;<samp>5.1</samp>&rsquo;), a
  469. <em>general_level_idc</em> value (for example, &lsquo;<samp>153</samp>&rsquo; for level 5.1),
  470. or the special name &lsquo;<samp>auto</samp>&rsquo; indicating that the filter should
  471. attempt to guess the level from the input stream properties.
  472. </p>
  473. </dd>
  474. </dl>
  475. <a name="hevc_005fmp4toannexb"></a>
  476. <h3 class="section">2.14 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>
  477. <p>Convert an HEVC/H.265 bitstream from length prefixed mode to start code
  478. prefixed mode (as defined in the Annex B of the ITU-T H.265
  479. specification).
  480. </p>
  481. <p>This is required by some streaming formats, typically the MPEG-2
  482. transport stream format (muxer <code>mpegts</code>).
  483. </p>
  484. <p>For example to remux an MP4 file containing an HEVC stream to mpegts
  485. format with <code>ffmpeg</code>, you can use the command:
  486. </p>
  487. <div class="example">
  488. <pre class="example">ffmpeg -i INPUT.mp4 -codec copy -bsf:v hevc_mp4toannexb OUTPUT.ts
  489. </pre></div>
  490. <p>Please note that this filter is auto-inserted for MPEG-TS (muxer
  491. <code>mpegts</code>) and raw HEVC/H.265 (muxer <code>h265</code> or
  492. <code>hevc</code>) output formats.
  493. </p>
  494. <a name="imxdump"></a>
  495. <h3 class="section">2.15 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>
  496. <p>Modifies the bitstream to fit in MOV and to be usable by the Final Cut
  497. Pro decoder. This filter only applies to the mpeg2video codec, and is
  498. likely not needed for Final Cut Pro 7 and newer with the appropriate
  499. <samp>-tag:v</samp>.
  500. </p>
  501. <p>For example, to remux 30 MB/sec NTSC IMX to MOV:
  502. </p>
  503. <div class="example">
  504. <pre class="example">ffmpeg -i input.mxf -c copy -bsf:v imxdump -tag:v mx3n output.mov
  505. </pre></div>
  506. <a name="mjpeg2jpeg"></a>
  507. <h3 class="section">2.16 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>
  508. <p>Convert MJPEG/AVI1 packets to full JPEG/JFIF packets.
  509. </p>
  510. <p>MJPEG is a video codec wherein each video frame is essentially a
  511. JPEG image. The individual frames can be extracted without loss,
  512. e.g. by
  513. </p>
  514. <div class="example">
  515. <pre class="example">ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
  516. </pre></div>
  517. <p>Unfortunately, these chunks are incomplete JPEG images, because
  518. they lack the DHT segment required for decoding. Quoting from
  519. <a href="http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml">http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml</a>:
  520. </p>
  521. <p>Avery Lee, writing in the rec.video.desktop newsgroup in 2001,
  522. commented that &quot;MJPEG, or at least the MJPEG in AVIs having the
  523. MJPG fourcc, is restricted JPEG with a fixed &ndash; and *omitted* &ndash;
  524. Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2,
  525. and it must use basic Huffman encoding, not arithmetic or
  526. progressive. . . . You can indeed extract the MJPEG frames and
  527. decode them with a regular JPEG decoder, but you have to prepend
  528. the DHT segment to them, or else the decoder won&rsquo;t have any idea
  529. how to decompress the data. The exact table necessary is given in
  530. the OpenDML spec.&quot;
  531. </p>
  532. <p>This bitstream filter patches the header of frames extracted from an MJPEG
  533. stream (carrying the AVI1 header ID and lacking a DHT segment) to
  534. produce fully qualified JPEG images.
  535. </p>
  536. <div class="example">
  537. <pre class="example">ffmpeg -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpg
  538. exiftran -i -9 frame*.jpg
  539. ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
  540. </pre></div>
  541. <a name="mjpegadump"></a>
  542. <h3 class="section">2.17 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>
  543. <p>Add an MJPEG A header to the bitstream, to enable decoding by
  544. Quicktime.
  545. </p>
  546. <span id="mov2textsub"></span><a name="mov2textsub-1"></a>
  547. <h3 class="section">2.18 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>
  548. <p>Extract a representable text file from MOV subtitles, stripping the
  549. metadata header from each subtitle packet.
  550. </p>
  551. <p>See also the <a href="#text2movsub">text2movsub</a> filter.
  552. </p>
  553. <a name="mp3decomp"></a>
  554. <h3 class="section">2.19 mp3decomp<span class="pull-right"><a class="anchor hidden-xs" href="#mp3decomp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mp3decomp" aria-hidden="true">TOC</a></span></h3>
  555. <p>Decompress non-standard compressed MP3 audio headers.
  556. </p>
  557. <a name="mpeg2_005fmetadata"></a>
  558. <h3 class="section">2.20 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>
  559. <p>Modify metadata embedded in an MPEG-2 stream.
  560. </p>
  561. <dl compact="compact">
  562. <dt><samp>display_aspect_ratio</samp></dt>
  563. <dd><p>Set the display aspect ratio in the stream.
  564. </p>
  565. <p>The following fixed values are supported:
  566. </p><dl compact="compact">
  567. <dt><samp>4/3</samp></dt>
  568. <dt><samp>16/9</samp></dt>
  569. <dt><samp>221/100</samp></dt>
  570. </dl>
  571. <p>Any other value will result in square pixels being signalled instead
  572. (see H.262 section 6.3.3 and table 6-3).
  573. </p>
  574. </dd>
  575. <dt><samp>frame_rate</samp></dt>
  576. <dd><p>Set the frame rate in the stream. This is constructed from a table
  577. of known values combined with a small multiplier and divisor - if
  578. the supplied value is not exactly representable, the nearest
  579. representable value will be used instead (see H.262 section 6.3.3
  580. and table 6-4).
  581. </p>
  582. </dd>
  583. <dt><samp>video_format</samp></dt>
  584. <dd><p>Set the video format in the stream (see H.262 section 6.3.6 and
  585. table 6-6).
  586. </p>
  587. </dd>
  588. <dt><samp>colour_primaries</samp></dt>
  589. <dt><samp>transfer_characteristics</samp></dt>
  590. <dt><samp>matrix_coefficients</samp></dt>
  591. <dd><p>Set the colour description in the stream (see H.262 section 6.3.6
  592. and tables 6-7, 6-8 and 6-9).
  593. </p>
  594. </dd>
  595. </dl>
  596. <a name="mpeg4_005funpack_005fbframes"></a>
  597. <h3 class="section">2.21 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>
  598. <p>Unpack DivX-style packed B-frames.
  599. </p>
  600. <p>DivX-style packed B-frames are not valid MPEG-4 and were only a
  601. workaround for the broken Video for Windows subsystem.
  602. They use more space, can cause minor AV sync issues, require more
  603. CPU power to decode (unless the player has some decoded picture queue
  604. to compensate the 2,0,2,0 frame per packet style) and cause
  605. trouble if copied into a standard container like mp4 or mpeg-ps/ts,
  606. because MPEG-4 decoders may not be able to decode them, since they are
  607. not valid MPEG-4.
  608. </p>
  609. <p>For example to fix an AVI file containing an MPEG-4 stream with
  610. DivX-style packed B-frames using <code>ffmpeg</code>, you can use the command:
  611. </p>
  612. <div class="example">
  613. <pre class="example">ffmpeg -i INPUT.avi -codec copy -bsf:v mpeg4_unpack_bframes OUTPUT.avi
  614. </pre></div>
  615. <a name="noise"></a>
  616. <h3 class="section">2.22 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>
  617. <p>Damages the contents of packets or simply drops them without damaging the
  618. container. Can be used for fuzzing or testing error resilience/concealment.
  619. </p>
  620. <p>Parameters:
  621. </p><dl compact="compact">
  622. <dt><samp>amount</samp></dt>
  623. <dd><p>A numeral string, whose value is related to how often output bytes will
  624. be modified. Therefore, values below or equal to 0 are forbidden, and
  625. the lower the more frequent bytes will be modified, with 1 meaning
  626. every byte is modified.
  627. </p></dd>
  628. <dt><samp>dropamount</samp></dt>
  629. <dd><p>A numeral string, whose value is related to how often packets will be dropped.
  630. Therefore, values below or equal to 0 are forbidden, and the lower the more
  631. frequent packets will be dropped, with 1 meaning every packet is dropped.
  632. </p></dd>
  633. </dl>
  634. <p>The following example applies the modification to every byte but does not drop
  635. any packets.
  636. </p><div class="example">
  637. <pre class="example">ffmpeg -i INPUT -c copy -bsf noise[=1] output.mkv
  638. </pre></div>
  639. <a name="null"></a>
  640. <h3 class="section">2.23 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>
  641. <p>This bitstream filter passes the packets through unchanged.
  642. </p>
  643. <a name="pcm_005frechunk"></a>
  644. <h3 class="section">2.24 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>
  645. <p>Repacketize PCM audio to a fixed number of samples per packet or a fixed packet
  646. rate per second. This is similar to the <a href="ffmpeg-filters.html#asetnsamples">(ffmpeg-filters)asetnsamples audio
  647. filter</a> but works on audio packets instead of audio frames.
  648. </p>
  649. <dl compact="compact">
  650. <dt><samp>nb_out_samples, n</samp></dt>
  651. <dd><p>Set the number of samples per each output audio packet. The number is intended
  652. as the number of samples <em>per each channel</em>. Default value is 1024.
  653. </p>
  654. </dd>
  655. <dt><samp>pad, p</samp></dt>
  656. <dd><p>If set to 1, the filter will pad the last audio packet with silence, so that it
  657. will contain the same number of samples (or roughly the same number of samples,
  658. see <samp>frame_rate</samp>) as the previous ones. Default value is 1.
  659. </p>
  660. </dd>
  661. <dt><samp>frame_rate, r</samp></dt>
  662. <dd><p>This option makes the filter output a fixed number of packets per second instead
  663. of a fixed number of samples per packet. If the audio sample rate is not
  664. divisible by the frame rate then the number of samples will not be constant but
  665. will vary slightly so that each packet will start as close to the frame
  666. boundary as possible. Using this option has precedence over <samp>nb_out_samples</samp>.
  667. </p></dd>
  668. </dl>
  669. <p>You can generate the well known 1602-1601-1602-1601-1602 pattern of 48kHz audio
  670. for NTSC frame rate using the <samp>frame_rate</samp> option.
  671. </p><div class="example">
  672. <pre class="example">ffmpeg -f lavfi -i sine=r=48000:d=1 -c pcm_s16le -bsf pcm_rechunk=r=30000/1001 -f framecrc -
  673. </pre></div>
  674. <a name="prores_005fmetadata"></a>
  675. <h3 class="section">2.25 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>
  676. <p>Modify color property metadata embedded in prores stream.
  677. </p>
  678. <dl compact="compact">
  679. <dt><samp>color_primaries</samp></dt>
  680. <dd><p>Set the color primaries.
  681. Available values are:
  682. </p>
  683. <dl compact="compact">
  684. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  685. <dd><p>Keep the same color primaries property (default).
  686. </p>
  687. </dd>
  688. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  689. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  690. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  691. <dd><p>BT601 625
  692. </p>
  693. </dd>
  694. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  695. <dd><p>BT601 525
  696. </p>
  697. </dd>
  698. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  699. <dt>&lsquo;<samp>smpte431</samp>&rsquo;</dt>
  700. <dd><p>DCI P3
  701. </p>
  702. </dd>
  703. <dt>&lsquo;<samp>smpte432</samp>&rsquo;</dt>
  704. <dd><p>P3 D65
  705. </p>
  706. </dd>
  707. </dl>
  708. </dd>
  709. <dt><samp>transfer_characteristics</samp></dt>
  710. <dd><p>Set the color transfer.
  711. Available values are:
  712. </p>
  713. <dl compact="compact">
  714. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  715. <dd><p>Keep the same transfer characteristics property (default).
  716. </p>
  717. </dd>
  718. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  719. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  720. <dd><p>BT 601, BT 709, BT 2020
  721. </p></dd>
  722. <dt>&lsquo;<samp>smpte2084</samp>&rsquo;</dt>
  723. <dd><p>SMPTE ST 2084
  724. </p></dd>
  725. <dt>&lsquo;<samp>arib-std-b67</samp>&rsquo;</dt>
  726. <dd><p>ARIB STD-B67
  727. </p></dd>
  728. </dl>
  729. </dd>
  730. <dt><samp>matrix_coefficients</samp></dt>
  731. <dd><p>Set the matrix coefficient.
  732. Available values are:
  733. </p>
  734. <dl compact="compact">
  735. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  736. <dd><p>Keep the same colorspace property (default).
  737. </p>
  738. </dd>
  739. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  740. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  741. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  742. <dd><p>BT 601
  743. </p>
  744. </dd>
  745. <dt>&lsquo;<samp>bt2020nc</samp>&rsquo;</dt>
  746. </dl>
  747. </dd>
  748. </dl>
  749. <p>Set Rec709 colorspace for each frame of the file
  750. </p><div class="example">
  751. <pre class="example">ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt709:color_trc=bt709:colorspace=bt709 output.mov
  752. </pre></div>
  753. <p>Set Hybrid Log-Gamma parameters for each frame of the file
  754. </p><div class="example">
  755. <pre class="example">ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt2020:color_trc=arib-std-b67:colorspace=bt2020nc output.mov
  756. </pre></div>
  757. <a name="remove_005fextra"></a>
  758. <h3 class="section">2.26 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>
  759. <p>Remove extradata from packets.
  760. </p>
  761. <p>It accepts the following parameter:
  762. </p><dl compact="compact">
  763. <dt><samp>freq</samp></dt>
  764. <dd><p>Set which frame types to remove extradata from.
  765. </p>
  766. <dl compact="compact">
  767. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  768. <dd><p>Remove extradata from non-keyframes only.
  769. </p>
  770. </dd>
  771. <dt>&lsquo;<samp>keyframe</samp>&rsquo;</dt>
  772. <dd><p>Remove extradata from keyframes only.
  773. </p>
  774. </dd>
  775. <dt>&lsquo;<samp>e, all</samp>&rsquo;</dt>
  776. <dd><p>Remove extradata from all frames.
  777. </p>
  778. </dd>
  779. </dl>
  780. </dd>
  781. </dl>
  782. <a name="setts"></a>
  783. <h3 class="section">2.27 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>
  784. <p>Set PTS and DTS in packets.
  785. </p>
  786. <p>It accepts the following parameters:
  787. </p><dl compact="compact">
  788. <dt><samp>ts</samp></dt>
  789. <dt><samp>pts</samp></dt>
  790. <dt><samp>dts</samp></dt>
  791. <dd><p>Set expressions for PTS, DTS or both.
  792. </p></dd>
  793. </dl>
  794. <p>The expressions are evaluated through the eval API and can contain the following
  795. constants:
  796. </p>
  797. <dl compact="compact">
  798. <dt><samp>N</samp></dt>
  799. <dd><p>The count of the input packet. Starting from 0.
  800. </p>
  801. </dd>
  802. <dt><samp>TS</samp></dt>
  803. <dd><p>The demux timestamp in input in case of <code>ts</code> or <code>dts</code> option or presentation
  804. timestamp in case of <code>pts</code> option.
  805. </p>
  806. </dd>
  807. <dt><samp>POS</samp></dt>
  808. <dd><p>The original position in the file of the packet, or undefined if undefined
  809. for the current packet
  810. </p>
  811. </dd>
  812. <dt><samp>DTS</samp></dt>
  813. <dd><p>The demux timestamp in input.
  814. </p>
  815. </dd>
  816. <dt><samp>PTS</samp></dt>
  817. <dd><p>The presentation timestamp in input.
  818. </p>
  819. </dd>
  820. <dt><samp>STARTDTS</samp></dt>
  821. <dd><p>The DTS of the first packet.
  822. </p>
  823. </dd>
  824. <dt><samp>STARTPTS</samp></dt>
  825. <dd><p>The PTS of the first packet.
  826. </p>
  827. </dd>
  828. <dt><samp>PREV_INDTS</samp></dt>
  829. <dd><p>The previous input DTS.
  830. </p>
  831. </dd>
  832. <dt><samp>PREV_INPTS</samp></dt>
  833. <dd><p>The previous input PTS.
  834. </p>
  835. </dd>
  836. <dt><samp>PREV_OUTDTS</samp></dt>
  837. <dd><p>The previous output DTS.
  838. </p>
  839. </dd>
  840. <dt><samp>PREV_OUTPTS</samp></dt>
  841. <dd><p>The previous output PTS.
  842. </p>
  843. </dd>
  844. <dt><samp>TB</samp></dt>
  845. <dd><p>The timebase of stream packet belongs.
  846. </p>
  847. </dd>
  848. <dt><samp>SR</samp></dt>
  849. <dd><p>The sample rate of stream packet belongs.
  850. </p></dd>
  851. </dl>
  852. <span id="text2movsub"></span><a name="text2movsub-1"></a>
  853. <h3 class="section">2.28 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>
  854. <p>Convert text subtitles to MOV subtitles (as used by the <code>mov_text</code>
  855. codec) with metadata headers.
  856. </p>
  857. <p>See also the <a href="#mov2textsub">mov2textsub</a> filter.
  858. </p>
  859. <a name="trace_005fheaders"></a>
  860. <h3 class="section">2.29 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>
  861. <p>Log trace output containing all syntax elements in the coded stream
  862. headers (everything above the level of individual coded blocks).
  863. This can be useful for debugging low-level stream issues.
  864. </p>
  865. <p>Supports AV1, H.264, H.265, (M)JPEG, MPEG-2 and VP9, but depending
  866. on the build only a subset of these may be available.
  867. </p>
  868. <a name="truehd_005fcore"></a>
  869. <h3 class="section">2.30 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>
  870. <p>Extract the core from a TrueHD stream, dropping ATMOS data.
  871. </p>
  872. <a name="vp9_005fmetadata"></a>
  873. <h3 class="section">2.31 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>
  874. <p>Modify metadata embedded in a VP9 stream.
  875. </p>
  876. <dl compact="compact">
  877. <dt><samp>color_space</samp></dt>
  878. <dd><p>Set the color space value in the frame header. Note that any frame
  879. set to RGB will be implicitly set to PC range and that RGB is
  880. incompatible with profiles 0 and 2.
  881. </p><dl compact="compact">
  882. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  883. <dt>&lsquo;<samp>bt601</samp>&rsquo;</dt>
  884. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  885. <dt>&lsquo;<samp>smpte170</samp>&rsquo;</dt>
  886. <dt>&lsquo;<samp>smpte240</samp>&rsquo;</dt>
  887. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  888. <dt>&lsquo;<samp>rgb</samp>&rsquo;</dt>
  889. </dl>
  890. </dd>
  891. <dt><samp>color_range</samp></dt>
  892. <dd><p>Set the color range value in the frame header. Note that any value
  893. imposed by the color space will take precedence over this value.
  894. </p><dl compact="compact">
  895. <dt>&lsquo;<samp>tv</samp>&rsquo;</dt>
  896. <dt>&lsquo;<samp>pc</samp>&rsquo;</dt>
  897. </dl>
  898. </dd>
  899. </dl>
  900. <a name="vp9_005fsuperframe"></a>
  901. <h3 class="section">2.32 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>
  902. <p>Merge VP9 invisible (alt-ref) frames back into VP9 superframes. This
  903. fixes merging of split/segmented VP9 streams where the alt-ref frame
  904. was split from its visible counterpart.
  905. </p>
  906. <a name="vp9_005fsuperframe_005fsplit"></a>
  907. <h3 class="section">2.33 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>
  908. <p>Split VP9 superframes into single frames.
  909. </p>
  910. <a name="vp9_005fraw_005freorder"></a>
  911. <h3 class="section">2.34 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>
  912. <p>Given a VP9 stream with correct timestamps but possibly out of order,
  913. insert additional show-existing-frame packets to correct the ordering.
  914. </p>
  915. <a name="See-Also"></a>
  916. <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>
  917. <p><a href="ffmpeg.html">ffmpeg</a>, <a href="ffplay.html">ffplay</a>, <a href="ffprobe.html">ffprobe</a>,
  918. <a href="libavcodec.html">libavcodec</a>
  919. </p>
  920. <a name="Authors"></a>
  921. <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>
  922. <p>The FFmpeg developers.
  923. </p>
  924. <p>For details about the authorship, see the Git history of the project
  925. (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
  926. <code>git log</code> in the FFmpeg source directory, or browsing the
  927. online repository at <a href="http://source.ffmpeg.org">http://source.ffmpeg.org</a>.
  928. </p>
  929. <p>Maintainers for the specific components are listed in the file
  930. <samp>MAINTAINERS</samp> in the source code tree.
  931. </p>
  932. <p style="font-size: small;">
  933. This document was generated using <a href="http://www.gnu.org/software/texinfo/"><em>makeinfo</em></a>.
  934. </p>
  935. </div>
  936. </body>
  937. </html>