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