Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. =head1 NAME
  2.  
  3. ffmpeg-bitstream-filters - FFmpeg bitstream filters
  4.  
  5. =head1 DESCRIPTION
  6.  
  7.  
  8. This document describes the bitstream filters provided by the
  9. libavcodec library.
  10.  
  11. A bitstream filter operates on the encoded stream data, and performs
  12. bitstream level modifications without performing decoding.
  13.  
  14.  
  15.  
  16. =head1 BITSTREAM FILTERS
  17.  
  18.  
  19. When you configure your FFmpeg build, all the supported bitstream
  20. filters are enabled by default. You can list all available ones using
  21. the configure option C<--list-bsfs>.
  22.  
  23. You can disable all the bitstream filters using the configure option
  24. C<--disable-bsfs>, and selectively enable any bitstream filter using
  25. the option C<--enable-bsf=BSF>, or you can disable a particular
  26. bitstream filter using the option C<--disable-bsf=BSF>.
  27.  
  28. The option C<-bsfs> of the ff* tools will display the list of
  29. all the supported bitstream filters included in your build.
  30.  
  31. Below is a description of the currently available bitstream filters.
  32.  
  33.  
  34. =head2 aac_adtstoasc
  35.  
  36.  
  37. Convert MPEG-2/4 AAC ADTS to MPEG-4 Audio Specific Configuration
  38. bitstream filter.
  39.  
  40. This filter creates an MPEG-4 AudioSpecificConfig from an MPEG-2/4
  41. ADTS header and removes the ADTS header.
  42.  
  43. This is required for example when copying an AAC stream from a raw
  44. ADTS AAC container to a FLV or a MOV/MP4 file.
  45.  
  46.  
  47. =head2 chomp
  48.  
  49.  
  50. Remove zero padding at the end of a packet.
  51.  
  52.  
  53. =head2 dump_extra
  54.  
  55.  
  56. Add extradata to the beginning of the filtered packets.
  57.  
  58. The additional argument specifies which packets should be filtered.
  59. It accepts the values:
  60.  
  61. =over 4
  62.  
  63.  
  64. =item B<a>
  65.  
  66. add extradata to all key packets, but only if I<local_header> is
  67. set in the B<flags2> codec context field
  68.  
  69.  
  70. =item B<k>
  71.  
  72. add extradata to all key packets
  73.  
  74.  
  75. =item B<e>
  76.  
  77. add extradata to all packets
  78.  
  79. =back
  80.  
  81.  
  82. If not specified it is assumed B<k>.
  83.  
  84. For example the following B<ffmpeg> command forces a global
  85. header (thus disabling individual packet headers) in the H.264 packets
  86. generated by the C<libx264> encoder, but corrects them by adding
  87. the header stored in extradata to the key packets:
  88.        
  89.         ffmpeg -i INPUT -map 0 -flags:v +global_header -c:v libx264 -bsf:v dump_extra out.ts
  90.  
  91.  
  92.  
  93. =head2 h264_mp4toannexb
  94.  
  95.  
  96. Convert an H.264 bitstream from length prefixed mode to start code
  97. prefixed mode (as defined in the Annex B of the ITU-T H.264
  98. specification).
  99.  
  100. This is required by some streaming formats, typically the MPEG-2
  101. transport stream format ("mpegts").
  102.  
  103. For example to remux an MP4 file containing an H.264 stream to mpegts
  104. format with B<ffmpeg>, you can use the command:
  105.  
  106.        
  107.         ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
  108.  
  109.  
  110.  
  111. =head2 imx_dump_header
  112.  
  113.  
  114.  
  115. =head2 mjpeg2jpeg
  116.  
  117.  
  118. Convert MJPEG/AVI1 packets to full JPEG/JFIF packets.
  119.  
  120. MJPEG is a video codec wherein each video frame is essentially a
  121. JPEG image. The individual frames can be extracted without loss,
  122. e.g. by
  123.  
  124.        
  125.         ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
  126.  
  127.  
  128. Unfortunately, these chunks are incomplete JPEG images, because
  129. they lack the DHT segment required for decoding. Quoting from
  130. E<lt>B<http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml>E<gt>:
  131.  
  132. Avery Lee, writing in the rec.video.desktop newsgroup in 2001,
  133. commented that "MJPEG, or at least the MJPEG in AVIs having the
  134. MJPG fourcc, is restricted JPEG with a fixed -- and *omitted* --
  135. Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2,
  136. and it must use basic Huffman encoding, not arithmetic or
  137. progressive. . . . You can indeed extract the MJPEG frames and
  138. decode them with a regular JPEG decoder, but you have to prepend
  139. the DHT segment to them, or else the decoder won't have any idea
  140. how to decompress the data. The exact table necessary is given in
  141. the OpenDML spec."
  142.  
  143. This bitstream filter patches the header of frames extracted from an MJPEG
  144. stream (carrying the AVI1 header ID and lacking a DHT segment) to
  145. produce fully qualified JPEG images.
  146.  
  147.        
  148.         ffmpeg -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpg
  149.         exiftran -i -9 frame*.jpg
  150.         ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
  151.  
  152.  
  153.  
  154. =head2 mjpega_dump_header
  155.  
  156.  
  157.  
  158. =head2 movsub
  159.  
  160.  
  161.  
  162. =head2 mp3_header_compress
  163.  
  164.  
  165.  
  166. =head2 mp3_header_decompress
  167.  
  168.  
  169.  
  170. =head2 noise
  171.  
  172.  
  173.  
  174. =head2 remove_extra
  175.  
  176.  
  177.  
  178.  
  179. =head1 SEE ALSO
  180.  
  181.  
  182.  
  183. ffmpeg(1), ffplay(1), ffprobe(1), ffserver(1), libavcodec(3)
  184.  
  185.  
  186. =head1 AUTHORS
  187.  
  188.  
  189. The FFmpeg developers.
  190.  
  191. For details about the authorship, see the Git history of the project
  192. (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
  193. B<git log> in the FFmpeg source directory, or browsing the
  194. online repository at E<lt>B<http://source.ffmpeg.org>E<gt>.
  195.  
  196. Maintainers for the specific components are listed in the file
  197. F<MAINTAINERS> in the source code tree.
  198.  
  199.  
  200.  
  201.