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