19-Bit Stream filter
All bitstream filters are supported by default compilation, and you can --list-bsfs
get a list of valid filters in the configuration script
can take advantage--disable-bsfs
Disables all bit-stream filters. To specify that individual filters are available, on this basis--enable-bsf=BSF
, or in the default (no specified--disable-bsfs
) To disable individual filters under--disable-bsf=BSF
Over hereBSF
is the individual filter name.
In the ff* toolset, -bsfs
you can list supported Bitstream filters (which are allowed for compilation).
In the Ff* toolset, -bsf
options can specify filters to be applied to each stream, with the filter name 1 = option Name 1 = option value 1/Option Name 2 = option value 2 ... ' Given, for example
ffmpeg -i INPUT -c:v copy -bsf:v filter1[=opt1=str1/opt2=str2][,filter2] OUTPUT
Here are some of the currently active Bitstream filters
AAC ADTSTOASC
Convert MPEG-2/4 's AAC ADTS to MPEG-4 Audio's dedicated configuration bitstream filter.
This filter creates a dedicated MPEG-4 audio configuration stream that removes Adts headers from the Adts head of MPEG-2/4
This is necessary, for example, when copying AAC audio content converted from raw Adts to a flv/mov/mp4 file, such processing is required
Chomp
Remove the additional 0 after each package
Dump extra
Add Extradata to the start of the filter pack
Additional parameters specify how to handle them, like the following possible values:
-
' a '
-
' K '
-
' E '
to each package
If it is not specifiedk
For example, the following ffmpeg enforces the global header (disabling the separate header) in encoding h., adding global headers to add as Extradata to remediate each packet
ffmpeg -i INPUT -map 0 -flags:v +global_header -c:v libx264 -bsf:v dump_extra out.ts
H264_mp4toannexb
Convert h. Encode bitstream, from long preamble mode to start code preamble (defined in Appendix B of ITU-T H. c)
It is required for some stream formats, typically such as the MPEG-2 Transport stream format ("Mpegts")
For example, using FFmpeg to re-mash a h. MP4 file, change the flow to mpegts
format, you can use:
ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
Imxdump
Fixed to editable bit stream mov format for final Cut Pro decoding. This filter is for Mpeg2video encoding only, and for the following versions of final Cut Pro 7, use the -tag:v
option
For example, re-30mb/sec the NTSC IMX to MOV:
ffmpeg -i input.mxf -c copy -bsf:v imxdump -tag:v mx3n output.mov
Mjpeg2jpeg
Convert MJPEG/AVI1 package to full JPEG/JFIF package
MJPEG is a video encoding, which is basically a JPEG image per frame, which can be extracted directly without any damage, such as:
ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
Unfortunately, these blocks are incomplete JPEG images because they lack the DHT segments required for decoding.
Http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml:
avery Lee, writing in the Rec.video.desktop newsgroup in 2001, commented ' MJPEG, or at least ' MJPEG in AVIs havin G The MJPG FourCC, is restricted JPEG with a fixed–and *omitted*–huffman table. The JPEG must is YCbCr colorspace, it must be 4:2:2, and it must with basic Huffman encoding, not arithmetic or progressive . . . . You can indeed extract the MJPEG frames and decode them with a regular JPEG decoder, but you have to prepend the DHT Segme NT to them, or else the decoder won ' t has any idea how to decompress the data. The exact table necessary is given in the OPENDML spec. "
This bitstream filter can extend the repair mjpeg stream (carrying AVI1 header ID, but missing DHT segments) as a full JPEG image
ffmpeg -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpgexiftran -i -9 frame*.jpgffmpeg -i frame_%d.jpg -c:v copy rotated.avi
Mjpega dump Headermovsubmp3 Head decompression MPEG4 unpack Bframes
Unpack the B-frame of DivX package
DivX-style B-frames are invalid MPEG-4, and are used only for the fragmented solution of Windows systems, which use more space and can look at causing minor AV synchronization problems, requiring more CPU resources for decoding (unless playback takes some 2,0,2,0 frame grouping), If copying directly into a MP4 standard package or MPEG Ps/ts stream will cause a problem (MPEG-4 cannot decode correctly because it is not a valid MPEG-4 encoded data)
For example, fix an AVI file containing DivX-style B-frame data to the MPEG-4 stream, which can be used:
ffmpeg -i INPUT.avi -codec copy -bsf:v mpeg4_unpack_bframes OUTPUT.avi
Noise
Do not destroy the container, only the content package. Typically used to freeze or test error recovery/hiding
Parameters: A numeric string whose value is usually modified by the output, so values less than or equal to 0 are forbidden. Bytes below the update frequency are modified, and 1 indicates that each byte is modified.
ffmpeg -i INPUT -c copy -bsf noise[=1] output.mkv
Indicates that each byte has been modified.
Remove extra
FFmpeg document 19-bit stream filter