demuxers.texi 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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 syntax and meaning of the pattern is specified by the
  19. option @var{pattern_type}.
  20. The pattern may contain a suffix which is used to automatically
  21. determine the format of the images contained in the files.
  22. The size, the pixel format, and the format of each image must be the
  23. same for all the files in the sequence.
  24. This demuxer accepts the following options:
  25. @table @option
  26. @item framerate
  27. Set the framerate for the video stream. It defaults to 25.
  28. @item loop
  29. If set to 1, loop over the input. Default value is 0.
  30. @item pattern_type
  31. Select the pattern type used to interpret the provided filename.
  32. @var{pattern_type} accepts one of the following values.
  33. @table @option
  34. @item sequence
  35. Select a sequence pattern type, used to specify a sequence of files
  36. indexed by sequential numbers.
  37. A sequence pattern may contain the string "%d" or "%0@var{N}d", which
  38. specifies the position of the characters representing a sequential
  39. number in each filename matched by the pattern. If the form
  40. "%d0@var{N}d" is used, the string representing the number in each
  41. filename is 0-padded and @var{N} is the total number of 0-padded
  42. digits representing the number. The literal character '%' can be
  43. specified in the pattern with the string "%%".
  44. If the sequence pattern contains "%d" or "%0@var{N}d", the first filename of
  45. the file list specified by the pattern must contain a number
  46. inclusively contained between @var{start_number} and
  47. @var{start_number}+@var{start_number_range}-1, and all the following
  48. numbers must be sequential.
  49. For example the pattern "img-%03d.bmp" will match a sequence of
  50. filenames of the form @file{img-001.bmp}, @file{img-002.bmp}, ...,
  51. @file{img-010.bmp}, etc.; the pattern "i%%m%%g-%d.jpg" will match a
  52. sequence of filenames of the form @file{i%m%g-1.jpg},
  53. @file{i%m%g-2.jpg}, ..., @file{i%m%g-10.jpg}, etc.
  54. Note that the pattern must not necessarily contain "%d" or
  55. "%0@var{N}d", for example to convert a single image file
  56. @file{img.jpeg} you can employ the command:
  57. @example
  58. ffmpeg -i img.jpeg img.png
  59. @end example
  60. @item glob
  61. Select a glob wildcard pattern type.
  62. The pattern is interpreted like a @code{glob()} pattern. This is only
  63. selectable if libavformat was compiled with globbing support.
  64. @item glob_sequence @emph{(deprecated, will be removed)}
  65. Select a mixed glob wildcard/sequence pattern.
  66. If your version of libavformat was compiled with globbing support, and
  67. the provided pattern contains at least one glob meta character among
  68. @code{%*?[]@{@}} that is preceded by an unescaped "%", the pattern is
  69. interpreted like a @code{glob()} pattern, otherwise it is interpreted
  70. like a sequence pattern.
  71. All glob special characters @code{%*?[]@{@}} must be prefixed
  72. with "%". To escape a literal "%" you shall use "%%".
  73. For example the pattern @code{foo-%*.jpeg} will match all the
  74. filenames prefixed by "foo-" and terminating with ".jpeg", and
  75. @code{foo-%?%?%?.jpeg} will match all the filenames prefixed with
  76. "foo-", followed by a sequence of three characters, and terminating
  77. with ".jpeg".
  78. This pattern type is deprecated in favor of @var{glob} and
  79. @var{sequence}.
  80. @end table
  81. Default value is @var{glob_sequence}.
  82. @item pixel_format
  83. Set the pixel format of the images to read. If not specified the pixel
  84. format is guessed from the first image file in the sequence.
  85. @item start_number
  86. Set the index of the file matched by the image file pattern to start
  87. to read from. Default value is 0.
  88. @item start_number_range
  89. Set the index interval range to check when looking for the first image
  90. file in the sequence, starting from @var{start_number}. Default value
  91. is 5.
  92. @item video_size
  93. Set the video size of the images to read. If not specified the video
  94. size is guessed from the first image file in the sequence.
  95. @end table
  96. @subsection Examples
  97. @itemize
  98. @item
  99. Use @command{ffmpeg} for creating a video from the images in the file
  100. sequence @file{img-001.jpeg}, @file{img-002.jpeg}, ..., assuming an
  101. input frame rate of 10 frames per second:
  102. @example
  103. ffmpeg -i 'img-%03d.jpeg' -r 10 out.mkv
  104. @end example
  105. @item
  106. As above, but start by reading from a file with index 100 in the sequence:
  107. @example
  108. ffmpeg -start_number 100 -i 'img-%03d.jpeg' -r 10 out.mkv
  109. @end example
  110. @item
  111. Read images matching the "*.png" glob pattern , that is all the files
  112. terminating with the ".png" suffix:
  113. @example
  114. ffmpeg -pattern_type glob -i "*.png" -r 10 out.mkv
  115. @end example
  116. @end itemize
  117. @section applehttp
  118. Apple HTTP Live Streaming demuxer.
  119. This demuxer presents all AVStreams from all variant streams.
  120. The id field is set to the bitrate variant index number. By setting
  121. the discard flags on AVStreams (by pressing 'a' or 'v' in ffplay),
  122. the caller can decide which variant streams to actually receive.
  123. The total bitrate of the variant that the stream belongs to is
  124. available in a metadata key named "variant_bitrate".
  125. @section sbg
  126. SBaGen script demuxer.
  127. This demuxer reads the script language used by SBaGen
  128. @url{http://uazu.net/sbagen/} to generate binaural beats sessions. A SBG
  129. script looks like that:
  130. @example
  131. -SE
  132. a: 300-2.5/3 440+4.5/0
  133. b: 300-2.5/0 440+4.5/3
  134. off: -
  135. NOW == a
  136. +0:07:00 == b
  137. +0:14:00 == a
  138. +0:21:00 == b
  139. +0:30:00 off
  140. @end example
  141. A SBG script can mix absolute and relative timestamps. If the script uses
  142. either only absolute timestamps (including the script start time) or only
  143. relative ones, then its layout is fixed, and the conversion is
  144. straightforward. On the other hand, if the script mixes both kind of
  145. timestamps, then the @var{NOW} reference for relative timestamps will be
  146. taken from the current time of day at the time the script is read, and the
  147. script layout will be frozen according to that reference. That means that if
  148. the script is directly played, the actual times will match the absolute
  149. timestamps up to the sound controller's clock accuracy, but if the user
  150. somehow pauses the playback or seeks, all times will be shifted accordingly.
  151. @c man end INPUT DEVICES