yading@10
|
1 =head1 NAME
|
yading@10
|
2
|
yading@10
|
3 ffmpeg-bitstream-filters - FFmpeg bitstream filters
|
yading@10
|
4
|
yading@10
|
5 =head1 DESCRIPTION
|
yading@10
|
6
|
yading@10
|
7
|
yading@10
|
8 This document describes the bitstream filters provided by the
|
yading@10
|
9 libavcodec library.
|
yading@10
|
10
|
yading@10
|
11 A bitstream filter operates on the encoded stream data, and performs
|
yading@10
|
12 bitstream level modifications without performing decoding.
|
yading@10
|
13
|
yading@10
|
14
|
yading@10
|
15
|
yading@10
|
16 =head1 BITSTREAM FILTERS
|
yading@10
|
17
|
yading@10
|
18
|
yading@10
|
19 When you configure your FFmpeg build, all the supported bitstream
|
yading@10
|
20 filters are enabled by default. You can list all available ones using
|
yading@10
|
21 the configure option C<--list-bsfs>.
|
yading@10
|
22
|
yading@10
|
23 You can disable all the bitstream filters using the configure option
|
yading@10
|
24 C<--disable-bsfs>, and selectively enable any bitstream filter using
|
yading@10
|
25 the option C<--enable-bsf=BSF>, or you can disable a particular
|
yading@10
|
26 bitstream filter using the option C<--disable-bsf=BSF>.
|
yading@10
|
27
|
yading@10
|
28 The option C<-bsfs> of the ff* tools will display the list of
|
yading@10
|
29 all the supported bitstream filters included in your build.
|
yading@10
|
30
|
yading@10
|
31 Below is a description of the currently available bitstream filters.
|
yading@10
|
32
|
yading@10
|
33
|
yading@10
|
34 =head2 aac_adtstoasc
|
yading@10
|
35
|
yading@10
|
36
|
yading@10
|
37
|
yading@10
|
38 =head2 chomp
|
yading@10
|
39
|
yading@10
|
40
|
yading@10
|
41
|
yading@10
|
42 =head2 dump_extradata
|
yading@10
|
43
|
yading@10
|
44
|
yading@10
|
45
|
yading@10
|
46 =head2 h264_mp4toannexb
|
yading@10
|
47
|
yading@10
|
48
|
yading@10
|
49 Convert an H.264 bitstream from length prefixed mode to start code
|
yading@10
|
50 prefixed mode (as defined in the Annex B of the ITU-T H.264
|
yading@10
|
51 specification).
|
yading@10
|
52
|
yading@10
|
53 This is required by some streaming formats, typically the MPEG-2
|
yading@10
|
54 transport stream format ("mpegts").
|
yading@10
|
55
|
yading@10
|
56 For example to remux an MP4 file containing an H.264 stream to mpegts
|
yading@10
|
57 format with B<ffmpeg>, you can use the command:
|
yading@10
|
58
|
yading@10
|
59
|
yading@10
|
60 ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
|
yading@10
|
61
|
yading@10
|
62
|
yading@10
|
63
|
yading@10
|
64 =head2 imx_dump_header
|
yading@10
|
65
|
yading@10
|
66
|
yading@10
|
67
|
yading@10
|
68 =head2 mjpeg2jpeg
|
yading@10
|
69
|
yading@10
|
70
|
yading@10
|
71 Convert MJPEG/AVI1 packets to full JPEG/JFIF packets.
|
yading@10
|
72
|
yading@10
|
73 MJPEG is a video codec wherein each video frame is essentially a
|
yading@10
|
74 JPEG image. The individual frames can be extracted without loss,
|
yading@10
|
75 e.g. by
|
yading@10
|
76
|
yading@10
|
77
|
yading@10
|
78 ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
|
yading@10
|
79
|
yading@10
|
80
|
yading@10
|
81 Unfortunately, these chunks are incomplete JPEG images, because
|
yading@10
|
82 they lack the DHT segment required for decoding. Quoting from
|
yading@10
|
83 E<lt>B<http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml>E<gt>:
|
yading@10
|
84
|
yading@10
|
85 Avery Lee, writing in the rec.video.desktop newsgroup in 2001,
|
yading@10
|
86 commented that "MJPEG, or at least the MJPEG in AVIs having the
|
yading@10
|
87 MJPG fourcc, is restricted JPEG with a fixed -- and *omitted* --
|
yading@10
|
88 Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2,
|
yading@10
|
89 and it must use basic Huffman encoding, not arithmetic or
|
yading@10
|
90 progressive. . . . You can indeed extract the MJPEG frames and
|
yading@10
|
91 decode them with a regular JPEG decoder, but you have to prepend
|
yading@10
|
92 the DHT segment to them, or else the decoder won't have any idea
|
yading@10
|
93 how to decompress the data. The exact table necessary is given in
|
yading@10
|
94 the OpenDML spec."
|
yading@10
|
95
|
yading@10
|
96 This bitstream filter patches the header of frames extracted from an MJPEG
|
yading@10
|
97 stream (carrying the AVI1 header ID and lacking a DHT segment) to
|
yading@10
|
98 produce fully qualified JPEG images.
|
yading@10
|
99
|
yading@10
|
100
|
yading@10
|
101 ffmpeg -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpg
|
yading@10
|
102 exiftran -i -9 frame*.jpg
|
yading@10
|
103 ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
|
yading@10
|
104
|
yading@10
|
105
|
yading@10
|
106
|
yading@10
|
107 =head2 mjpega_dump_header
|
yading@10
|
108
|
yading@10
|
109
|
yading@10
|
110
|
yading@10
|
111 =head2 movsub
|
yading@10
|
112
|
yading@10
|
113
|
yading@10
|
114
|
yading@10
|
115 =head2 mp3_header_compress
|
yading@10
|
116
|
yading@10
|
117
|
yading@10
|
118
|
yading@10
|
119 =head2 mp3_header_decompress
|
yading@10
|
120
|
yading@10
|
121
|
yading@10
|
122
|
yading@10
|
123 =head2 noise
|
yading@10
|
124
|
yading@10
|
125
|
yading@10
|
126
|
yading@10
|
127 =head2 remove_extradata
|
yading@10
|
128
|
yading@10
|
129
|
yading@10
|
130
|
yading@10
|
131
|
yading@10
|
132 =head1 SEE ALSO
|
yading@10
|
133
|
yading@10
|
134
|
yading@10
|
135
|
yading@10
|
136 ffmpeg(1), ffplay(1), ffprobe(1), ffserver(1), libavcodec(3)
|
yading@10
|
137
|
yading@10
|
138
|
yading@10
|
139 =head1 AUTHORS
|
yading@10
|
140
|
yading@10
|
141
|
yading@10
|
142 The FFmpeg developers.
|
yading@10
|
143
|
yading@10
|
144 For details about the authorship, see the Git history of the project
|
yading@10
|
145 (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
|
yading@10
|
146 B<git log> in the FFmpeg source directory, or browsing the
|
yading@10
|
147 online repository at E<lt>B<http://source.ffmpeg.org>E<gt>.
|
yading@10
|
148
|
yading@10
|
149 Maintainers for the specific components are listed in the file
|
yading@10
|
150 F<MAINTAINERS> in the source code tree.
|
yading@10
|
151
|
yading@10
|
152
|
yading@10
|
153
|