doc: update demuxers section
[libav.git] / doc / bitstream_filters.texi
CommitLineData
361d2758
SS
1@chapter Bitstream Filters
2@c man begin BITSTREAM FILTERS
3
f8a45fa1 4When you configure your Libav build, all the supported bitstream
361d2758
SS
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
16Below is a description of the currently available bitstream filters.
17
18@section aac_adtstoasc
19
20@section chomp
21
22@section dump_extradata
23
24@section h264_mp4toannexb
25
26@section imx_dump_header
27
ba83c4bf
NG
28@section mjpeg2jpeg
29
30Convert MJPEG/AVI1 packets to full JPEG/JFIF packets.
31
32MJPEG is a video codec wherein each video frame is essentially a
33JPEG image. The individual frames can be extracted without loss,
34e.g. by
35
36@example
37ffmpeg -i ../some_mjpeg.avi -vcodec copy frames_%d.jpg
38@end example
39
40Unfortunately, these chunks are incomplete JPEG images, because
41they lack the DHT segment required for decoding. Quoting from
42@url{http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml}:
43
44Avery Lee, writing in the rec.video.desktop newsgroup in 2001,
45commented that "MJPEG, or at least the MJPEG in AVIs having the
46MJPG fourcc, is restricted JPEG with a fixed -- and *omitted* --
47Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2,
48and it must use basic Huffman encoding, not arithmetic or
49progressive. . . . You can indeed extract the MJPEG frames and
50decode them with a regular JPEG decoder, but you have to prepend
51the DHT segment to them, or else the decoder won't have any idea
52how to decompress the data. The exact table necessary is given in
53the OpenDML spec."
54
55This bitstream filter patches the header of frames extracted from an MJPEG
56stream (carrying the AVI1 header ID and lacking a DHT segment) to
57produce fully qualified JPEG images.
58
59@example
60ffmpeg -i mjpeg-movie.avi -vcodec copy -vbsf mjpeg2jpeg frame_%d.jpg
61exiftran -i -9 frame*.jpg
62ffmpeg -i frame_%d.jpg -vcodec copy rotated.avi
63@end example
64
361d2758
SS
65@section mjpega_dump_header
66
67@section movsub
68
69@section mp3_header_compress
70
71@section mp3_header_decompress
72
73@section noise
74
75@section remove_extradata
76
77@c man end BITSTREAM FILTERS