aboutsummaryrefslogtreecommitdiff
path: root/doc/demuxers.texi
blob: aea4c54c0bfaeb3a06e109bbea450e3ce01a9835 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
@chapter Demuxers
@c man begin DEMUXERS

Demuxers are configured elements in FFmpeg which allow to read the
multimedia streams from a particular type of file.

When you configure your FFmpeg build, all the supported demuxers
are enabled by default. You can list all available ones using the
configure option "--list-demuxers".

You can disable all the demuxers using the configure option
"--disable-demuxers", and selectively enable a single demuxer with
the option "--enable-demuxer=@var{DEMUXER}", or disable it
with the option "--disable-demuxer=@var{DEMUXER}".

The option "-formats" of the ff* tools will display the list of
enabled demuxers.

The description of some of the currently available demuxers follows.

@section image2

Image file demuxer.

This demuxer reads from a list of image files specified by a pattern.
The syntax and meaning of the pattern is specified by the
option @var{pattern_type}.

The pattern may contain a suffix which is used to automatically
determine the format of the images contained in the files.

The size, the pixel format, and the format of each image must be the
same for all the files in the sequence.

This demuxer accepts the following options:
@table @option
@item framerate
Set the framerate for the video stream. It defaults to 25.
@item loop
If set to 1, loop over the input. Default value is 0.
@item pattern_type
Select the pattern type used to interpret the provided filename.

@var{pattern_type} accepts one of the following values.
@table @option
@item sequence
Select a sequence pattern type, used to specify a sequence of files
indexed by sequential numbers.

A sequence pattern may contain the string "%d" or "%0@var{N}d", which
specifies the position of the characters representing a sequential
number in each filename matched by the pattern. If the form
"%d0@var{N}d" is used, the string representing the number in each
filename is 0-padded and @var{N} is the total number of 0-padded
digits representing the number. The literal character '%' can be
specified in the pattern with the string "%%".

If the sequence pattern contains "%d" or "%0@var{N}d", the first filename of
the file list specified by the pattern must contain a number
inclusively contained between @var{start_number} and
@var{start_number}+@var{start_number_range}-1, and all the following
numbers must be sequential.

For example the pattern "img-%03d.bmp" will match a sequence of
filenames of the form @file{img-001.bmp}, @file{img-002.bmp}, ...,
@file{img-010.bmp}, etc.; the pattern "i%%m%%g-%d.jpg" will match a
sequence of filenames of the form @file{i%m%g-1.jpg},
@file{i%m%g-2.jpg}, ..., @file{i%m%g-10.jpg}, etc.

Note that the pattern must not necessarily contain "%d" or
"%0@var{N}d", for example to convert a single image file
@file{img.jpeg} you can employ the command:
@example
ffmpeg -i img.jpeg img.png
@end example

@item glob
Select a glob wildcard pattern type.

The pattern is interpreted like a @code{glob()} pattern. This is only
selectable if libavformat was compiled with globbing support.

@item glob_sequence @emph{(deprecated, will be removed)}
Select a mixed glob wildcard/sequence pattern.

If your version of libavformat was compiled with globbing support, and
the provided pattern contains at least one glob meta character among
@code{%*?[]@{@}} that is preceded by an unescaped "%", the pattern is
interpreted like a @code{glob()} pattern, otherwise it is interpreted
like a sequence pattern.

All glob special characters @code{%*?[]@{@}} must be prefixed
with "%". To escape a literal "%" you shall use "%%".

For example the pattern @code{foo-%*.jpeg} will match all the
filenames prefixed by "foo-" and terminating with ".jpeg", and
@code{foo-%?%?%?.jpeg} will match all the filenames prefixed with
"foo-", followed by a sequence of three characters, and terminating
with ".jpeg".

This pattern type is deprecated in favor of @var{glob} and
@var{sequence}.
@end table

Default value is @var{glob_sequence}.
@item pixel_format
Set the pixel format of the images to read. If not specified the pixel
format is guessed from the first image file in the sequence.
@item start_number
Set the index of the file matched by the image file pattern to start
to read from. Default value is 0.
@item start_number_range
Set the index interval range to check when looking for the first image
file in the sequence, starting from @var{start_number}. Default value
is 5.
@item video_size
Set the video size of the images to read. If not specified the video
size is guessed from the first image file in the sequence.
@end table

@subsection Examples

@itemize
@item
Use @command{ffmpeg} for creating a video from the images in the file
sequence @file{img-001.jpeg}, @file{img-002.jpeg}, ..., assuming an
input frame rate of 10 frames per second:
@example
ffmpeg -i 'img-%03d.jpeg' -r 10 out.mkv
@end example

@item
As above, but start by reading from a file with index 100 in the sequence:
@example
ffmpeg -start_number 100 -i 'img-%03d.jpeg' -r 10 out.mkv
@end example

@item
Read images matching the "*.png" glob pattern , that is all the files
terminating with the ".png" suffix:
@example
ffmpeg -pattern_type glob -i "*.png" -r 10 out.mkv
@end example
@end itemize

@section applehttp

Apple HTTP Live Streaming demuxer.

This demuxer presents all AVStreams from all variant streams.
The id field is set to the bitrate variant index number. By setting
the discard flags on AVStreams (by pressing 'a' or 'v' in ffplay),
the caller can decide which variant streams to actually receive.
The total bitrate of the variant that the stream belongs to is
available in a metadata key named "variant_bitrate".

@section sbg

SBaGen script demuxer.

This demuxer reads the script language used by SBaGen
@url{http://uazu.net/sbagen/} to generate binaural beats sessions. A SBG
script looks like that:
@example
-SE
a: 300-2.5/3 440+4.5/0
b: 300-2.5/0 440+4.5/3
off: -
NOW      == a
+0:07:00 == b
+0:14:00 == a
+0:21:00 == b
+0:30:00    off
@end example

A SBG script can mix absolute and relative timestamps. If the script uses
either only absolute timestamps (including the script start time) or only
relative ones, then its layout is fixed, and the conversion is
straightforward. On the other hand, if the script mixes both kind of
timestamps, then the @var{NOW} reference for relative timestamps will be
taken from the current time of day at the time the script is read, and the
script layout will be frozen according to that reference. That means that if
the script is directly played, the actual times will match the absolute
timestamps up to the sound controller's clock accuracy, but if the user
somehow pauses the playback or seeks, all times will be shifted accordingly.

@c man end INPUT DEVICES