?Flvid=102…

Ubuntu Manpage:
avconv - avconv video converter
Provided by:
avconv - avconv video converter
avconv [global options] [[infile options][-i infile]]... {[outfile
options] outfile}...
DESCRIPTION
avconv is a very fast video and audio converter that can also grab from
a live audio/video source. It can also convert between arbitrary sample
rates and resize video on the fly with a high quality polyphase filter.
avconv reads from an arbitrary number of input "files" (which can be
regular files, pipes, network streams, grabbing devices, etc.),
specified by the "-i" option, and writes to an arbitrary number of
output "files", which are specified by a plain output filename.
Anything found on the command line which cannot be interpreted as an
option is considered to be an output filename.
Each input or output file can in principle contain any number of
streams of different types (video/audio/subtitle/attachment/data).
Allowed number and/or types of streams can be limited by the container
format. Selecting, which streams from which inputs go into output, is
done either automatically or with the "-map" option (see the Stream
selection chapter).
To refer to input files in options, you must use their indices
(0-based). E.g.
the first input file is 0, the second is 1 etc.
Similarly, streams within a file are referred to by their indices. E.g.
"2:3" refers to the fourth stream in the third input file. See also the
Stream specifiers chapter.
As a general rule, options are applied to the next specified file.
Therefore, order is important, and you can have the same option on the
command line multiple times. Each occurrence is then applied to the
next input or output file.
Exceptions from this rule are the global
options (e.g. verbosity level), which should be specified first.
Do not mix input and output files -- first specify all input files,
then all output files. Also do not mix options which belong to
different files. All options apply ONLY to the next input or output
file and are reset between files.
To set the video bitrate of the output file to 64kbit/s:
avconv -i input.avi -b 64k output.avi
To force the frame rate of the output file to 24 fps:
avconv -i input.avi -r 24 output.avi
To force the frame rate of the input file (valid for raw formats
only) to 1 fps and the frame rate of the output file to 24 fps:
avconv -r 1 -i input.m2v -r 24 output.avi
The format option may be needed for raw input files.
STREAM SELECTION
By default avconv tries to pick the "best" stream of each type present
in input files and add them to each output file. For video, this means
the highest resolution, for audio the highest channel count. For
subtitle it's simply the first subtitle stream.
You can disable some of those defaults by using "-vn/-an/-sn" options.
For full manual control, use the "-map" option, which disables the
defaults just described.
All the numerical options, if not specified otherwise, accept in input
a string representing a number, which may contain one of the
International System number postfixes, for example 'K', 'M', 'G'.
'i' is appended after the postfix, powers of 2 are used instead of
powers of 10. The 'B' postfix multiplies the value for 8, and can be
appended after another postfix or used alone. This allows using for
example 'KB', 'MiB', 'G' and 'B' as postfix.
Options which do not take arguments are boolean options, and set the
corresponding value to true. They can be set to false by prefixing with
"no" the option name, for example using "-nofoo" in the command line
will set to false the boolean option with name "foo".
Stream specifiers
Some options are applied per-stream, e.g. bitrate or codec. Stream
specifiers are used to precisely specify which stream(s) does a given
option belong to.
A stream specifier is a string generally appended to the option name
and separated from it by a colon. E.g. "-codec:a:1 ac3" option contains
"a:1" stream specifer, which matches the second audio stream. Therefore
it would select the ac3 codec for the second audio stream.
A stream specifier can match several stream, the option is then applied
to all of them. E.g. the stream specifier in "-b:a 128k" matches all
audio streams.
An empty stream specifier matches all streams, for example "-codec
copy" or "-codec: copy" would copy all the streams without reencoding.
Possible forms of stream specifiers are:
stream_index
Matches the stream with this index. E.g. "-threads:1 4" would set
the thread count for the second stream to 4.
stream_type[:stream_index]
stream_type is one of: 'v' for video, 'a' for audio, 's' for
subtitle, 'd' for data and 't' for attachments. If stream_index is
given, then matches stream number stream_index of this type.
Otherwise matches all streams of this type.
p:program_id[:stream_index]
If stream_index is given, then matches stream number stream_index
in program with id program_id. Otherwise matches all streams in
this program.
Generic options
These options are shared amongst the av* tools.
Show license.
-h, -?, -help, --help
Show help.
Show version.
Show available formats.
The fields preceding the format names have the following meanings:
Decoding available
Encoding available
Show available codecs.
The fields preceding the codec names have the following meanings:
Decoding available
Encoding available
Video/audio/subtitle codec
Codec supports slices
Codec supports direct rendering
Codec can handle input truncated at random locations instead of
only at frame boundaries
Show available bitstream filters.
-protocols
Show available protocols.
Show available libavfilter filters.
Show available pixel formats.
-sample_fmts
Show available sample formats.
-loglevel loglevel | -v loglevel
Set the logging level used by the library.
loglevel is a number or
a string containing one of the following values:
By default the program logs to stderr, if coloring is supported by
the terminal, colors are used to mark errors and warnings. Log
coloring can be disabled setting the environment variable
AV_LOG_FORCE_NOCOLOR or NO_COLOR, or can be forced setting the
environment variable AV_LOG_FORCE_COLOR.
The use of the
environment variable NO_COLOR is deprecated and will be dropped in
a following Libav version.
These options are provided directly by the libavformat, libavdevice and
libavcodec libraries. To see the list of available AVOptions, use the
-help option. They are separated into two categories:
These options can be set for any container, codec or device.
Generic options are listed under AVFormatContext options for
containers/devices and under AVCodecContext options for codecs.
These options are specific to the given container, device or codec.
Private options are listed under their corresponding
containers/devices/codecs.
For example to write an ID3v2.3 header instead of a default ID3v2.4 to
an MP3 file, use the id3v2_version private option of the MP3 muxer:
avconv -i input.flac -id3v2_version 3 out.mp3
All codec AVOptions are obviously per-stream, so the chapter on stream
specifiers applies to them
Note -nooption syntax cannot be used for boolean AVOptions, use -option
0/-option 1.
Note2 old undocumented way of specifying per-stream AVOptions by
prepending v/a/s to the options name is now obsolete and will be
removed soon.
Main options
-f fmt (input/output)
Force input or output file format. The format is normally
autodetected for input files and guessed from file extension for
output files, so this option is not needed in most cases.
-i filename (input)
input file name
-y (global)
Overwrite output files without asking.
-c[:stream_specifier] codec (input/output,per-stream)
-codec[:stream_specifier] codec (input/output,per-stream)
Select an encoder (when used before an output file) or a decoder
(when used before an input file) for one or more streams. codec is
the name of a decoder/encoder or a special value "copy" (output
only) to indicate that the stream is not to be reencoded.
For example
avconv -i INPUT -map 0 -c:v libx264 -c:a copy OUTPUT
encodes all video streams with libx264 and copies all audio
For each stream, the last matching "c" option is applied, so
avconv -i INPUT -map 0 -c copy -c:v:1 libx264 -c:a:137 libvorbis OUTPUT
will copy all the streams except the second video, which will be
encoded with libx264, and the 138th audio, which will be encoded
with libvorbis.
-t duration (output)
Stop writing the output after its duration reaches duration.
duration may be a number in seconds, or in "hh:mm:ss[.xxx]" form.
-fs limit_size (output)
Set the file size limit.
-ss position (input/output)
When used as an input option (before "-i"), seeks in this input
file to position. When used as an output option (before an output
filename), decodes but discards input until the timestamps reach
position. This is slower, but more accurate.
position may be either in seconds or in "hh:mm:ss[.xxx]" form.
-itsoffset offset (input)
Set the input time offset in seconds.
"[-]hh:mm:ss[.xxx]" syntax
is also supported.
The offset is added to the timestamps of the
input files.
Specifying a positive offset means that the
corresponding streams are delayed by offset seconds.
-metadata[:metadata_specifier] key=value (output,per-metadata)
Set a metadata key/value pair.
An optional metadata_specifier may be given to set metadata on
streams or chapters. See "-map_metadata" documentation for details.
This option overrides metadata set with "-map_metadata". It is also
possible to delete metadata by using an empty value.
For example, for setting the title in the output file:
avconv -i in.avi -metadata title="my title" out.flv
To set the language of the first audio stream:
avconv -i INPUT -metadata:s:a:0 language=eng OUTPUT
-target type (output)
Specify target file type ("vcd", "svcd", "dvd", "dv", "dv50"). type
may be prefixed with "pal-", "ntsc-" or "film-" to use the
corresponding standard. All the format options (bitrate, codecs,
buffer sizes) are then set automatically. You can just type:
avconv -i myfile.avi -target vcd /tmp/vcd.mpg
Nevertheless you can specify additional options as long as you know
they do not conflict with the standard, as in:
avconv -i myfile.avi -target vcd -bf 2 /tmp/vcd.mpg
-dframes number (output)
Set the number of data frames to record. This is an alias for
"-frames:d".
-frames[:stream_specifier] framecount (output,per-stream)
Stop writing to the stream after framecount frames.
-q[:stream_specifier] q (output,per-stream)
-qscale[:stream_specifier] q (output,per-stream)
Use fixed quality scale (VBR). The meaning of q is codec-dependent.
-filter[:stream_specifier] filter_graph (output,per-stream)
filter_graph is a description of the filter graph to apply to the
stream. Use "-filters" to show all the available filters (including
also sources and sinks).
-pre[:stream_specifier] preset_name (output,per-stream)
Specify the preset for matching stream(s).
-stats (global)
Print encoding progress/statistics. On by default.
-attach filename (output)
Add an attachment to the output file. This is supported by a few
formats like Matroska for e.g. fonts used in rendering subtitles.
Attachments are implemented as a specific type of stream, so this
option will add a new stream to the file. It is then possible to
use per-stream options on this stream in the usual way. Attachment
streams created with this option will be created after all the
other streams (i.e. those created with "-map" or automatic
mappings).
Note that for Matroska you also have to set the mimetype metadata
avconv -i INPUT -attach DejaVuSans.ttf -metadata:s:2 mimetype=application/x-truetype-font out.mkv
(assuming that the attachment stream will be third in the output
-dump_attachment[:stream_specifier] filename (input,per-stream)
Extract the matching attachment stream into a file named filename.
If filename is empty, then the value of the "filename" metadata tag
will be used.
E.g. to extract the first attachment to a file named 'out.ttf':
avconv -dump_attachment:t:0 out.ttf INPUT
To extract all attachments to files determined by the "filename"
avconv -dump_attachment:t "" INPUT
Technical note -- attachments are implemented as codec extradata,
so this option can actually be used to extract extradata from any
stream, not just attachments.
Video Options
-vframes number (output)
Set the number of video frames to record. This is an alias for
"-frames:v".
-r[:stream_specifier] fps (input/output,per-stream)
Set frame rate (Hz value, fraction or abbreviation), (default =
-s[:stream_specifier] size (input/output,per-stream)
Set frame size. The format is wxh (default - same as source).
following abbreviations are recognized:
cif 352x288
vga 640x480
cga 320x200
ega 640x350
-aspect[:stream_specifier] aspect (output,per-stream)
Set the video display aspect ratio specified by aspect.
aspect can be a floating point number string, or a string of the
form num:den, where num and den are the numerator and denominator
of the aspect ratio. For example "4:3", "16:9", "1.3333", and
"1.7777" are valid argument values.
-vn (output)
Disable video recording.
-bt tolerance
Set video bitrate tolerance (in bits, default 4000k).
minimum value of: (target_bitrate/target_framerate).
mode, bitrate tolerance specifies how far ratecontrol is willing to
deviate from the target average bitrate value. This is not related
to min/max bitrate. Lowering tolerance too much has an adverse
effect on quality.
-maxrate bitrate
Set max video bitrate (in bit/s).
Requires -bufsize to be set.
-minrate bitrate
Set min video bitrate (in bit/s).
Most useful in setting up a CBR
avconv -i myfile.avi -b 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v
It is of little use elsewise.
-bufsize size
Set video buffer verifier buffer size (in bits).
-vcodec codec (output)
Set the video codec. This is an alias for "-codec:v".
-same_quant
Use same quantizer as source (implies VBR).
Note that this is NOT SAME QUALITY. Do not use this option unless
you know you need it.
Select the pass number (1 or 2). It is used to do two-pass video
encoding. The statistics of the video are recorded in the first
pass into a log file (see also the option -passlogfile), and in the
second pass that log file is used to generate the video at the
exact requested bitrate.
On pass 1, you may just deactivate audio
and set output to null, examples for Windows and Unix:
avconv -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y NUL
avconv -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y /dev/null
-passlogfile prefix (global)
Set two-pass log file name prefix to prefix, the default file name
prefix is ``av2pass''. The complete file name will be PREFIX-N.log,
where N is a number specific to the output stream.
-vf filter_graph (output)
filter_graph is a description of the filter graph to apply to the
input video.
Use the option "-filters" to show all the available
filters (including also sources and sinks).
This is an alias for
"-filter:v".
Advanced Video Options
-pix_fmt[:stream_specifier] format (input/output,per-stream)
Set pixel format. Use "-pix_fmts" to show all the supported pixel
-sws_flags flags (input/output)
Set SwScaler flags.
-g gop_size
Set the group of pictures size.
Discard threshold.
minimum video quantizer scale (VBR)
maximum video quantizer scale (VBR)
maximum difference between the quantizer scales (VBR)
-qblur blur
video quantizer scale blur (VBR) (range 0.0 - 1.0)
-qcomp compression
video quantizer scale compression (VBR) (default 0.5).
Constant of
ratecontrol equation. Recommended range for default rc_eq: 0.0-1.0
-lmin lambda
minimum video lagrange factor (VBR)
-lmax lambda
max video lagrange factor (VBR)
-mblmin lambda
minimum macroblock quantizer scale (VBR)
-mblmax lambda
maximum macroblock quantizer scale (VBR)
These four options (lmin, lmax, mblmin, mblmax) use 'lambda' units,
but you may use the QP2LAMBDA constant to easily convert from 'q'
avconv -i src.ext -lmax 21*QP2LAMBDA dst.ext
-rc_init_cplx complexity
initial complexity for single pass encoding
-b_qfactor factor
qp factor between P- and B-frames
-i_qfactor factor
qp factor between P- and I-frames
-b_qoffset offset
qp offset between P- and B-frames
-i_qoffset offset
qp offset between P- and I-frames
-rc_eq equation
Set rate control equation (see section "Expression Evaluation")
(default = "tex^qComp").
When computing the rate control equation expression, besides the
standard functions defined in the section "Expression Evaluation",
the following functions are available:
bits2qp(bits)
qp2bits(qp)
and the following constants are available:
-rc_override[:stream_specifier] override (output,per-stream)
rate control override for specific intervals
-me_method method
Set motion estimation method to method.
Available methods are
(from lowest to best quality):
Try just the (0, 0) vector.
(default method)
exhaustive search (slow and marginally better than epzs)
Set error resilience to n.
FF_ER_CAREFUL (default)
FF_ER_COMPLIANT
FF_ER_AGGRESSIVE
FF_ER_VERY_AGGRESSIVE
-ec bit_mask
Set error concealment to bit_mask. bit_mask is a bit mask of the
following values:
FF_EC_GUESS_MVS (default = enabled)
FF_EC_DEBLOCK (default = enabled)
-bf frames
Use 'frames' B-frames (supported for MPEG-1, MPEG-2 and MPEG-4).
macroblock decision
FF_MB_DECISION_SIMPLE: Use mb_cmp (cannot change it yet in
FF_MB_DECISION_BITS: Choose the one which needs the fewest
FF_MB_DECISION_RD: rate distortion
-bug param
Work around encoder bugs that are not auto-detected.
-strict strictness
How strictly to follow the standards.
-deinterlace
Deinterlace pictures.
Dump video coding statistics to vstats_HHMMSS.log.
-vstats_file file
Dump video coding statistics to file.
-top[:stream_specifier] n (output,per-stream)
top=1/bottom=0/auto=-1 field first
-dc precision
Intra_dc_precision.
-vtag fourcc/tag (output)
Force video tag/fourcc. This is an alias for "-tag:v".
-qphist (global)
Show QP histogram.
-force_key_frames[:stream_specifier] time[,time...] (output,per-stream)
Force key frames at the specified timestamps, more precisely at the
first frames after each specified time.
This option can be useful
to ensure that a seek point is present at a chapter mark or any
other designated place in the output file.
The timestamps must be
specified in ascending order.
-copyinkf[:stream_specifier] (output,per-stream)
When doing stream copy, copy also non-key frames found at the
beginning.
Audio Options
-aframes number (output)
Set the number of audio frames to record. This is an alias for
"-frames:a".
-ar[:stream_specifier] freq (input/output,per-stream)
Set the audio sampling frequency. For output streams it is set by
default to the frequency of the corresponding input stream. For
input streams this option only makes sense for audio grabbing
devices and raw demuxers and is mapped to the corresponding demuxer
-aq q (output)
Set the audio quality (codec-specific, VBR). This is an alias for
-ac[:stream_specifier] channels (input/output,per-stream)
Set the number of audio channels. For output streams it is set by
default to the number of input audio channels. For input streams
this option only makes sense for audio grabbing devices and raw
demuxers and is mapped to the corresponding demuxer options.
-an (output)
Disable audio recording.
-acodec codec (input/output)
Set the audio codec. This is an alias for "-codec:a".
-sample_fmt[:stream_specifier] sample_fmt (output,per-stream)
Set the audio sample format. Use "-sample_fmts" to get a list of
supported sample formats.
Advanced Audio options:
-atag fourcc/tag (output)
Force audio tag/fourcc. This is an alias for "-tag:a".
-audio_service_type type
Set the type of service that the audio stream contains.
Main Audio Service (default)
Visually Impaired
Hearing Impaired
Commentary
Voice Over
Subtitle options:
-scodec codec (input/output)
Set the subtitle codec. This is an alias for "-codec:s".
-sn (output)
Disable subtitle recording.
Audio/Video grab options
-isync (global)
Synchronize read on input.
Advanced options
[-]input_file_id[:stream_specifier][,sync_file_id[:stream_specifier]]
Designate one or more input streams as a source for the output
file. Each input stream is identified by the input file index
input_file_id and the input stream index input_stream_id within the
input file. Both indices start at 0. If specified,
sync_file_id:stream_specifier sets which input stream is used as a
presentation sync reference.
The first "-map" option on the command line specifies the source
for output stream 0, the second "-map" option specifies the source
for output stream 1, etc.
A "-" character before the stream identifier creates a "negative"
It disables matching streams from already created
For example, to map ALL streams from the first input file to output
avconv -i INPUT -map 0 output
For example, if you have two audio streams in the first input file,
these streams are identified by "0:0" and "0:1". You can use "-map"
to select which streams to place in an output file. For example:
avconv -i INPUT -map 0:1 out.wav
will map the input stream in INPUT identified by "0:1" to the
(single) output stream in out.wav.
For example, to select the stream with index 2 from input file
a.mov (specified by the identifier "0:2"), and stream with index 6
from input b.mov (specified by the identifier "1:6"), and copy them
to the output file out.mov:
avconv -i a.mov -i b.mov -c copy -map 0:2 -map 1:6 out.mov
To select all video and the third audio stream from an input file:
avconv -i INPUT -map 0:v -map 0:a:2 OUTPUT
To map all the streams except the second audio, use negative
avconv -i INPUT -map 0 -map -0:a:1 OUTPUT
Note that using this option disables the default mappings for this
output file.
-map_metadata[:metadata_spec_out] infile[:metadata_spec_in]
(output,per-metadata)
Set metadata information of the next output file from infile. Note
that those are file indices (zero-based), not filenames.
metadata_spec_in/out parameters specify, which metadata to copy.
metadata specifier can have the following forms:
global metadata, i.e. metadata that applies to the whole file
s[:stream_spec]
per-stream metadata. stream_spec is a stream specifier as
described in the Stream specifiers chapter. In an input
metadata specifier, the first matching stream is copied from.
In an output metadata specifier, all matching streams are
copied to.
c:chapter_index
per-chapter metadata. chapter_index is the zero-based chapter
p:program_index
per-program metadata. program_index is the zero-based program
If metadata specifier is omitted, it defaults to global.
By default, global metadata is copied from the first input file,
per-stream and per-chapter metadata is copied along with
streams/chapters. These default mappings are disabled by creating
any mapping of the relevant type. A negative file index can be used
to create a dummy mapping that just disables automatic copying.
For example to copy metadata from the first stream of the input
file to global metadata of the output file:
avconv -i in.ogg -map_metadata 0:s:0 out.mp3
To do the reverse, i.e. copy global metadata to all audio streams:
avconv -i in.mkv -map_metadata:s:a 0:g out.mkv
Note that simple 0 would work as well in this example, since global
metadata is assumed by default.
-map_chapters input_file_index (output)
Copy chapters from input file with index input_file_index to the
next output file. If no chapter mapping is specified, then chapters
are copied from the first input file with at least one chapter. Use
a negative file index to disable any chapter copying.
Print specific debug info.
-benchmark (global)
Show benchmarking information at the end of an encode.
time used and maximum memory consumption.
Maximum memory
consumption is not supported on all systems, it will usually
display as 0 if not supported.
-timelimit duration (global)
Exit after avconv has been running for duration seconds.
-dump (global)
Dump each input packet to stderr.
-hex (global)
When dumping packets, also dump the payload.
Set RTP payload size in bytes.
-re (input)
Read input at native frame rate. Mainly used to simulate a grab
-threads count
Thread count.
-vsync parameter
Video sync method.
passthrough
Each frame is passed with its timestamp from the demuxer to the
cfr Frames will be duplicated and dropped to achieve exactly the
requested constant framerate.
vfr Frames are passed through with their timestamp or dropped so as
to prevent 2 frames from having the same timestamp.
Chooses between 1 and 2 depending on muxer capabilities. This
is the default method.
With -map you can select from which stream the timestamps should be
taken. You can leave either video or audio unchanged and sync the
remaining stream(s) to the unchanged one.
-async samples_per_second
Audio sync method. "Stretches/squeezes" the audio stream to match
the timestamps, the parameter is the maximum samples per second by
which the audio is changed.
-async 1 is a special case where only
the start of the audio stream is corrected without any later
correction.
Copy timestamps from input to output.
Copy input stream time base from input to output when stream
Finish encoding when the shortest input stream ends.
-dts_delta_threshold
Timestamp discontinuity delta threshold.
-muxdelay seconds (input)
Set the maximum demux-decode delay.
-muxpreload seconds (input)
Set the initial demux-decode delay.
-streamid output-stream-index:new-value (output)
Assign a new stream-id value to an output stream. This option
should be specified prior to the output filename to which it
For the situation where multiple output files exist, a
streamid may be reassigned to a different value.
For example, to set the stream 0 PID to 33 and the stream 1 PID to
36 for an output mpegts file:
avconv -i infile -streamid 0:33 -streamid 1:36 out.ts
-bsf[:stream_specifier] bitstream_filters (output,per-stream)
Set bitstream filters for matching streams. bistream_filters is a
comma-separated list of bitstream filters. Use the "-bsfs" option
to get the list of bitstream filters.
avconv -i h264.mp4 -c:v copy -vbsf h264_mp4toannexb -an out.h264
avconv -i file.mov -an -vn -sbsf mov2textsub -c:s copy -f rawvideo sub.txt
-tag[:stream_specifier] codec_tag (output,per-stream)
Force a tag/fourcc for matching streams.
For streaming at very low bitrate application, use a low frame rate
and a small GOP size. This is especially true for RealVideo where
the Linux player does not seem to be very fast, so it can miss
frames. An example is:
avconv -g 3 -r 3 -t 10 -b 50k -s qcif -f rv10 /tmp/b.rm
The parameter 'q' which is displayed while encoding is the current
quantizer. The value 1 indicates that a very good quality could be
achieved. The value 31 indicates the worst quality. If q=31 appears
too often, it means that the encoder cannot compress enough to meet
your bitrate. You must either increase the bitrate, decrease the
frame rate or decrease the frame size.
If your computer is not fast enough, you can speed up the
compression at the expense of the compression ratio. You can use
'-me zero' to speed up motion estimation, and '-intra' to disable
motion estimation completely (you have only I-frames, which means
it is about as good as JPEG compression).
To have very low audio bitrates, reduce the sampling frequency
(down to 22050 Hz for MPEG audio, 22050 or 11025 for AC-3).
To have a constant quality (but a variable bitrate), use the option
'-qscale n' when 'n' is between 1 (excellent quality) and 31 (worst
Preset files
A preset file contains a sequence of option=value pairs, one for each
line, specifying a sequence of options which can be specified also on
the command line. Lines starting with the hash ('#') character are
ignored and are used to provide comments. Empty lines are also ignored.
Check the presets directory in the Libav source tree for examples.
Preset files are specified with the "pre" option, this option takes a
preset name as input.
Avconv searches for a file named
preset_name.avpreset in the directories $AVCONV_DATADIR (if set), and
$HOME/.avconv, and in the data directory defined at configuration time
(usually $PREFIX/share/avconv) in that order.
For example, if the
argument is "libx264-max", it will search for the file
libx264-max.avpreset.
Video and Audio grabbing
If you specify the input format and device then avconv can grab video
and audio directly.
avconv -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 /tmp/out.mpg
Note that you must activate the right video source and channel before
launching avconv with any TV viewer such as
xawtv ("") by Gerd Knorr. You also have
to set the audio recording levels correctly with a standard mixer.
X11 grabbing
Grab the X11 display with avconv via
avconv -f x11grab -s cif -r 25 -i :0.0 /tmp/out.mpg
0.0 is display.screen number of your X11 server, same as the DISPLAY
environment variable.
avconv -f x11grab -s cif -r 25 -i :0.0+10,20 /tmp/out.mpg
0.0 is display.screen number of your X11 server, same as the DISPLAY
environment variable. 10 is the x-offset and 20 the y-offset for the
Video and Audio file format conversion
Any supported file format and protocol can serve as input to avconv:
You can use YUV files as input:
avconv -i /tmp/test%d.Y /tmp/out.mpg
It will use the files:
/tmp/test0.Y, /tmp/test0.U, /tmp/test0.V,
/tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc...
The Y files use twice the resolution of the U and V files. They are
raw files, without header. They can be generated by all decent
video decoders. You must specify the size of the image with the -s
option if avconv cannot guess it.
You can input from a raw YUV420P file:
avconv -i /tmp/test.yuv /tmp/out.avi
test.yuv is a file containing raw YUV planar data. Each frame is
composed of the Y plane followed by the U and V planes at half
vertical and horizontal resolution.
You can output to a raw YUV420P file:
avconv -i mydivx.avi hugefile.yuv
You can set several input files and output files:
avconv -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg
Converts the audio file a.wav and the raw YUV video file a.yuv to
MPEG file a.mpg.
You can also do audio and video conversions at the same time:
avconv -i /tmp/a.wav -ar 22050 /tmp/a.mp2
Converts a.wav to MPEG audio at 22050 Hz sample rate.
You can encode to several formats at the same time and define a
mapping from input stream to output streams:
avconv -i /tmp/a.wav -map 0:a -b 64k /tmp/a.mp2 -map 0:a -b 128k /tmp/b.mp2
Converts a.wav to a.mp2 at 64 kbits and to b.mp2 at 128 kbits.
'-map file:index' specifies which input stream is used for each
output stream, in the order of the definition of output streams.
You can transcode decrypted VOBs:
avconv -i snatch_1.vob -f avi -c:v mpeg4 -b:v 800k -g 300 -bf 2 -c:a libmp3lame -b:a 128k snatch.avi
This is a typical DVD the input is a VOB file, the
output an AVI file with MPEG-4 video and MP3 audio. Note that in
this command we use B-frames so the MPEG-4 stream is DivX5
compatible, and GOP size is 300 which means one intra frame every
10 seconds for 29.97fps input video. Furthermore, the audio stream
is MP3-encoded so you need to enable LAME support by passing
"--enable-libmp3lame" to configure.
The mapping is particularly
useful for DVD transcoding to get the desired audio language.
NOTE: To see the supported input formats, use "avconv -formats".
You can extract images from a video, or create a video from many
For extracting images from a video:
avconv -i foo.avi -r 1 -s WxH -f image2 foo-%03d.jpeg
This will extract one video frame per second from the video and
will output them in files named foo-001.jpeg, foo-002.jpeg, etc.
Images will be rescaled to fit the new WxH values.
If you want to extract just a limited number of frames, you can use
the above command in combination with the -vframes or -t option, or
in combination with -ss to start extracting from a certain point in
For creating a video from many images:
avconv -f image2 -i foo-%03d.jpeg -r 12 -s WxH foo.avi
The syntax "foo-%03d.jpeg" specifies to use a decimal number
composed of three digits padded with zeroes to express the sequence
number. It is the same syntax supported by the C printf function,
but only formats accepting a normal integer are suitable.
You can put many streams of the same type in the output:
avconv -i test1.avi -i test2.avi -map 0.3 -map 0.2 -map 0.1 -map 0.0 -c copy test12.nut
The resulting output file test12.avi will contain first four
streams from the input file in reverse order.
EXPRESSION EVALUATION
When evaluating an arithmetic expression, Libav uses an internal
formula evaluator, implemented through the libavutil/eval.h interface.
An expression may contain unary, binary operators, constants, and
functions.
Two expressions expr1 and expr2 can be combined to form another
expression "expr1;expr2".
expr1 and expr2 are evaluated in turn, and
the new expression evaluates to the value of expr2.
The following binary operators are available: "+", "-", "*", "/", "^".
The following unary operators are available: "+", "-".
The following functions are available:
Return 1.0 if x is NAN, 0.0 otherwise.
st(var, expr)
Allow to store the value of the expression expr in an internal
variable. var specifies the number of the variable where to store
the value, and it is a value ranging from 0 to 9. The function
returns the value stored in the internal variable.
Allow to load the value of the internal variable with number var,
which was previously stored with st(var, expr).
The function
returns the loaded value.
while(cond, expr)
Evaluate expression expr while the expression cond is non-zero, and
returns the value of the last expr evaluation, or NAN if cond was
always false.
ceil(expr)
Round the value of expression expr upwards to the nearest integer.
For example, "ceil(1.5)" is "2.0".
floor(expr)
Round the value of expression expr downwards to the nearest
integer. For example, "floor(-1.5)" is "-2.0".
trunc(expr)
Round the value of expression expr towards zero to the nearest
integer. For example, "trunc(-1.5)" is "-1.0".
sqrt(expr)
Compute the square root of expr. This is equivalent to "(expr)^.5".
Return 1.0 if expr is zero, 0.0 otherwise.
Note that:
"*" works like AND
"+" works like OR
if A then B else C
is equivalent to
A*B + not(A)*C
In your C code, you can extend the list of unary and binary functions,
and define recognized constants, so that they are available for your
expressions.
The evaluator also recognizes the International System number
postfixes. If 'i' is appended after the postfix, powers of 2 are used
instead of powers of 10. The 'B' postfix multiplies the value for 8,
and can be appended after another postfix or used alone. This allows
using for example 'KB', 'MiB', 'G' and 'B' as postfix.
Follows the list of available International System postfixes, with
indication of the corresponding powers of 10 and of 2.
Encoders are configured elements in Libav which allow the encoding of
multimedia streams.
When you configure your Libav build, all the supported native encoders
are enabled by default. Encoders requiring an external library must be
enabled manually via the corresponding "--enable-lib" option. You can
list all available encoders using the configure option
"--list-encoders".
You can disable all the encoders with the configure option
"--disable-encoders" and selectively enable / disable single encoders
with the options "--enable-encoder=ENCODER" /
"--disable-encoder=ENCODER".
The option "-codecs" of the ff* tools will display the list of enabled
AUDIO ENCODERS
A description of some of the currently available audio encoders
ac3 and ac3_fixed
AC-3 audio encoders.
These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as
well as the undocumented RealAudio 3 (a.k.a. dnet).
The ac3 encoder uses floating-point math, while the ac3_fixed encoder
only uses fixed-point integer math. This does not mean that one is
always faster, just that one or the other may be better suited to a
particular system. The floating-point encoder will generally produce
better quality audio for a given bitrate. The ac3_fixed encoder is not
the default codec for any of the output formats, so it must be
specified explicitly using the option "-acodec ac3_fixed" in order to
AC-3 Metadata
The AC-3 metadata options are used to set parameters that describe the
audio, but in most cases do not affect the audio encoding itself. Some
of the options do directly affect or influence the decoding and
playback of the resulting bitstream, while others are just for
informational purposes. A few of the options will add bits to the
output stream that could otherwise be used for audio data, and will
thus affect the quality of the output. Those will be indicated
accordingly with a note in the option list below.
These parameters are described in detail in several publicly-available
documents.
*&A/52:2010 - Digital Audio Compression (AC-3) (E-AC-3) Standard
*&A/54 - Guide to the Use of the ATSC Digital Television Standard
*&Dolby Metadata Guide
*&Dolby Digital Professional Encoding Guidelines
Metadata Control Options
-per_frame_metadata boolean
Allow Per-Frame Metadata. Specifies if the encoder should check for
changing metadata for each frame.
The metadata values set at initialization will be used for
every frame in the stream. (default)
Metadata values can be changed before encoding each frame.
Downmix Levels
-center_mixlev level
Center Mix Level. The amount of gain the decoder should apply to
the center channel when downmixing to stereo. This field will only
be written to the bitstream if a center channel is present. The
value is specified as a scale factor. There are 3 valid values:
Apply -3dB gain
Apply -4.5dB gain (default)
Apply -6dB gain
-surround_mixlev level
Surround Mix Level. The amount of gain the decoder should apply to
the surround channel(s) when downmixing to stereo. This field will
only be written to the bitstream if one or more surround channels
are present. The value is specified as a scale factor.
There are 3
valid values:
Apply -3dB gain
Apply -6dB gain (default)
Silence Surround Channel(s)
Audio Production Information
Audio Production Information is optional information describing the
mixing environment.
Either none or both of the fields are written to
the bitstream.
-mixing_level number
Mixing Level. Specifies peak sound pressure level (SPL) in the
production environment when the mix was mastered. Valid values are
80 to 111, or -1 for unknown or not indicated. The default value is
-1, but that value cannot be used if the Audio Production
Information is written to the bitstream. Therefore, if the
"room_type" option is not the default value, the "mixing_level"
option must not be -1.
-room_type type
Room Type. Describes the equalization used during the final mixing
session at the studio or on the dubbing stage. A large room is a
dubbing stage with the industry standard X- a
small room has flat equalization.
This field will not be written
to the bitstream if both the "mixing_level" option and the
"room_type" option have the default values.
notindicated
Not Indicated (default)
Large Room
Small Room
Other Metadata Options
-copyright boolean
Copyright Indicator. Specifies whether a copyright exists for this
off No Copyright Exists (default)
Copyright Exists
-dialnorm value
Dialogue Normalization. Indicates how far the average dialogue
level of the program is below digital 100% full scale (0 dBFS).
This parameter determines a level shift during audio reproduction
that sets the average volume of the dialogue to a preset level. The
goal is to match volume level between program sources. A value of
-31dB will result in no volume level change, relative to the source
volume, during audio reproduction. Valid values are whole numbers
in the range -31 to -1, with -31 being the default.
-dsur_mode mode
Dolby Surround Mode. Specifies whether the stereo signal uses Dolby
Surround (Pro Logic). This field will only be written to the
bitstream if the audio stream is stereo. Using this option does NOT
mean the encoder will actually apply Dolby Surround processing.
notindicated
Not Indicated (default)
off Not Dolby Surround Encoded
Dolby Surround Encoded
-original boolean
Original Bit Stream Indicator. Specifies whether this audio is from
the original source and not a copy.
off Not Original Source
Original Source (default)
Extended Bitstream Information
The extended bitstream options are part of the Alternate Bit Stream
Syntax as specified in Annex D of the A/52:2010 standard. It is grouped
into 2 parts.
If any one parameter in a group is specified, all values
in that group will be written to the bitstream.
Default values are
used for those that are written but have not been specified.
mixing levels are written, the decoder will use these values instead of
the ones specified in the "center_mixlev" and "surround_mixlev" options
if it supports the Alternate Bit Stream Syntax.
Extended Bitstream Information - Part 1
-dmix_mode mode
Preferred Stereo Downmix Mode. Allows the user to select either
Lt/Rt (Dolby Surround) or Lo/Ro (normal stereo) as the preferred
stereo downmix mode.
notindicated
Not Indicated (default)
Lt/Rt Downmix Preferred
Lo/Ro Downmix Preferred
-ltrt_cmixlev level
Lt/Rt Center Mix Level. The amount of gain the decoder should apply
to the center channel when downmixing to stereo in Lt/Rt mode.
Apply +3dB gain
Apply +1.5dB gain
Apply 0dB gain
Apply -1.5dB gain
Apply -3.0dB gain
Apply -4.5dB gain (default)
Apply -6.0dB gain
Silence Center Channel
-ltrt_surmixlev level
Lt/Rt Surround Mix Level. The amount of gain the decoder should
apply to the surround channel(s) when downmixing to stereo in Lt/Rt
Apply -1.5dB gain
Apply -3.0dB gain
Apply -4.5dB gain
Apply -6.0dB gain (default)
Silence Surround Channel(s)
-loro_cmixlev level
Lo/Ro Center Mix Level. The amount of gain the decoder should apply
to the center channel when downmixing to stereo in Lo/Ro mode.
Apply +3dB gain
Apply +1.5dB gain
Apply 0dB gain
Apply -1.5dB gain
Apply -3.0dB gain
Apply -4.5dB gain (default)
Apply -6.0dB gain
Silence Center Channel
-loro_surmixlev level
Lo/Ro Surround Mix Level. The amount of gain the decoder should
apply to the surround channel(s) when downmixing to stereo in Lo/Ro
Apply -1.5dB gain
Apply -3.0dB gain
Apply -4.5dB gain
Apply -6.0dB gain (default)
Silence Surround Channel(s)
Extended Bitstream Information - Part 2
-dsurex_mode mode
Dolby Surround EX Mode. Indicates whether the stream uses Dolby
Surround EX (7.1 matrixed to 5.1). Using this option does NOT mean
the encoder will actually apply Dolby Surround EX processing.
notindicated
Not Indicated (default)
Dolby Surround EX Off
off Dolby Surround EX On
-dheadphone_mode mode
Dolby Headphone Mode. Indicates whether the stream uses Dolby
Headphone encoding (multi-channel matrixed to 2.0 for use with
headphones). Using this option does NOT mean the encoder will
actually apply Dolby Headphone processing.
notindicated
Not Indicated (default)
Dolby Headphone Off
off Dolby Headphone On
-ad_conv_type type
A/D Converter Type. Indicates whether the audio has passed through
HDCD A/D conversion.
Standard A/D Converter (default)
HDCD A/D Converter
Other AC-3 Encoding Options
-stereo_rematrixing boolean
Stereo Rematrixing. Enables/Disables use of rematrixing for stereo
input. This is an optional AC-3 feature that increases quality by
selectively encoding the left/right channels as mid/side. This
option is enabled by default, and it is highly recommended that it
be left as enabled except for testing purposes.
Floating-Point-Only AC-3 Encoding Options
These options are only valid for the floating-point encoder and do not
exist for the fixed-point encoder due to the corresponding features not
being implemented in fixed-point.
-channel_coupling boolean
Enables/Disables use of channel coupling, which is an optional AC-3
feature that increases quality by combining high frequency
information from multiple channels into a single channel. The per-
channel high frequency information is sent with less accuracy in
both the frequency and time domains. This allows more bits to be
used for lower frequencies while preserving enough information to
reconstruct the high frequencies. This option is enabled by default
for the floating-point encoder and should generally be left as
enabled except for testing purposes or to increase encoding speed.
Selected by Encoder (default)
off Disable Channel Coupling
Enable Channel Coupling
-cpl_start_band number
Coupling Start Band. Sets the channel coupling start band, from 1
to 15. If a value higher than the bandwidth is used, it will be
reduced to 1 less than the coupling end band. If auto is used, the
start band will be determined by the encoder based on the bit rate,
sample rate, and channel layout. This option has no effect if
channel coupling is disabled.
Selected by Encoder (default)
Demuxers are configured elements in Libav which allow to read the
multimedia streams from a particular type of file.
When you configure your Libav 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=DEMUXER", or disable it with the option
"--disable-demuxer=DEMUXER".
The option "-formats" of the ff* tools will display the list of enabled
The description of some of the currently available demuxers follows.
Image file demuxer.
This demuxer reads from a list of image files specified by a pattern.
The pattern may contain the string "%d" or "%0Nd", which specifies the
position of the characters representing a sequential number in each
filename matched by the pattern. If the form "%d0Nd" is used, the
string representing the number in each filename is 0-padded and 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 pattern contains "%d" or "%0Nd", 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.
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 img-001.bmp, img-002.bmp, ..., img-010.bmp, etc.;
the pattern "i%%m%%g-%d.jpg" will match a sequence of filenames of the
form i%m%g-1.jpg, i%m%g-2.jpg, ..., 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.
The following example shows how to use avconv for creating a video from
the images in the file sequence img-001.jpeg, img-002.jpeg, ...,
assuming an input framerate of 10 frames per second:
avconv -i 'img-%03d.jpeg' -r 10 out.mkv
Note that the pattern must not necessarily contain "%d" or "%0Nd", for
example to convert a single image file img.jpeg you can employ the
avconv -i img.jpeg img.png
Apple HTTP Live Streaming demuxer.
This demuxer presents all AVStreams from all variant streams.
field is set to the bitrate variant index number. By setting the
discard flags on AVStreams (by pressing 'a' or 'v' in avplay), the
caller can decide which variant streams to actually receive.
bitrate of the variant that the stream belongs to is available in a
metadata key named "variant_bitrate".
Muxers are configured elements in Libav which allow writing multimedia
streams to a particular type of file.
When you configure your Libav build, all the supported muxers are
enabled by default. You can list all available muxers using the
configure option "--list-muxers".
You can disable all the muxers with the configure option
"--disable-muxers" and selectively enable / disable single muxers with
the options "--enable-muxer=MUXER" / "--disable-muxer=MUXER".
The option "-formats" of the ff* tools will display the list of enabled
A description of some of the currently available muxers follows.
CRC (Cyclic Redundancy Check) testing format.
This muxer computes and prints the Adler-32 CRC of all the input audio
and video frames. By default audio frames are converted to signed
16-bit raw audio and video frames to raw video before computing the
The output of the muxer consists of a single line of the form:
CRC=0xCRC, where CRC is a hexadecimal number 0-padded to 8 digits
containing the CRC for all the decoded input frames.
For example to compute the CRC of the input, and store it in the file
avconv -i INPUT -f crc out.crc
You can print the CRC to stdout with the command:
avconv -i INPUT -f crc -
You can select the output format of each frame with avconv by
specifying the audio and video codec and format. For example to compute
the CRC of the input audio converted to PCM unsigned 8-bit and the
input video converted to MPEG-2 video, use the command:
avconv -i INPUT -c:a pcm_u8 -c:v mpeg2video -f crc -
See also the framecrc muxer.
Per-frame CRC (Cyclic Redundancy Check) testing format.
This muxer computes and prints the Adler-32 CRC for each decoded audio
and video frame. By default audio frames are converted to signed 16-bit
raw audio and video frames to raw video before computing the CRC.
The output of the muxer consists of a line for each audio and video
frame of the form: stream_index, frame_dts, frame_size, 0xCRC, where
CRC is a hexadecimal number 0-padded to 8 digits containing the CRC of
the decoded frame.
For example to compute the CRC of each decoded frame in the input, and
store it in the file out.crc:
avconv -i INPUT -f framecrc out.crc
You can print the CRC of each decoded frame to stdout with the command:
avconv -i INPUT -f framecrc -
You can select the output format of each frame with avconv by
specifying the audio and video codec and format. For example, to
compute the CRC of each decoded input audio frame converted to PCM
unsigned 8-bit and of each decoded input video frame converted to
MPEG-2 video, use the command:
avconv -i INPUT -c:a pcm_u8 -c:v mpeg2video -f framecrc -
See also the crc muxer.
Image file muxer.
The image file muxer writes video frames to image files.
The output filenames are specified by a pattern, which can be used to
produce sequentially numbered series of files.
The pattern may contain
the string "%d" or "%0Nd", this string specifies the position of the
characters representing a numbering in the filenames. If the form
"%0Nd" is used, the string representing the number in each filename is
0-padded to N digits. The literal character '%' can be specified in the
pattern with the string "%%".
If the pattern contains "%d" or "%0Nd", the first filename of the file
list specified will contain the number 1, all the following numbers
will be sequential.
The pattern may contain a suffix which is used to automatically
determine the format of the image files to write.
For example the pattern "img-%03d.bmp" will specify a sequence of
filenames of the form img-001.bmp, img-002.bmp, ..., img-010.bmp, etc.
The pattern "img%%-%d.jpg" will specify a sequence of filenames of the
form img%-1.jpg, img%-2.jpg, ..., img%-10.jpg, etc.
The following example shows how to use avconv for creating a sequence
of files img-001.jpeg, img-002.jpeg, ..., taking one image every second
from the input video:
avconv -i in.avi -vsync 1 -r 1 -f image2 'img-%03d.jpeg'
Note that with avconv, if the format is not specified with the "-f"
option and the output filename specifies an image file format, the
image2 muxer is automatically selected, so the previous command can be
written as:
avconv -i in.avi -vsync 1 -r 1 'img-%03d.jpeg'
Note also that the pattern must not necessarily contain "%d" or "%0Nd",
for example to create a single image file img.jpeg from the input video
you can employ the command:
avconv -i in.avi -f image2 -frames:v 1 img.jpeg
MPEG transport stream muxer.
This muxer implements ISO 13818-1 and part of ETSI EN 300 468.
The muxer options are:
-mpegts_original_network_id number
Set the original_network_id (default 0x0001). This is unique
identifier of a network in DVB. Its main use is in the unique
identification of a service through the path Original_Network_ID,
Transport_Stream_ID.
-mpegts_transport_stream_id number
Set the transport_stream_id (default 0x0001). This identifies a
transponder in DVB.
-mpegts_service_id number
Set the service_id (default 0x0001) also known as program in DVB.
-mpegts_pmt_start_pid number
Set the first PID for PMT (default 0x1000, max 0x1f00).
-mpegts_start_pid number
Set the first PID for data packets (default 0x0100, max 0x0f00).
The recognized metadata settings in mpegts muxer are "service_provider"
and "service_name". If they are not set the default for
"service_provider" is "Libav" and the default for "service_name" is
"Service01".
avconv -i file.mpg -c copy \
-mpegts_original_network_id 0x1122 \
-mpegts_transport_stream_id 0x3344 \
-mpegts_service_id 0x5566 \
-mpegts_pmt_start_pid 0x1500 \
-mpegts_start_pid 0x150 \
-metadata service_provider="Some provider" \
-metadata service_name="Some Channel" \
Null muxer.
This muxer does not generate any output file, it is mainly useful for
testing or benchmarking purposes.
For example to benchmark decoding with avconv you can use the command:
avconv -benchmark -i INPUT -f null out.null
Note that the above command does not read or write the out.null file,
but specifying the output file is required by the avconv syntax.
Alternatively you can write the command as:
avconv -benchmark -i INPUT -f null -
Matroska container muxer.
This muxer implements the matroska and webm container specs.
The recognized metadata settings in this muxer are:
title=title name
Name provided to a single track
language=language name
Specifies the language of the track in the Matroska languages form
STEREO_MODE=mode
Stereo 3D video layout of two views in a single video track
video is not stereo
left_right
Both views are arranged side by side, Left-eye view is on the
bottom_top
Both views are arranged in top-bottom orientation, Left-eye
view is at bottom
top_bottom
Both views are arranged in top-bottom orientation, Left-eye
view is on top
checkerboard_rl
Each view is arranged in a checkerboard interleaved pattern,
Left-eye view being first
checkerboard_lr
Each view is arranged in a checkerboard interleaved pattern,
Right-eye view being first
row_interleaved_rl
Each view is constituted by a row based interleaving, Right-eye
view is first row
row_interleaved_lr
Each view is constituted by a row based interleaving, Left-eye
view is first row
col_interleaved_rl
Both views are arranged in a column based interleaving manner,
Right-eye view is first column
col_interleaved_lr
Both views are arranged in a column based interleaving manner,
Left-eye view is first column
anaglyph_cyan_red
All frames are in anaglyph format viewable through red-cyan
right_left
Both views are arranged side by side, Right-eye view is on the
anaglyph_green_magenta
All frames are in anaglyph format viewable through green-
magenta filters
Both eyes laced in one Block, Left-eye view is first
Both eyes laced in one Block, Right-eye view is first
For example a 3D WebM clip can be created using the following command
avconv -i sample_left_right_clip.mpg -an -c:v libvpx -metadata STEREO_MODE=left_right -y stereo_clip.webm
Basic stream segmenter.
The segmenter muxer outputs streams to a number of separate files of
nearly fixed duration. Output filename pattern can be set in a fashion
similar to image2.
Every segment starts with a video keyframe, if a video stream is
The segment muxer works best with a single constant frame
rate video.
Optionally it can generate a flat list of the created segments, one
segment per line.
segment_format format
Override the inner container format, by default it is guessed by
the filename extension.
segment_time t
Set segment duration to t seconds.
segment_list name
Generate also a listfile named name.
segment_list_size size
Overwrite the listfile once it reaches size entries.
avconv -i in.mkv -c copy -map 0 -f segment -list out.list out%03d.nut
INPUT DEVICES
Input devices are configured elements in Libav which allow to access
the data coming from a multimedia device attached to your system.
When you configure your Libav build, all the supported input devices
are enabled by default. You can list all available ones using the
configure option "--list-indevs".
You can disable all the input devices using the configure option
"--disable-indevs", and selectively enable an input device using the
option "--enable-indev=INDEV", or you can disable a particular input
device using the option "--disable-indev=INDEV".
The option "-formats" of the ff* tools will display the list of
supported input devices (amongst the demuxers).
A description of the currently available input devices follows.
ALSA (Advanced Linux Sound Architecture) input device.
To enable this input device during configuration you need libasound
installed on your system.
This device allows capturing from an ALSA device. The name of the
device to capture has to be an ALSA card identifier.
An ALSA identifier has the syntax:
hw:&CARD&[,&DEV&[,&SUBDEV&]]
where the DEV and SUBDEV components are optional.
The three arguments (in order: CARD,DEV,SUBDEV) specify card number or
identifier, device number and subdevice number (-1 means any).
To see the list of cards currently recognized by your system check the
files /proc/asound/cards and /proc/asound/devices.
For example to capture with avconv from an ALSA device with card id 0,
you may run the command:
avconv -f alsa -i hw:0 alsaout.wav
For more information see:
BSD video input device.
Linux DV 1394 input device.
Linux framebuffer input device.
The Linux framebuffer is a graphic hardware-independent abstraction
layer to show graphics on a computer monitor, typically on the console.
It is accessed through a file device node, usually /dev/fb0.
For more detailed information read the file
Documentation/fb/framebuffer.txt included in the Linux source tree.
To record from the framebuffer device /dev/fb0 with avconv:
avconv -f fbdev -r 10 -i /dev/fb0 out.avi
You can take a single screenshot image with the command:
avconv -f fbdev -frames:v 1 -r 1 -i /dev/fb0 screenshot.jpeg
See also &&, and (1).
JACK input device.
To enable this input device during configuration you need libjack
installed on your system.
A JACK input device creates one or more JACK writable clients, one for
each audio channel, with name client_name:input_N, where client_name is
the name provided by the application, and N is a number which
identifies the channel.
Each writable client will send the acquired
data to the Libav input device.
Once you have created one or more JACK readable clients, you need to
connect them to one or more JACK writable clients.
To connect or disconnect JACK clients you can use the jack_connect and
jack_disconnect programs, or do it through a graphical interface, for
example with qjackctl.
To list the JACK clients and their properties you can invoke the
command jack_lsp.
Follows an example which shows how to capture a JACK readable client
with avconv.
# Create a JACK writable client with name "libav".
$ avconv -f jack -i libav -y out.wav
# Start the sample jack_metro readable client.
$ jack_metro -b 120 -d 0.2 -f 4000
# List the current JACK clients.
$ jack_lsp -c
system:capture_1
system:capture_2
system:playback_1
system:playback_2
libav:input_1
metro:120_bpm
# Connect metro to the avconv writable client.
$ jack_connect metro:120_bpm libav:input_1
For more information read: &&
IIDC1394 input device, based on libdc1394 and libraw1394.
Open Sound System input device.
The filename to provide to the input device is the device node
representing the OSS input device, and is usually set to /dev/dsp.
For example to grab from /dev/dsp using avconv use the command:
avconv -f oss -i /dev/dsp /tmp/oss.wav
For more information about OSS see:
pulseaudio input device.
To enable this input device during configuration you need libpulse-
simple installed in your system.
The filename to provide to the input device is a source device or the
string "default"
To list the pulse source devices and their properties you can invoke
the command pactl list sources.
avconv -f pulse -i default /tmp/pulse.wav
server AVOption
The syntax is:
-server &server name&
Connects to a specific server.
name AVOption
The syntax is:
-name &application name&
Specify the application name pulse will use when showing active
clients, by default it is "libav"
stream_name AVOption
The syntax is:
-stream_name &stream name&
Specify the stream name pulse will use when showing active streams, by
default it is "record"
sample_rate AVOption
The syntax is:
-sample_rate &samplerate&
Specify the samplerate in Hz, by default 48kHz is used.
channels AVOption
The syntax is:
-channels &N&
Specify the channels in use, by default 2 (stereo) is set.
frame_size AVOption
The syntax is:
-frame_size &bytes&
Specify the number of byte per frame, by default it is set to 1024.
fragment_size AVOption
The syntax is:
-fragment_size &bytes&
Specify the minimal buffering fragment in pulseaudio, it will affect
the audio latency. By default it is unset.
sndio input device.
To enable this input device during configuration you need libsndio
installed on your system.
The filename to provide to the input device is the device node
representing the sndio input device, and is usually set to /dev/audio0.
For example to grab from /dev/audio0 using avconv use the command:
avconv -f sndio -i /dev/audio0 /tmp/oss.wav
video4linux and video4linux2
Video4Linux and Video4Linux2 input video devices.
The name of the device to grab is a file device node, usually Linux
systems tend to automatically create such nodes when the device (e.g.
an USB webcam) is plugged into the system, and has a name of the kind
/dev/videoN, where N is a number associated to the device.
Video4Linux and Video4Linux2 devices only support a limited set of
widthxheight sizes and framerates. You can check which are supported
for example with the command dov4l for Video4Linux devices and using
-list_formats all for Video4Linux2 devices.
If the size for the device is set to 0x0, the input device will try to
autodetect the size to use.
Only for the video4linux2 device, if the
frame rate is set to 0/0 the input device will use the frame rate value
already set in the driver.
Video4Linux support is deprecated since Linux 2.6.30, and will be
dropped in later versions.
Follow some usage examples of the video4linux devices with the ff*
# Grab and show the input of a video4linux device, frame rate is set
# to the default of 25/1.
avplay -s 320x240 -f video4linux /dev/video0
# Grab and show the input of a video4linux2 device, autoadjust size.
avplay -f video4linux2 /dev/video0
# Grab and record the input of a video4linux2 device, autoadjust size,
# frame rate value defaults to 0/0 so it is read from the video4linux2
avconv -f video4linux2 -i /dev/video0 out.mpeg
VfW (Video for Windows) capture input device.
The filename passed as input is the capture driver number, ranging from
0 to 9. You may use "list" as filename to print a list of drivers. Any
other filename will be interpreted as device number 0.
X11 video input device.
This device allows to capture a region of an X11 display.
The filename passed as input has the syntax:
[&hostname&]:&display_number&.&screen_number&[+&x_offset&,&y_offset&]
hostname:display_number.screen_number specifies the X11 display name of
the screen to grab from. hostname can be ommitted, and defaults to
"localhost". The environment variable DISPLAY contains the default
display name.
x_offset and y_offset specify the offsets of the grabbed area with
respect to the top-left border of the X11 screen. They default to 0.
Check the X11 documentation (e.g. man X) for more detailed information.
Use the dpyinfo program for getting basic information about the
properties of your X11 display (e.g. grep for "name" or "dimensions").
For example to grab from :0.0 using avconv:
avconv -f x11grab -r 25 -s cif -i :0.0 out.mpg
# Grab at position 10,20.
avconv -f x11grab -r 25 -s cif -i :0.0+10,20 out.mpg
follow_mouse AVOption
The syntax is:
-follow_mouse centered|&PIXELS&
When it is specified with "centered", the grabbing region follows the
mouse pointer and keeps the pointer at
otherwise,
the region follows only when the mouse pointer reaches within PIXELS
(greater than zero) to the edge of region.
For example:
avconv -f x11grab -follow_mouse centered -r 25 -s cif -i :0.0 out.mpg
# Follows only when the mouse pointer reaches within 100 pixels to edge
avconv -f x11grab -follow_mouse 100 -r 25 -s cif -i :0.0 out.mpg
show_region AVOption
The syntax is:
-show_region 1
If show_region AVOption is specified with 1, then the grabbing region
will be indicated on screen. With this option, it's easy to know what
is being grabbed if only a portion of the screen is grabbed.
For example:
avconv -f x11grab -show_region 1 -r 25 -s cif -i :0.0+10,20 out.mpg
# With follow_mouse
avconv -f x11grab -follow_mouse centered -show_region 1
-r 25 -s cif -i :0.0 out.mpg
OUTPUT DEVICES
Output devices are configured elements in Libav which allow to write
multimedia data to an output device attached to your system.
When you configure your Libav build, all the supported output devices
are enabled by default. You can list all available ones using the
configure option "--list-outdevs".
You can disable all the output devices using the configure option
"--disable-outdevs", and selectively enable an output device using the
option "--enable-outdev=OUTDEV", or you can disable a particular input}

我要回帖

更多关于 ios102刷机跳过id激活 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信