Commit | Line | Data |
---|---|---|
361d2758 SS |
1 | @chapter Bitstream Filters |
2 | @c man begin BITSTREAM FILTERS | |
3 | ||
f8a45fa1 | 4 | When you configure your Libav build, all the supported bitstream |
361d2758 SS |
5 | filters are enabled by default. You can list all available ones using |
6 | the configure option @code{--list-bsfs}. | |
7 | ||
8 | You can disable all the bitstream filters using the configure option | |
9 | @code{--disable-bsfs}, and selectively enable any bitstream filter using | |
10 | the option @code{--enable-bsf=BSF}, or you can disable a particular | |
11 | bitstream filter using the option @code{--disable-bsf=BSF}. | |
12 | ||
202b5f6d | 13 | The option @code{-bsfs} of the av* tools will display the list of |
361d2758 SS |
14 | all the supported bitstream filters included in your build. |
15 | ||
16 | Below 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 | ||
26 | Extract the in-band extradata. | |
27 | ||
28 | Certain codecs allow the long-term headers (e.g. MPEG-2 sequence headers, | |
29 | or H.264/HEVC (VPS/)SPS/PPS) to be transmitted either "in-band" (i.e. as a part | |
30 | of the bitstream containing the coded frames) or "out of band" (e.g. on the | |
31 | container level). This latter form is called "extradata" in Libav terminology. | |
32 | ||
33 | This bitstream filter detects the in-band headers and makes them available as | |
34 | extradata. | |
35 | ||
36 | @table @option | |
37 | @item remove | |
38 | When this option is enabled, the long-term headers are removed from the | |
39 | bitstream 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 | ||
48 | Convert MJPEG/AVI1 packets to full JPEG/JFIF packets. | |
49 | ||
50 | MJPEG is a video codec wherein each video frame is essentially a | |
51 | JPEG image. The individual frames can be extracted without loss, | |
52 | e.g. by | |
53 | ||
54 | @example | |
d5837d7f | 55 | avconv -i ../some_mjpeg.avi -c:v copy frames_%d.jpg |
ba83c4bf NG |
56 | @end example |
57 | ||
58 | Unfortunately, these chunks are incomplete JPEG images, because | |
59 | they lack the DHT segment required for decoding. Quoting from | |
60 | @url{http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml}: | |
61 | ||
62 | Avery Lee, writing in the rec.video.desktop newsgroup in 2001, | |
63 | commented that "MJPEG, or at least the MJPEG in AVIs having the | |
64 | MJPG fourcc, is restricted JPEG with a fixed -- and *omitted* -- | |
65 | Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2, | |
66 | and it must use basic Huffman encoding, not arithmetic or | |
67 | progressive. . . . You can indeed extract the MJPEG frames and | |
68 | decode them with a regular JPEG decoder, but you have to prepend | |
69 | the DHT segment to them, or else the decoder won't have any idea | |
70 | how to decompress the data. The exact table necessary is given in | |
71 | the OpenDML spec." | |
72 | ||
73 | This bitstream filter patches the header of frames extracted from an MJPEG | |
74 | stream (carrying the AVI1 header ID and lacking a DHT segment) to | |
75 | produce fully qualified JPEG images. | |
76 | ||
77 | @example | |
d6a77e2b | 78 | avconv -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpg |
ba83c4bf | 79 | exiftran -i -9 frame*.jpg |
d5837d7f | 80 | avconv -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 |
94 | This bitstream filter passes the packets through unchanged. | |
95 | ||
361d2758 SS |
96 | @section remove_extradata |
97 | ||
0cf949a0 RB |
98 | @section vp9_superframe |
99 | ||
100 | Combine VP9 frames into superframes. | |
101 | ||
03a80925 AK |
102 | @section vp9_superframe_split |
103 | ||
104 | Split VP9 superframes into single frames. | |
105 | ||
361d2758 | 106 | @c man end BITSTREAM FILTERS |