demuxers.texi 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. @chapter Demuxers
  2. @c man begin DEMUXERS
  3. Demuxers are configured elements in FFmpeg which allow to read the
  4. multimedia streams from a particular type of file.
  5. When you configure your FFmpeg build, all the supported demuxers
  6. are enabled by default. You can list all available ones using the
  7. configure option "--list-demuxers".
  8. You can disable all the demuxers using the configure option
  9. "--disable-demuxers", and selectively enable a single demuxer with
  10. the option "--enable-demuxer=@var{DEMUXER}", or disable it
  11. with the option "--disable-demuxer=@var{DEMUXER}".
  12. The option "-formats" of the ff* tools will display the list of
  13. enabled demuxers.
  14. The description of some of the currently available demuxers follows.
  15. @section image2
  16. Image file demuxer.
  17. This demuxer reads from a list of image files specified by a pattern.
  18. The pattern may contain the string "%d" or "%0@var{N}d", which
  19. specifies the position of the characters representing a sequential
  20. number in each filename matched by the pattern. If the form
  21. "%d0@var{N}d" is used, the string representing the number in each
  22. filename is 0-padded and @var{N} is the total number of 0-padded
  23. digits representing the number. The literal character '%' can be
  24. specified in the pattern with the string "%%".
  25. If the pattern contains "%d" or "%0@var{N}d", the first filename of
  26. the file list specified by the pattern must contain a number
  27. inclusively contained between 0 and 4, all the following numbers must
  28. be sequential. This limitation may be hopefully fixed.
  29. The pattern may contain a suffix which is used to automatically
  30. determine the format of the images contained in the files.
  31. For example the pattern "img-%03d.bmp" will match a sequence of
  32. filenames of the form @file{img-001.bmp}, @file{img-002.bmp}, ...,
  33. @file{img-010.bmp}, etc.; the pattern "i%%m%%g-%d.jpg" will match a
  34. sequence of filenames of the form @file{i%m%g-1.jpg},
  35. @file{i%m%g-2.jpg}, ..., @file{i%m%g-10.jpg}, etc.
  36. The size, the pixel format, and the format of each image must be the
  37. same for all the files in the sequence.
  38. The following example shows how to use @command{ffmpeg} for creating a
  39. video from the images in the file sequence @file{img-001.jpeg},
  40. @file{img-002.jpeg}, ..., assuming an input frame rate of 10 frames per
  41. second:
  42. @example
  43. ffmpeg -i 'img-%03d.jpeg' -r 10 out.mkv
  44. @end example
  45. Note that the pattern must not necessarily contain "%d" or
  46. "%0@var{N}d", for example to convert a single image file
  47. @file{img.jpeg} you can employ the command:
  48. @example
  49. ffmpeg -i img.jpeg img.png
  50. @end example
  51. @section applehttp
  52. Apple HTTP Live Streaming demuxer.
  53. This demuxer presents all AVStreams from all variant streams.
  54. The id field is set to the bitrate variant index number. By setting
  55. the discard flags on AVStreams (by pressing 'a' or 'v' in ffplay),
  56. the caller can decide which variant streams to actually receive.
  57. The total bitrate of the variant that the stream belongs to is
  58. available in a metadata key named "variant_bitrate".
  59. @section sbg
  60. SBaGen script demuxer.
  61. This demuxer reads the script language used by SBaGen
  62. @url{http://uazu.net/sbagen/} to generate binaural beats sessions. A SBG
  63. script looks like that:
  64. @example
  65. -SE
  66. a: 300-2.5/3 440+4.5/0
  67. b: 300-2.5/0 440+4.5/3
  68. off: -
  69. NOW == a
  70. +0:07:00 == b
  71. +0:14:00 == a
  72. +0:21:00 == b
  73. +0:30:00 off
  74. @end example
  75. A SBG script can mix absolute and relative timestamps. If the script uses
  76. either only absolute timestamps (including the script start time) or only
  77. relative ones, then its layout is fixed, and the conversion is
  78. straightforward. On the other hand, if the script mixes both kind of
  79. timestamps, then the @var{NOW} reference for relative timestamps will be
  80. taken from the current time of day at the time the script is read, and the
  81. script layout will be frozen according to that reference. That means that if
  82. the script is directly played, the actual times will match the absolute
  83. timestamps up to the sound controller's clock accuracy, but if the user
  84. somehow pauses the playback or seeks, all times will be shifted accordingly.
  85. @c man end INPUT DEVICES