vp9: Add bsf to fix reordering in raw streams
[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
202b5f6d 13The option @code{-bsfs} of the av* tools will display the list of
361d2758
SS
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
89b35a13
AK
24@section extract_extradata
25
26Extract the in-band extradata.
27
28Certain codecs allow the long-term headers (e.g. MPEG-2 sequence headers,
29or H.264/HEVC (VPS/)SPS/PPS) to be transmitted either "in-band" (i.e. as a part
30of the bitstream containing the coded frames) or "out of band" (e.g. on the
31container level). This latter form is called "extradata" in Libav terminology.
32
33This bitstream filter detects the in-band headers and makes them available as
34extradata.
35
36@table @option
37@item remove
38When this option is enabled, the long-term headers are removed from the
39bitstream after extraction.
40@end table
41
361d2758
SS
42@section h264_mp4toannexb
43
44@section imx_dump_header
45
ba83c4bf
NG
46@section mjpeg2jpeg
47
48Convert MJPEG/AVI1 packets to full JPEG/JFIF packets.
49
50MJPEG is a video codec wherein each video frame is essentially a
51JPEG image. The individual frames can be extracted without loss,
52e.g. by
53
54@example
d5837d7f 55avconv -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
ba83c4bf
NG
56@end example
57
58Unfortunately, these chunks are incomplete JPEG images, because
59they lack the DHT segment required for decoding. Quoting from
60@url{http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml}:
61
62Avery Lee, writing in the rec.video.desktop newsgroup in 2001,
63commented that "MJPEG, or at least the MJPEG in AVIs having the
64MJPG fourcc, is restricted JPEG with a fixed -- and *omitted* --
65Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2,
66and it must use basic Huffman encoding, not arithmetic or
67progressive. . . . You can indeed extract the MJPEG frames and
68decode them with a regular JPEG decoder, but you have to prepend
69the DHT segment to them, or else the decoder won't have any idea
70how to decompress the data. The exact table necessary is given in
71the OpenDML spec."
72
73This bitstream filter patches the header of frames extracted from an MJPEG
74stream (carrying the AVI1 header ID and lacking a DHT segment) to
75produce fully qualified JPEG images.
76
77@example
d6a77e2b 78avconv -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpg
ba83c4bf 79exiftran -i -9 frame*.jpg
d5837d7f 80avconv -i frame_%d.jpg -c:v copy rotated.avi
ba83c4bf
NG
81@end example
82
361d2758
SS
83@section mjpega_dump_header
84
85@section movsub
86
87@section mp3_header_compress
88
89@section mp3_header_decompress
90
91@section noise
92
47e547b3
AK
93@section null
94This bitstream filter passes the packets through unchanged.
95
361d2758
SS
96@section remove_extradata
97
0cf949a0
RB
98@section vp9_superframe
99
100Combine VP9 frames into superframes.
101
03a80925
AK
102@section vp9_superframe_split
103
104Split VP9 superframes into single frames.
105
34e051d1
MT
106@section vp9_raw_reorder
107
108Given a VP9 stream with correct timestamps but possibly out of order,
109insert additional show-existing-frame packets to correct the ordering.
110
361d2758 111@c man end BITSTREAM FILTERS