bitstream_filters.texi 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. @chapter Bitstream Filters
  2. @c man begin BITSTREAM FILTERS
  3. When you configure your FFmpeg build, all the supported bitstream
  4. filters are enabled by default. You can list all available ones using
  5. the configure option @code{--list-bsfs}.
  6. You can disable all the bitstream filters using the configure option
  7. @code{--disable-bsfs}, and selectively enable any bitstream filter using
  8. the option @code{--enable-bsf=BSF}, or you can disable a particular
  9. bitstream filter using the option @code{--disable-bsf=BSF}.
  10. The option @code{-bsfs} of the ff* tools will display the list of
  11. all the supported bitstream filters included in your build.
  12. Below is a description of the currently available bitstream filters.
  13. @section aac_adtstoasc
  14. @section chomp
  15. @section dump_extradata
  16. @section h264_mp4toannexb
  17. @section imx_dump_header
  18. @section mjpeg2jpeg
  19. Convert MJPEG/AVI1 packets to full JPEG/JFIF packets.
  20. MJPEG is a video codec wherein each video frame is essentially a
  21. JPEG image. The individual frames can be extracted without loss,
  22. e.g. by
  23. @example
  24. ffmpeg -i ../some_mjpeg.avi -vcodec copy frames_%d.jpg
  25. @end example
  26. Unfortunately, these chunks are incomplete JPEG images, because
  27. they lack the DHT segment required for decoding. Quoting from
  28. @url{http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml}:
  29. Avery Lee, writing in the rec.video.desktop newsgroup in 2001,
  30. commented that "MJPEG, or at least the MJPEG in AVIs having the
  31. MJPG fourcc, is restricted JPEG with a fixed -- and *omitted* --
  32. Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2,
  33. and it must use basic Huffman encoding, not arithmetic or
  34. progressive. . . . You can indeed extract the MJPEG frames and
  35. decode them with a regular JPEG decoder, but you have to prepend
  36. the DHT segment to them, or else the decoder won't have any idea
  37. how to decompress the data. The exact table necessary is given in
  38. the OpenDML spec."
  39. This bitstream filter patches the header of frames extracted from an MJPEG
  40. stream (carrying the AVI1 header ID and lacking a DHT segment) to
  41. produce fully qualified JPEG images.
  42. @example
  43. ffmpeg -i mjpeg-movie.avi -vcodec copy -vbsf mjpeg2jpeg frame_%d.jpg
  44. exiftran -i -9 frame*.jpg
  45. ffmpeg -i frame_%d.jpg -vcodec copy rotated.avi
  46. @end example
  47. @section mjpega_dump_header
  48. @section movsub
  49. @section mp3_header_compress
  50. @section mp3_header_decompress
  51. @section noise
  52. @section remove_extradata
  53. @c man end BITSTREAM FILTERS