{
    "mode": "man",
    "parameter": "ffmpeg-bitstream-filters",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/man/ffmpeg-bitstream-filters/json",
    "generated": "2026-06-15T18:52:56Z",
    "sections": {
        "NAME": {
            "content": "ffmpeg-bitstream-filters - FFmpeg bitstream filters\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This document describes the bitstream filters provided by the libavcodec library.\n\nA bitstream filter operates on the encoded stream data, and performs bitstream level\nmodifications without performing decoding.\n",
            "subsections": []
        },
        "BITSTREAM FILTERS": {
            "content": "When you configure your FFmpeg build, all the supported bitstream filters are enabled by\ndefault. You can list all available ones using the configure option \"--list-bsfs\".\n\nYou can disable all the bitstream filters using the configure option \"--disable-bsfs\", and\nselectively enable any bitstream filter using the option \"--enable-bsf=BSF\", or you can\ndisable a particular bitstream filter using the option \"--disable-bsf=BSF\".\n\nThe option \"-bsfs\" of the ff* tools will display the list of all the supported bitstream\nfilters included in your build.\n\nThe ff* tools have a -bsf option applied per stream, taking a comma-separated list of\nfilters, whose parameters follow the filter name after a '='.\n\nffmpeg -i INPUT -c:v copy -bsf:v filter1[=opt1=str1:opt2=str2][,filter2] OUTPUT\n\nBelow is a description of the currently available bitstream filters, with their parameters,\nif any.\n\naacadtstoasc\nConvert MPEG-2/4 AAC ADTS to an MPEG-4 Audio Specific Configuration bitstream.\n\nThis filter creates an MPEG-4 AudioSpecificConfig from an MPEG-2/4 ADTS header and removes\nthe ADTS header.\n\nThis filter is required for example when copying an AAC stream from a raw ADTS AAC or an\nMPEG-TS container to MP4A-LATM, to an FLV file, or to MOV/MP4 files and related formats such\nas 3GP or M4A. Please note that it is auto-inserted for MP4A-LATM and MOV/MP4 and related\nformats.\n\nav1metadata\nModify metadata embedded in an AV1 stream.\n\ntd  Insert or remove temporal delimiter OBUs in all temporal units of the stream.\n\ninsert\nInsert a TD at the beginning of every TU which does not already have one.\n\nremove\nRemove the TD from the beginning of every TU which has one.\n\ncolorprimaries\ntransfercharacteristics\nmatrixcoefficients\nSet the color description fields in the stream (see AV1 section 6.4.2).\n\ncolorrange\nSet the color range in the stream (see AV1 section 6.4.2; note that this cannot be set\nfor streams using BT.709 primaries, sRGB transfer characteristic and identity (RGB)\nmatrix coefficients).\n\ntv  Limited range.\n\npc  Full range.\n\nchromasampleposition\nSet the chroma sample location in the stream (see AV1 section 6.4.2).  This can only be\nset for 4:2:0 streams.\n\nvertical\nLeft position (matching the default in MPEG-2 and H.264).\n\ncolocated\nTop-left position.\n\ntickrate\nSet the tick rate (numunitsindisplaytick / timescale) in the timing info in the\nsequence header.\n\nnumticksperpicture\nSet the number of ticks in each picture, to indicate that the stream has a fixed\nframerate.  Ignored if tickrate is not also set.\n\ndeletepadding\nDeletes Padding OBUs.\n",
            "subsections": [
                {
                    "name": "chomp",
                    "content": "Remove zero padding at the end of a packet.\n\ndcacore\nExtract the core from a DCA/DTS stream, dropping extensions such as DTS-HD.\n\ndumpextra\nAdd extradata to the beginning of the filtered packets except when said packets already\nexactly begin with the extradata that is intended to be added.\n"
                },
                {
                    "name": "freq",
                    "content": "The additional argument specifies which packets should be filtered.  It accepts the\nvalues:\n\nk\nkeyframe\nadd extradata to all key packets\n\ne\nall add extradata to all packets\n\nIf not specified it is assumed k.\n\nFor example the following ffmpeg command forces a global header (thus disabling individual\npacket headers) in the H.264 packets generated by the \"libx264\" encoder, but corrects them by\nadding the header stored in extradata to the key packets:\n\nffmpeg -i INPUT -map 0 -flags:v +globalheader -c:v libx264 -bsf:v dumpextra out.ts\n\neac3core\nExtract the core from a E-AC-3 stream, dropping extra channels.\n\nextractextradata\nExtract the in-band extradata.\n\nCertain codecs allow the long-term headers (e.g. MPEG-2 sequence headers, or H.264/HEVC\n(VPS/)SPS/PPS) to be transmitted either \"in-band\" (i.e. as a part of the bitstream containing\nthe coded frames) or \"out of band\" (e.g. on the container level). This latter form is called\n\"extradata\" in FFmpeg terminology.\n\nThis bitstream filter detects the in-band headers and makes them available as extradata.\n"
                },
                {
                    "name": "remove",
                    "content": "When this option is enabled, the long-term headers are removed from the bitstream after\nextraction.\n\nfilterunits\nRemove units with types in or not in a given set from the stream.\n\npasstypes\nList of unit types or ranges of unit types to pass through while removing all others.\nThis is specified as a '|'-separated list of unit type values or ranges of values with\n'-'.\n\nremovetypes\nIdentical to passtypes, except the units in the given set removed and all others passed\nthrough.\n\nExtradata is unchanged by this transformation, but note that if the stream contains inline\nparameter sets then the output may be unusable if they are removed.\n\nFor example, to remove all non-VCL NAL units from an H.264 stream:\n\nffmpeg -i INPUT -c:v copy -bsf:v 'filterunits=passtypes=1-5' OUTPUT\n\nTo remove all AUDs, SEI and filler from an H.265 stream:\n\nffmpeg -i INPUT -c:v copy -bsf:v 'filterunits=removetypes=35|38-40' OUTPUT\n\nhapqaextract\nExtract Rgb or Alpha part of an HAPQA file, without recompression, in order to create an HAPQ\nor an HAPAlphaOnly file.\n"
                },
                {
                    "name": "texture",
                    "content": "Specifies the texture to keep.\n\ncolor\nalpha\n\nConvert HAPQA to HAPQ\n\nffmpeg -i hapqainputfile.mov -c copy -bsf:v hapqaextract=texture=color -tag:v HapY -metadata:s:v:0 encoder=\"HAPQ\" hapqfile.mov\n\nConvert HAPQA to HAPAlphaOnly\n\nffmpeg -i hapqainputfile.mov -c copy -bsf:v hapqaextract=texture=alpha -tag:v HapA -metadata:s:v:0 encoder=\"HAPAlpha Only\" hapalphaonlyfile.mov\n\nh264metadata\nModify metadata embedded in an H.264 stream.\n\naud Insert or remove AUD NAL units in all access units of the stream.\n\ninsert\nremove\nsampleaspectratio\nSet the sample aspect ratio of the stream in the VUI parameters.\n\noverscanappropriateflag\nSet whether the stream is suitable for display using overscan or not (see H.264 section\nE.2.1).\n\nvideoformat\nvideofullrangeflag\nSet the video format in the stream (see H.264 section E.2.1 and table E-2).\n\ncolourprimaries\ntransfercharacteristics\nmatrixcoefficients\nSet the colour description in the stream (see H.264 section E.2.1 and tables E-3, E-4 and\nE-5).\n\nchromasampleloctype\nSet the chroma sample location in the stream (see H.264 section E.2.1 and figure E-1).\n\ntickrate\nSet the tick rate (numunitsintick / timescale) in the VUI parameters.  This is the\nsmallest time unit representable in the stream, and in many cases represents the field\nrate of the stream (double the frame rate).\n\nfixedframerateflag\nSet whether the stream has fixed framerate - typically this indicates that the framerate\nis exactly half the tick rate, but the exact meaning is dependent on interlacing and the\npicture structure (see H.264 section E.2.1 and table E-6).\n\ncropleft\ncropright\ncroptop\ncropbottom\nSet the frame cropping offsets in the SPS.  These values will replace the current ones if\nthe stream is already cropped.\n\nThese fields are set in pixels.  Note that some sizes may not be representable if the\nchroma is subsampled or the stream is interlaced (see H.264 section 7.4.2.1.1).\n\nseiuserdata\nInsert a string as SEI unregistered user data.  The argument must be of the form\nUUID+string, where the UUID is as hex digits possibly separated by hyphens, and the\nstring can be anything.\n\nFor example, 086f3693-b7b3-4f2c-9653-21492feee5b8+hello will insert the string ``hello''\nassociated with the given UUID.\n\ndeletefiller\nDeletes both filler NAL units and filler SEI messages.\n"
                },
                {
                    "name": "level",
                    "content": "Set the level in the SPS.  Refer to H.264 section A.3 and tables A-1 to A-5.\n\nThe argument must be the name of a level (for example, 4.2), a levelidc value (for\nexample, 42), or the special name auto indicating that the filter should attempt to guess\nthe level from the input stream properties.\n\nh264mp4toannexb\nConvert an H.264 bitstream from length prefixed mode to start code prefixed mode (as defined\nin the Annex B of the ITU-T H.264 specification).\n\nThis is required by some streaming formats, typically the MPEG-2 transport stream format\n(muxer \"mpegts\").\n\nFor example to remux an MP4 file containing an H.264 stream to mpegts format with ffmpeg, you\ncan use the command:\n\nffmpeg -i INPUT.mp4 -codec copy -bsf:v h264mp4toannexb OUTPUT.ts\n\nPlease note that this filter is auto-inserted for MPEG-TS (muxer \"mpegts\") and raw H.264\n(muxer \"h264\") output formats.\n\nh264redundantpps\nThis applies a specific fixup to some Blu-ray streams which contain redundant PPSs modifying\nirrelevant parameters of the stream which confuse other transformations which require correct\nextradata.\n\nA new single global PPS is created, and all of the redundant PPSs within the stream are\nremoved.\n\nhevcmetadata\nModify metadata embedded in an HEVC stream.\n\naud Insert or remove AUD NAL units in all access units of the stream.\n\ninsert\nremove\nsampleaspectratio\nSet the sample aspect ratio in the stream in the VUI parameters.\n\nvideoformat\nvideofullrangeflag\nSet the video format in the stream (see H.265 section E.3.1 and table E.2).\n\ncolourprimaries\ntransfercharacteristics\nmatrixcoefficients\nSet the colour description in the stream (see H.265 section E.3.1 and tables E.3, E.4 and\nE.5).\n\nchromasampleloctype\nSet the chroma sample location in the stream (see H.265 section E.3.1 and figure E.1).\n\ntickrate\nSet the tick rate in the VPS and VUI parameters (numunitsintick / timescale).\nCombined with numtickspocdiffone, this can set a constant framerate in the stream.\nNote that it is likely to be overridden by container parameters when the stream is in a\ncontainer.\n\nnumtickspocdiffone\nSet pocproportionaltotimingflag in VPS and VUI and use this value to set\nnumtickspocdiffoneminus1 (see H.265 sections 7.4.3.1 and E.3.1).  Ignored if\ntickrate is not also set.\n\ncropleft\ncropright\ncroptop\ncropbottom\nSet the conformance window cropping offsets in the SPS.  These values will replace the\ncurrent ones if the stream is already cropped.\n\nThese fields are set in pixels.  Note that some sizes may not be representable if the\nchroma is subsampled (H.265 section 7.4.3.2.1).\n"
                },
                {
                    "name": "level",
                    "content": "Set the level in the VPS and SPS.  See H.265 section A.4 and tables A.6 and A.7.\n\nThe argument must be the name of a level (for example, 5.1), a generallevelidc value\n(for example, 153 for level 5.1), or the special name auto indicating that the filter\nshould attempt to guess the level from the input stream properties.\n\nhevcmp4toannexb\nConvert an HEVC/H.265 bitstream from length prefixed mode to start code prefixed mode (as\ndefined in the Annex B of the ITU-T H.265 specification).\n\nThis is required by some streaming formats, typically the MPEG-2 transport stream format\n(muxer \"mpegts\").\n\nFor example to remux an MP4 file containing an HEVC stream to mpegts format with ffmpeg, you\ncan use the command:\n\nffmpeg -i INPUT.mp4 -codec copy -bsf:v hevcmp4toannexb OUTPUT.ts\n\nPlease note that this filter is auto-inserted for MPEG-TS (muxer \"mpegts\") and raw HEVC/H.265\n(muxer \"h265\" or \"hevc\") output formats.\n"
                },
                {
                    "name": "imxdump",
                    "content": "Modifies the bitstream to fit in MOV and to be usable by the Final Cut Pro decoder. This\nfilter only applies to the mpeg2video codec, and is likely not needed for Final Cut Pro 7 and\nnewer with the appropriate -tag:v.\n\nFor example, to remux 30 MB/sec NTSC IMX to MOV:\n\nffmpeg -i input.mxf -c copy -bsf:v imxdump -tag:v mx3n output.mov\n"
                },
                {
                    "name": "mjpeg2jpeg",
                    "content": "Convert MJPEG/AVI1 packets to full JPEG/JFIF packets.\n\nMJPEG is a video codec wherein each video frame is essentially a JPEG image. The individual\nframes can be extracted without loss, e.g. by\n\nffmpeg -i ../somemjpeg.avi -c:v copy frames%d.jpg\n\nUnfortunately, these chunks are incomplete JPEG images, because they lack the DHT segment\nrequired for decoding. Quoting from\n<http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml>:\n\nAvery Lee, writing in the rec.video.desktop newsgroup in 2001, commented that \"MJPEG, or at\nleast the MJPEG in AVIs having the MJPG fourcc, is restricted JPEG with a fixed -- and\n*omitted* -- Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2, and it must\nuse basic Huffman encoding, not arithmetic or progressive. . . . You can indeed extract the\nMJPEG frames and decode them with a regular JPEG decoder, but you have to prepend the DHT\nsegment to them, or else the decoder won't have any idea how to decompress the data. The\nexact table necessary is given in the OpenDML spec.\"\n\nThis bitstream filter patches the header of frames extracted from an MJPEG stream (carrying\nthe AVI1 header ID and lacking a DHT segment) to produce fully qualified JPEG images.\n\nffmpeg -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame%d.jpg\nexiftran -i -9 frame*.jpg\nffmpeg -i frame%d.jpg -c:v copy rotated.avi\n"
                },
                {
                    "name": "mjpegadump",
                    "content": "Add an MJPEG A header to the bitstream, to enable decoding by Quicktime.\n"
                },
                {
                    "name": "mov2textsub",
                    "content": "Extract a representable text file from MOV subtitles, stripping the metadata header from each\nsubtitle packet.\n\nSee also the text2movsub filter.\n"
                },
                {
                    "name": "mp3decomp",
                    "content": "Decompress non-standard compressed MP3 audio headers.\n\nmpeg2metadata\nModify metadata embedded in an MPEG-2 stream.\n\ndisplayaspectratio\nSet the display aspect ratio in the stream.\n\nThe following fixed values are supported:\n\n4/3\n16/9\n221/100\n\nAny other value will result in square pixels being signalled instead (see H.262 section\n6.3.3 and table 6-3).\n\nframerate\nSet the frame rate in the stream.  This is constructed from a table of known values\ncombined with a small multiplier and divisor - if the supplied value is not exactly\nrepresentable, the nearest representable value will be used instead (see H.262 section\n6.3.3 and table 6-4).\n\nvideoformat\nSet the video format in the stream (see H.262 section 6.3.6 and table 6-6).\n\ncolourprimaries\ntransfercharacteristics\nmatrixcoefficients\nSet the colour description in the stream (see H.262 section 6.3.6 and tables 6-7, 6-8 and\n6-9).\n\nmpeg4unpackbframes\nUnpack DivX-style packed B-frames.\n\nDivX-style packed B-frames are not valid MPEG-4 and were only a workaround for the broken\nVideo for Windows subsystem.  They use more space, can cause minor AV sync issues, require\nmore CPU power to decode (unless the player has some decoded picture queue to compensate the\n2,0,2,0 frame per packet style) and cause trouble if copied into a standard container like\nmp4 or mpeg-ps/ts, because MPEG-4 decoders may not be able to decode them, since they are not\nvalid MPEG-4.\n\nFor example to fix an AVI file containing an MPEG-4 stream with DivX-style packed B-frames\nusing ffmpeg, you can use the command:\n\nffmpeg -i INPUT.avi -codec copy -bsf:v mpeg4unpackbframes OUTPUT.avi\n"
                },
                {
                    "name": "noise",
                    "content": "Damages the contents of packets or simply drops them without damaging the container. Can be\nused for fuzzing or testing error resilience/concealment.\n\nParameters:\n"
                },
                {
                    "name": "amount",
                    "content": "A numeral string, whose value is related to how often output bytes will be modified.\nTherefore, values below or equal to 0 are forbidden, and the lower the more frequent\nbytes will be modified, with 1 meaning every byte is modified.\n"
                },
                {
                    "name": "dropamount",
                    "content": "A numeral string, whose value is related to how often packets will be dropped.\nTherefore, values below or equal to 0 are forbidden, and the lower the more frequent\npackets will be dropped, with 1 meaning every packet is dropped.\n\nThe following example applies the modification to every byte but does not drop any packets.\n\nffmpeg -i INPUT -c copy -bsf noise[=1] output.mkv\n"
                },
                {
                    "name": "null",
                    "content": "This bitstream filter passes the packets through unchanged.\n\npcmrechunk\nRepacketize PCM audio to a fixed number of samples per packet or a fixed packet rate per\nsecond. This is similar to the asetnsamples audio filter but works on audio packets instead\nof audio frames.\n\nnboutsamples, n\nSet the number of samples per each output audio packet. The number is intended as the\nnumber of samples per each channel. Default value is 1024.\n"
                },
                {
                    "name": "pad, p",
                    "content": "If set to 1, the filter will pad the last audio packet with silence, so that it will\ncontain the same number of samples (or roughly the same number of samples, see\nframerate) as the previous ones. Default value is 1.\n\nframerate, r\nThis option makes the filter output a fixed number of packets per second instead of a\nfixed number of samples per packet. If the audio sample rate is not divisible by the\nframe rate then the number of samples will not be constant but will vary slightly so that\neach packet will start as close to the frame boundary as possible. Using this option has\nprecedence over nboutsamples.\n\nYou can generate the well known 1602-1601-1602-1601-1602 pattern of 48kHz audio for NTSC\nframe rate using the framerate option.\n\nffmpeg -f lavfi -i sine=r=48000:d=1 -c pcms16le -bsf pcmrechunk=r=30000/1001 -f framecrc -\n\nproresmetadata\nModify color property metadata embedded in prores stream.\n\ncolorprimaries\nSet the color primaries.  Available values are:\n\nauto\nKeep the same color primaries property (default).\n\nunknown\nbt709\nbt470bg\nBT601 625\n\nsmpte170m\nBT601 525\n\nbt2020\nsmpte431\nDCI P3\n\nsmpte432\nP3 D65\n\ntransfercharacteristics\nSet the color transfer.  Available values are:\n\nauto\nKeep the same transfer characteristics property (default).\n\nunknown\nbt709\nBT 601, BT 709, BT 2020\n\nsmpte2084\nSMPTE ST 2084\n\narib-std-b67\nARIB STD-B67\n\nmatrixcoefficients\nSet the matrix coefficient.  Available values are:\n\nauto\nKeep the same colorspace property (default).\n\nunknown\nbt709\nsmpte170m\nBT 601\n\nbt2020nc\n\nSet Rec709 colorspace for each frame of the file\n\nffmpeg -i INPUT -c copy -bsf:v proresmetadata=colorprimaries=bt709:colortrc=bt709:colorspace=bt709 output.mov\n\nSet Hybrid Log-Gamma parameters for each frame of the file\n\nffmpeg -i INPUT -c copy -bsf:v proresmetadata=colorprimaries=bt2020:colortrc=arib-std-b67:colorspace=bt2020nc output.mov\n\nremoveextra\nRemove extradata from packets.\n\nIt accepts the following parameter:\n"
                },
                {
                    "name": "freq",
                    "content": "Set which frame types to remove extradata from.\n\nk   Remove extradata from non-keyframes only.\n\nkeyframe\nRemove extradata from keyframes only.\n\ne, all\nRemove extradata from all frames.\n"
                },
                {
                    "name": "setts",
                    "content": "Set PTS and DTS in packets.\n\nIt accepts the following parameters:\n\nts"
                },
                {
                    "name": "pts",
                    "content": "dts Set expressions for PTS, DTS or both.\n\nThe expressions are evaluated through the eval API and can contain the following constants:\n\nN   The count of the input packet. Starting from 0.\n\nTS  The demux timestamp in input in case of \"ts\" or \"dts\" option or presentation timestamp in\ncase of \"pts\" option.\n\nPOS The original position in the file of the packet, or undefined if undefined for the\ncurrent packet\n\nDTS The demux timestamp in input.\n\nPTS The presentation timestamp in input.\n\nSTARTDTS\nThe DTS of the first packet.\n\nSTARTPTS\nThe PTS of the first packet.\n\nPREVINDTS\nThe previous input DTS.\n\nPREVINPTS\nThe previous input PTS.\n\nPREVOUTDTS\nThe previous output DTS.\n\nPREVOUTPTS\nThe previous output PTS.\n\nTB  The timebase of stream packet belongs.\n\nSR  The sample rate of stream packet belongs.\n"
                },
                {
                    "name": "text2movsub",
                    "content": "Convert text subtitles to MOV subtitles (as used by the \"movtext\" codec) with metadata\nheaders.\n\nSee also the mov2textsub filter.\n\ntraceheaders\nLog trace output containing all syntax elements in the coded stream headers (everything above\nthe level of individual coded blocks).  This can be useful for debugging low-level stream\nissues.\n\nSupports AV1, H.264, H.265, (M)JPEG, MPEG-2 and VP9, but depending on the build only a subset\nof these may be available.\n\ntruehdcore\nExtract the core from a TrueHD stream, dropping ATMOS data.\n\nvp9metadata\nModify metadata embedded in a VP9 stream.\n\ncolorspace\nSet the color space value in the frame header.  Note that any frame set to RGB will be\nimplicitly set to PC range and that RGB is incompatible with profiles 0 and 2.\n\nunknown\nbt601\nbt709\nsmpte170\nsmpte240\nbt2020\nrgb\ncolorrange\nSet the color range value in the frame header.  Note that any value imposed by the color\nspace will take precedence over this value.\n\ntv\npc\n\nvp9superframe\nMerge VP9 invisible (alt-ref) frames back into VP9 superframes. This fixes merging of\nsplit/segmented VP9 streams where the alt-ref frame was split from its visible counterpart.\n\nvp9superframesplit\nSplit VP9 superframes into single frames.\n\nvp9rawreorder\nGiven a VP9 stream with correct timestamps but possibly out of order, insert additional show-\nexisting-frame packets to correct the ordering.\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "ffmpeg(1), ffplay(1), ffprobe(1), libavcodec(3)\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "The FFmpeg developers.\n\nFor details about the authorship, see the Git history of the project\n(git://source.ffmpeg.org/ffmpeg), e.g. by typing the command git log in the FFmpeg source\ndirectory, or browsing the online repository at <http://source.ffmpeg.org>.\n\nMaintainers for the specific components are listed in the file MAINTAINERS in the source code\ntree.\n\n\n\nFFMPEG-BITSTREAM-FILTERS(1)",
            "subsections": []
        }
    },
    "summary": "ffmpeg-bitstream-filters - FFmpeg bitstream filters",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "ffmpeg",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ffmpeg/1/json"
        },
        {
            "name": "ffplay",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ffplay/1/json"
        },
        {
            "name": "ffprobe",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ffprobe/1/json"
        },
        {
            "name": "libavcodec",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/libavcodec/3/json"
        }
    ]
}