.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "FFMPEG-BITSTREAM-FILTERS 1" .TH FFMPEG-BITSTREAM-FILTERS 1 " " " " " " .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" ffmpeg\-bitstream\-filters \- FFmpeg bitstream filters .SH "DESCRIPTION" .IX Header "DESCRIPTION" This document describes the bitstream filters provided by the libavcodec library. .PP A bitstream filter operates on the encoded stream data, and performs bitstream level modifications without performing decoding. .SH "BITSTREAM FILTERS" .IX Header "BITSTREAM FILTERS" When you configure your FFmpeg build, all the supported bitstream filters are enabled by default. You can list all available ones using the configure option \f(CW\*(C`\-\-list\-bsfs\*(C'\fR. .PP You can disable all the bitstream filters using the configure option \&\f(CW\*(C`\-\-disable\-bsfs\*(C'\fR, and selectively enable any bitstream filter using the option \f(CW\*(C`\-\-enable\-bsf=BSF\*(C'\fR, or you can disable a particular bitstream filter using the option \f(CW\*(C`\-\-disable\-bsf=BSF\*(C'\fR. .PP The option \f(CW\*(C`\-bsfs\*(C'\fR of the ff* tools will display the list of all the supported bitstream filters included in your build. .PP The ff* tools have a \-bsf option applied per stream, taking a comma-separated list of filters, whose parameters follow the filter name after a '='. .PP .Vb 1 \& ffmpeg \-i INPUT \-c:v copy \-bsf:v filter1[=opt1=str1:opt2=str2][,filter2] OUTPUT .Ve .PP Below is a description of the currently available bitstream filters, with their parameters, if any. .SS "aac_adtstoasc" .IX Subsection "aac_adtstoasc" Convert \s-1MPEG\-2/4 AAC ADTS\s0 to \s-1MPEG\-4\s0 Audio Specific Configuration bitstream filter. .PP This filter creates an \s-1MPEG\-4\s0 AudioSpecificConfig from an \s-1MPEG\-2/4 ADTS\s0 header and removes the \s-1ADTS\s0 header. .PP This is required for example when copying an \s-1AAC\s0 stream from a raw \&\s-1ADTS AAC\s0 container to a \s-1FLV\s0 or a \s-1MOV/MP4\s0 file. .SS "chomp" .IX Subsection "chomp" Remove zero padding at the end of a packet. .SS "dump_extra" .IX Subsection "dump_extra" Add extradata to the beginning of the filtered packets. .PP The additional argument specifies which packets should be filtered. It accepts the values: .IP "\fBa\fR" 4 .IX Item "a" add extradata to all key packets, but only if \fIlocal_header\fR is set in the \fBflags2\fR codec context field .IP "\fBk\fR" 4 .IX Item "k" add extradata to all key packets .IP "\fBe\fR" 4 .IX Item "e" add extradata to all packets .PP If not specified it is assumed \fBk\fR. .PP For example the following \fBffmpeg\fR command forces a global header (thus disabling individual packet headers) in the H.264 packets generated by the \f(CW\*(C`libx264\*(C'\fR encoder, but corrects them by adding the header stored in extradata to the key packets: .PP .Vb 1 \& ffmpeg \-i INPUT \-map 0 \-flags:v +global_header \-c:v libx264 \-bsf:v dump_extra out.ts .Ve .SS "dca_core" .IX Subsection "dca_core" Extract \s-1DCA\s0 core from DTS-HD streams. .SS "h264_mp4toannexb" .IX Subsection "h264_mp4toannexb" Convert an H.264 bitstream from length prefixed mode to start code prefixed mode (as defined in the Annex B of the ITU-T H.264 specification). .PP This is required by some streaming formats, typically the \s-1MPEG\-2\s0 transport stream format (\*(L"mpegts\*(R"). .PP For example to remux an \s-1MP4\s0 file containing an H.264 stream to mpegts format with \fBffmpeg\fR, you can use the command: .PP .Vb 1 \& ffmpeg \-i INPUT.mp4 \-codec copy \-bsf:v h264_mp4toannexb OUTPUT.ts .Ve .SS "imxdump" .IX Subsection "imxdump" Modifies the bitstream to fit in \s-1MOV\s0 and to be usable by the Final Cut Pro decoder. This filter only applies to the mpeg2video codec, and is likely not needed for Final Cut Pro 7 and newer with the appropriate \&\fB\-tag:v\fR. .PP For example, to remux 30 MB/sec \s-1NTSC IMX\s0 to \s-1MOV:\s0 .PP .Vb 1 \& ffmpeg \-i input.mxf \-c copy \-bsf:v imxdump \-tag:v mx3n output.mov .Ve .SS "mjpeg2jpeg" .IX Subsection "mjpeg2jpeg" Convert \s-1MJPEG/AVI1\s0 packets to full \s-1JPEG/JFIF\s0 packets. .PP \&\s-1MJPEG\s0 is a video codec wherein each video frame is essentially a \&\s-1JPEG\s0 image. The individual frames can be extracted without loss, e.g. by .PP .Vb 1 \& ffmpeg \-i ../some_mjpeg.avi \-c:v copy frames_%d.jpg .Ve .PP Unfortunately, these chunks are incomplete \s-1JPEG\s0 images, because they lack the \s-1DHT\s0 segment required for decoding. Quoting from <\fBhttp://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml\fR>: .PP Avery Lee, writing in the rec.video.desktop newsgroup in 2001, commented that \*(L"\s-1MJPEG,\s0 or at least the \s-1MJPEG\s0 in AVIs having the \&\s-1MJPG\s0 fourcc, is restricted \s-1JPEG\s0 with a fixed \*(-- and *omitted* \*(-- Huffman table. The \s-1JPEG\s0 must be YCbCr colorspace, it must be 4:2:2, and it must use basic Huffman encoding, not arithmetic or progressive. . . . You can indeed extract the \s-1MJPEG\s0 frames and decode them with a regular \s-1JPEG\s0 decoder, but you have to prepend the \s-1DHT\s0 segment to them, or else the decoder won't have any idea how to decompress the data. The exact table necessary is given in the OpenDML spec.\*(R" .PP This bitstream filter patches the header of frames extracted from an \s-1MJPEG\s0 stream (carrying the \s-1AVI1\s0 header \s-1ID\s0 and lacking a \s-1DHT\s0 segment) to produce fully qualified \s-1JPEG\s0 images. .PP .Vb 3 \& ffmpeg \-i mjpeg\-movie.avi \-c:v copy \-bsf:v mjpeg2jpeg frame_%d.jpg \& exiftran \-i \-9 frame*.jpg \& ffmpeg \-i frame_%d.jpg \-c:v copy rotated.avi .Ve .SS "mjpega_dump_header" .IX Subsection "mjpega_dump_header" .SS "movsub" .IX Subsection "movsub" .SS "mp3_header_decompress" .IX Subsection "mp3_header_decompress" .SS "mpeg4_unpack_bframes" .IX Subsection "mpeg4_unpack_bframes" Unpack DivX-style packed B\-frames. .PP DivX-style packed B\-frames are not valid \s-1MPEG\-4\s0 and were only a workaround for the broken Video for Windows subsystem. They use more space, can cause minor \s-1AV\s0 sync issues, require more \&\s-1CPU\s0 power to decode (unless the player has some decoded picture queue to compensate the 2,0,2,0 frame per packet style) and cause trouble if copied into a standard container like mp4 or mpeg\-ps/ts, because \s-1MPEG\-4\s0 decoders may not be able to decode them, since they are not valid \s-1MPEG\-4.\s0 .PP For example to fix an \s-1AVI\s0 file containing an \s-1MPEG\-4\s0 stream with DivX-style packed B\-frames using \fBffmpeg\fR, you can use the command: .PP .Vb 1 \& ffmpeg \-i INPUT.avi \-codec copy \-bsf:v mpeg4_unpack_bframes OUTPUT.avi .Ve .SS "noise" .IX Subsection "noise" Damages the contents of packets without damaging the container. Can be used for fuzzing or testing error resilience/concealment. .PP Parameters: A numeral string, whose value is related to how often output bytes will be modified. Therefore, values below or equal to 0 are forbidden, and the lower the more frequent bytes will be modified, with 1 meaning every byte is modified. .PP .Vb 1 \& ffmpeg \-i INPUT \-c copy \-bsf noise[=1] output.mkv .Ve .PP applies the modification to every byte. .SS "remove_extra" .IX Subsection "remove_extra" .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIffmpeg\fR\|(1), \fIffplay\fR\|(1), \fIffprobe\fR\|(1), \fIffserver\fR\|(1), \fIlibavcodec\fR\|(3) .SH "AUTHORS" .IX Header "AUTHORS" The FFmpeg developers. .PP For details about the authorship, see the Git history of the project (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command \&\fBgit log\fR in the FFmpeg source directory, or browsing the online repository at <\fBhttp://source.ffmpeg.org\fR>. .PP Maintainers for the specific components are listed in the file \&\fI\s-1MAINTAINERS\s0\fR in the source code tree.