demuxers.texi 3.74 KB
Newer Older
1 2 3
@chapter Demuxers
@c man begin DEMUXERS

4
Demuxers are configured elements in Libav which allow to read the
5 6
multimedia streams from a particular type of file.

7
When you configure your Libav build, all the supported demuxers
8 9 10 11 12 13 14 15
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}".

16
The option "-formats" of the av* tools will display the list of
17 18 19 20
enabled demuxers.

The description of some of the currently available demuxers follows.

21 22 23 24 25 26
@section image2

Image file demuxer.

This demuxer reads from a list of image files specified by a pattern.

27 28
The pattern may contain the string "%d" or "%0@var{N}d", which
specifies the position of the characters representing a sequential
29 30 31 32 33 34
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 "%%".

35 36 37 38
If the 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 0 and 4, all the following numbers must
be sequential. This limitation may be hopefully fixed.
39 40 41 42 43 44 45 46 47 48 49 50 51

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

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.

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

52
The following example shows how to use @command{avconv} for creating a
53 54 55 56
video from the images in the file sequence @file{img-001.jpeg},
@file{img-002.jpeg}, ..., assuming an input framerate of 10 frames per
second:
@example
57
avconv -i 'img-%03d.jpeg' -r 10 out.mkv
58 59
@end example

60 61 62 63
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
64
avconv -i img.jpeg img.png
65 66
@end example

67 68 69 70 71 72 73 74 75 76 77 78 79
@table @option
@item -pixel_format @var{format}
Set the pixel format (for raw image)
@item -video_size   @var{size}
Set the frame size (for raw image)
@item -framerate    @var{rate}
Set the frame rate
@item -loop         @var{bool}
Loop over the images
@item -start_number @var{start}
Specify the first number in the sequence
@end table

80 81 82 83 84 85
@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
Anton Khirnov's avatar
Anton Khirnov committed
86
the discard flags on AVStreams (by pressing 'a' or 'v' in avplay),
87
the caller can decide which variant streams to actually receive.
88 89
The total bitrate of the variant that the stream belongs to is
available in a metadata key named "variant_bitrate".
90

91 92 93 94 95 96 97
@section flv

Adobe Flash Video Format demuxer.

This demuxer is used to demux FLV files and RTMP network streams.

@table @option
98
@item -flv_metadata @var{bool}
99 100 101
Allocate the streams according to the onMetaData array content.
@end table

102 103 104 105 106 107 108 109 110 111 112
@section asf

Advanced Systems Format demuxer.

This demuxer is used to demux ASF files and MMS network streams.

@table @option
@item -no_resync_search @var{bool}
Do not try to resynchronize by looking for a certain optional start code.
@end table

113
@c man end INPUT DEVICES