.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "AVPLAY 1" .TH AVPLAY 1 "2016-03-02" " " " " .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" avplay \- AVplay media player .SH "SYNOPSIS" .IX Header "SYNOPSIS" avplay [options] \fIinput_file\fR .SH "DESCRIPTION" .IX Header "DESCRIPTION" AVplay is a very simple and portable media player using the Libav libraries and the \s-1SDL\s0 library. It is mostly used as a testbed for the various Libav APIs. .SH "OPTIONS" .IX Header "OPTIONS" 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'. 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 '\s-1KB\s0', 'MiB', 'G' and 'B' as postfix. .PP 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 \*(L"no\*(R" the option name, for example using \*(L"\-nofoo\*(R" in the command line will set to false the boolean option with name \*(L"foo\*(R". .SS "Stream specifiers" .IX Subsection "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. .PP A stream specifier is a string generally appended to the option name and separated from it by a colon. E.g. \f(CW\*(C`\-codec:a:1 ac3\*(C'\fR option contains \&\f(CW\*(C`a:1\*(C'\fR stream specifer, which matches the second audio stream. Therefore it would select the ac3 codec for the second audio stream. .PP A stream specifier can match several stream, the option is then applied to all of them. E.g. the stream specifier in \f(CW\*(C`\-b:a 128k\*(C'\fR matches all audio streams. .PP An empty stream specifier matches all streams, for example \f(CW\*(C`\-codec copy\*(C'\fR or \f(CW\*(C`\-codec: copy\*(C'\fR would copy all the streams without reencoding. .PP Possible forms of stream specifiers are: .IP "\fIstream_index\fR" 4 .IX Item "stream_index" Matches the stream with this index. E.g. \f(CW\*(C`\-threads:1 4\*(C'\fR would set the thread count for the second stream to 4. .IP "\fIstream_type\fR\fB[:\fR\fIstream_index\fR\fB]\fR" 4 .IX Item "stream_type[:stream_index]" \&\fIstream_type\fR is one of: 'v' for video, 'a' for audio, 's' for subtitle, \&'d' for data and 't' for attachments. If \fIstream_index\fR is given, then matches stream number \fIstream_index\fR of this type. Otherwise matches all streams of this type. .IP "\fBp:\fR\fIprogram_id\fR\fB[:\fR\fIstream_index\fR\fB]\fR" 4 .IX Item "p:program_id[:stream_index]" If \fIstream_index\fR is given, then matches stream number \fIstream_index\fR in program with id \fIprogram_id\fR. Otherwise matches all streams in this program. .SS "Generic options" .IX Subsection "Generic options" These options are shared amongst the av* tools. .IP "\fB\-L\fR" 4 .IX Item "-L" Show license. .IP "\fB\-h, \-?, \-help, \-\-help\fR" 4 .IX Item "-h, -?, -help, --help" Show help. .IP "\fB\-version\fR" 4 .IX Item "-version" Show version. .IP "\fB\-formats\fR" 4 .IX Item "-formats" Show available formats. .Sp The fields preceding the format names have the following meanings: .RS 4 .IP "\fBD\fR" 4 .IX Item "D" Decoding available .IP "\fBE\fR" 4 .IX Item "E" Encoding available .RE .RS 4 .RE .IP "\fB\-codecs\fR" 4 .IX Item "-codecs" Show available codecs. .Sp The fields preceding the codec names have the following meanings: .RS 4 .IP "\fBD\fR" 4 .IX Item "D" Decoding available .IP "\fBE\fR" 4 .IX Item "E" Encoding available .IP "\fBV/A/S\fR" 4 .IX Item "V/A/S" Video/audio/subtitle codec .IP "\fBS\fR" 4 .IX Item "S" Codec supports slices .IP "\fBD\fR" 4 .IX Item "D" Codec supports direct rendering .IP "\fBT\fR" 4 .IX Item "T" Codec can handle input truncated at random locations instead of only at frame boundaries .RE .RS 4 .RE .IP "\fB\-bsfs\fR" 4 .IX Item "-bsfs" Show available bitstream filters. .IP "\fB\-protocols\fR" 4 .IX Item "-protocols" Show available protocols. .IP "\fB\-filters\fR" 4 .IX Item "-filters" Show available libavfilter filters. .IP "\fB\-pix_fmts\fR" 4 .IX Item "-pix_fmts" Show available pixel formats. .IP "\fB\-sample_fmts\fR" 4 .IX Item "-sample_fmts" Show available sample formats. .IP "\fB\-loglevel\fR \fIloglevel\fR \fB| \-v\fR \fIloglevel\fR" 4 .IX Item "-loglevel loglevel | -v loglevel" Set the logging level used by the library. \&\fIloglevel\fR is a number or a string containing one of the following values: .RS 4 .IP "\fBquiet\fR" 4 .IX Item "quiet" .PD 0 .IP "\fBpanic\fR" 4 .IX Item "panic" .IP "\fBfatal\fR" 4 .IX Item "fatal" .IP "\fBerror\fR" 4 .IX Item "error" .IP "\fBwarning\fR" 4 .IX Item "warning" .IP "\fBinfo\fR" 4 .IX Item "info" .IP "\fBverbose\fR" 4 .IX Item "verbose" .IP "\fBdebug\fR" 4 .IX Item "debug" .RE .RS 4 .PD .Sp 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 \&\fB\s-1AV_LOG_FORCE_NOCOLOR\s0\fR or \fB\s-1NO_COLOR\s0\fR, or can be forced setting the environment variable \fB\s-1AV_LOG_FORCE_COLOR\s0\fR. The use of the environment variable \fB\s-1NO_COLOR\s0\fR is deprecated and will be dropped in a following Libav version. .RE .SS "AVOptions" .IX Subsection "AVOptions" These options are provided directly by the libavformat, libavdevice and libavcodec libraries. To see the list of available AVOptions, use the \&\fB\-help\fR option. They are separated into two categories: .IP "\fBgeneric\fR" 4 .IX Item "generic" 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. .IP "\fBprivate\fR" 4 .IX Item "private" These options are specific to the given container, device or codec. Private options are listed under their corresponding containers/devices/codecs. .PP For example to write an ID3v2.3 header instead of a default ID3v2.4 to an \s-1MP3\s0 file, use the \fBid3v2_version\fR private option of the \s-1MP3\s0 muxer: .PP .Vb 1 \& avconv \-i input.flac \-id3v2_version 3 out.mp3 .Ve .PP All codec AVOptions are obviously per-stream, so the chapter on stream specifiers applies to them .PP Note \fB\-nooption\fR syntax cannot be used for boolean AVOptions, use \fB\-option 0\fR/\fB\-option 1\fR. .PP 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. .SS "Main options" .IX Subsection "Main options" .IP "\fB\-x\fR \fIwidth\fR" 4 .IX Item "-x width" Force displayed width. .IP "\fB\-y\fR \fIheight\fR" 4 .IX Item "-y height" Force displayed height. .IP "\fB\-s\fR \fIsize\fR" 4 .IX Item "-s size" This option has been removed. Use private format options for specifying the input video size. For example with the rawvideo demuxer you need to specify the option \fIvideo_size\fR. .IP "\fB\-an\fR" 4 .IX Item "-an" Disable audio. .IP "\fB\-vn\fR" 4 .IX Item "-vn" Disable video. .IP "\fB\-ss\fR \fIpos\fR" 4 .IX Item "-ss pos" Seek to a given position in seconds. .IP "\fB\-t\fR \fIduration\fR" 4 .IX Item "-t duration" play seconds of audio/video .IP "\fB\-bytes\fR" 4 .IX Item "-bytes" Seek by bytes. .IP "\fB\-nodisp\fR" 4 .IX Item "-nodisp" Disable graphical display. .IP "\fB\-f\fR \fIfmt\fR" 4 .IX Item "-f fmt" Force format. .IP "\fB\-window_title\fR \fItitle\fR" 4 .IX Item "-window_title title" Set window title (default is the input filename). .IP "\fB\-loop\fR \fInumber\fR" 4 .IX Item "-loop number" Loops movie playback times. 0 means forever. .IP "\fB\-vf\fR \fIfilter_graph\fR" 4 .IX Item "-vf filter_graph" \&\fIfilter_graph\fR is a description of the filter graph to apply to the input video. Use the option \*(L"\-filters\*(R" to show all the available filters (including also sources and sinks). .SS "Advanced options" .IX Subsection "Advanced options" .IP "\fB\-pix_fmt\fR \fIformat\fR" 4 .IX Item "-pix_fmt format" This option has been removed. Use private options for specifying the input pixel format. For example with the rawvideo demuxer you need to specify the option \fIpixel_format\fR. .IP "\fB\-stats\fR" 4 .IX Item "-stats" Show the stream duration, the codec parameters, the current position in the stream and the audio/video synchronisation drift. .IP "\fB\-debug\fR" 4 .IX Item "-debug" Print specific debug info. .IP "\fB\-bug\fR" 4 .IX Item "-bug" Work around bugs. .IP "\fB\-vismv\fR" 4 .IX Item "-vismv" Visualize motion vectors. .IP "\fB\-fast\fR" 4 .IX Item "-fast" Non-spec-compliant optimizations. .IP "\fB\-genpts\fR" 4 .IX Item "-genpts" Generate pts. .IP "\fB\-rtp_tcp\fR" 4 .IX Item "-rtp_tcp" Force \s-1RTP/TCP\s0 protocol usage instead of \s-1RTP/UDP\s0. It is only meaningful if you are streaming with the \s-1RTSP\s0 protocol. .IP "\fB\-sync\fR \fItype\fR" 4 .IX Item "-sync type" Set the master clock to audio (\f(CW\*(C`type=audio\*(C'\fR), video (\f(CW\*(C`type=video\*(C'\fR) or external (\f(CW\*(C`type=ext\*(C'\fR). Default is audio. The master clock is used to control audio-video synchronization. Most media players use audio as master clock, but in some cases (streaming or high quality broadcast) it is necessary to change that. This option is mainly used for debugging purposes. .IP "\fB\-threads\fR \fIcount\fR" 4 .IX Item "-threads count" Set the thread count. .IP "\fB\-ast\fR \fIaudio_stream_number\fR" 4 .IX Item "-ast audio_stream_number" Select the desired audio stream number, counting from 0. The number refers to the list of all the input audio streams. If it is greater than the number of audio streams minus one, then the last one is selected, if it is negative the audio playback is disabled. .IP "\fB\-vst\fR \fIvideo_stream_number\fR" 4 .IX Item "-vst video_stream_number" Select the desired video stream number, counting from 0. The number refers to the list of all the input video streams. If it is greater than the number of video streams minus one, then the last one is selected, if it is negative the video playback is disabled. .IP "\fB\-sst\fR \fIsubtitle_stream_number\fR" 4 .IX Item "-sst subtitle_stream_number" Select the desired subtitle stream number, counting from 0. The number refers to the list of all the input subtitle streams. If it is greater than the number of subtitle streams minus one, then the last one is selected, if it is negative the subtitle rendering is disabled. .IP "\fB\-autoexit\fR" 4 .IX Item "-autoexit" Exit when video is done playing. .IP "\fB\-exitonkeydown\fR" 4 .IX Item "-exitonkeydown" Exit if any key is pressed. .IP "\fB\-exitonmousedown\fR" 4 .IX Item "-exitonmousedown" Exit if any mouse button is pressed. .SS "While playing" .IX Subsection "While playing" .IP "\fBq, \s-1ESC\s0\fR" 4 .IX Item "q, ESC" Quit. .IP "\fBf\fR" 4 .IX Item "f" Toggle full screen. .IP "\fBp, \s-1SPC\s0\fR" 4 .IX Item "p, SPC" Pause. .IP "\fBa\fR" 4 .IX Item "a" Cycle audio channel. .IP "\fBv\fR" 4 .IX Item "v" Cycle video channel. .IP "\fBt\fR" 4 .IX Item "t" Cycle subtitle channel. .IP "\fBw\fR" 4 .IX Item "w" Show audio waves. .IP "\fBleft/right\fR" 4 .IX Item "left/right" Seek backward/forward 10 seconds. .IP "\fBdown/up\fR" 4 .IX Item "down/up" Seek backward/forward 1 minute. .IP "\fBmouse click\fR" 4 .IX Item "mouse click" Seek to percentage in file corresponding to fraction of width. .SH "EXPRESSION EVALUATION" .IX Header "EXPRESSION EVALUATION" When evaluating an arithmetic expression, Libav uses an internal formula evaluator, implemented through the \fIlibavutil/eval.h\fR interface. .PP An expression may contain unary, binary operators, constants, and functions. .PP Two expressions \fIexpr1\fR and \fIexpr2\fR can be combined to form another expression "\fIexpr1\fR;\fIexpr2\fR". \&\fIexpr1\fR and \fIexpr2\fR are evaluated in turn, and the new expression evaluates to the value of \fIexpr2\fR. .PP The following binary operators are available: \f(CW\*(C`+\*(C'\fR, \f(CW\*(C`\-\*(C'\fR, \&\f(CW\*(C`*\*(C'\fR, \f(CW\*(C`/\*(C'\fR, \f(CW\*(C`^\*(C'\fR. .PP The following unary operators are available: \f(CW\*(C`+\*(C'\fR, \f(CW\*(C`\-\*(C'\fR. .PP The following functions are available: .IP "\fBsinh(x)\fR" 4 .IX Item "sinh(x)" .PD 0 .IP "\fBcosh(x)\fR" 4 .IX Item "cosh(x)" .IP "\fBtanh(x)\fR" 4 .IX Item "tanh(x)" .IP "\fBsin(x)\fR" 4 .IX Item "sin(x)" .IP "\fBcos(x)\fR" 4 .IX Item "cos(x)" .IP "\fBtan(x)\fR" 4 .IX Item "tan(x)" .IP "\fBatan(x)\fR" 4 .IX Item "atan(x)" .IP "\fBasin(x)\fR" 4 .IX Item "asin(x)" .IP "\fBacos(x)\fR" 4 .IX Item "acos(x)" .IP "\fBexp(x)\fR" 4 .IX Item "exp(x)" .IP "\fBlog(x)\fR" 4 .IX Item "log(x)" .IP "\fBabs(x)\fR" 4 .IX Item "abs(x)" .IP "\fBsquish(x)\fR" 4 .IX Item "squish(x)" .IP "\fBgauss(x)\fR" 4 .IX Item "gauss(x)" .IP "\fBisnan(x)\fR" 4 .IX Item "isnan(x)" .PD Return 1.0 if \fIx\fR is \s-1NAN\s0, 0.0 otherwise. .IP "\fBmod(x, y)\fR" 4 .IX Item "mod(x, y)" .PD 0 .IP "\fBmax(x, y)\fR" 4 .IX Item "max(x, y)" .IP "\fBmin(x, y)\fR" 4 .IX Item "min(x, y)" .IP "\fBeq(x, y)\fR" 4 .IX Item "eq(x, y)" .IP "\fBgte(x, y)\fR" 4 .IX Item "gte(x, y)" .IP "\fBgt(x, y)\fR" 4 .IX Item "gt(x, y)" .IP "\fBlte(x, y)\fR" 4 .IX Item "lte(x, y)" .IP "\fBlt(x, y)\fR" 4 .IX Item "lt(x, y)" .IP "\fBst(var, expr)\fR" 4 .IX Item "st(var, expr)" .PD Allow to store the value of the expression \fIexpr\fR in an internal variable. \fIvar\fR 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. .IP "\fBld(var)\fR" 4 .IX Item "ld(var)" Allow to load the value of the internal variable with number \&\fIvar\fR, which was previously stored with st(\fIvar\fR, \fIexpr\fR). The function returns the loaded value. .IP "\fBwhile(cond, expr)\fR" 4 .IX Item "while(cond, expr)" Evaluate expression \fIexpr\fR while the expression \fIcond\fR is non-zero, and returns the value of the last \fIexpr\fR evaluation, or \&\s-1NAN\s0 if \fIcond\fR was always false. .IP "\fBceil(expr)\fR" 4 .IX Item "ceil(expr)" Round the value of expression \fIexpr\fR upwards to the nearest integer. For example, \*(L"ceil(1.5)\*(R" is \*(L"2.0\*(R". .IP "\fBfloor(expr)\fR" 4 .IX Item "floor(expr)" Round the value of expression \fIexpr\fR downwards to the nearest integer. For example, \*(L"floor(\-1.5)\*(R" is \*(L"\-2.0\*(R". .IP "\fBtrunc(expr)\fR" 4 .IX Item "trunc(expr)" Round the value of expression \fIexpr\fR towards zero to the nearest integer. For example, \*(L"trunc(\-1.5)\*(R" is \*(L"\-1.0\*(R". .IP "\fBsqrt(expr)\fR" 4 .IX Item "sqrt(expr)" Compute the square root of \fIexpr\fR. This is equivalent to "(\fIexpr\fR)^.5". .IP "\fBnot(expr)\fR" 4 .IX Item "not(expr)" Return 1.0 if \fIexpr\fR is zero, 0.0 otherwise. .PP Note that: .PP \&\f(CW\*(C`*\*(C'\fR works like \s-1AND\s0 .PP \&\f(CW\*(C`+\*(C'\fR works like \s-1OR\s0 .PP thus .PP .Vb 1 \& if A then B else C .Ve .PP is equivalent to .PP .Vb 1 \& A*B + not(A)*C .Ve .PP 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. .PP 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 '\s-1KB\s0', 'MiB', 'G' and 'B' as postfix. .PP Follows the list of available International System postfixes, with indication of the corresponding powers of 10 and of 2. .IP "\fBy\fR" 4 .IX Item "y" \&\-24 / \-80 .IP "\fBz\fR" 4 .IX Item "z" \&\-21 / \-70 .IP "\fBa\fR" 4 .IX Item "a" \&\-18 / \-60 .IP "\fBf\fR" 4 .IX Item "f" \&\-15 / \-50 .IP "\fBp\fR" 4 .IX Item "p" \&\-12 / \-40 .IP "\fBn\fR" 4 .IX Item "n" \&\-9 / \-30 .IP "\fBu\fR" 4 .IX Item "u" \&\-6 / \-20 .IP "\fBm\fR" 4 .IX Item "m" \&\-3 / \-10 .IP "\fBc\fR" 4 .IX Item "c" \&\-2 .IP "\fBd\fR" 4 .IX Item "d" \&\-1 .IP "\fBh\fR" 4 .IX Item "h" 2 .IP "\fBk\fR" 4 .IX Item "k" 3 / 10 .IP "\fBK\fR" 4 .IX Item "K" 3 / 10 .IP "\fBM\fR" 4 .IX Item "M" 6 / 20 .IP "\fBG\fR" 4 .IX Item "G" 9 / 30 .IP "\fBT\fR" 4 .IX Item "T" 12 / 40 .IP "\fBP\fR" 4 .IX Item "P" 15 / 40 .IP "\fBE\fR" 4 .IX Item "E" 18 / 50 .IP "\fBZ\fR" 4 .IX Item "Z" 21 / 60 .IP "\fBY\fR" 4 .IX Item "Y" 24 / 70 .SH "DEMUXERS" .IX Header "DEMUXERS" Demuxers are configured elements in Libav which allow to read the multimedia streams from a particular type of file. .PP When you configure your Libav build, all the supported demuxers are enabled by default. You can list all available ones using the configure option \*(L"\-\-list\-demuxers\*(R". .PP You can disable all the demuxers using the configure option \&\*(L"\-\-disable\-demuxers\*(R", and selectively enable a single demuxer with the option "\-\-enable\-demuxer=\fI\s-1DEMUXER\s0\fR\*(L", or disable it with the option \*(R"\-\-disable\-demuxer=\fI\s-1DEMUXER\s0\fR". .PP The option \*(L"\-formats\*(R" of the av* tools will display the list of enabled demuxers. .PP The description of some of the currently available demuxers follows. .SS "image2" .IX Subsection "image2" Image file demuxer. .PP This demuxer reads from a list of image files specified by a pattern. .PP The pattern may contain the string \*(L"%d\*(R" or "%0\fIN\fRd\*(L", which specifies the position of the characters representing a sequential number in each filename matched by the pattern. If the form \&\*(R"%d0\fIN\fRd" is used, the string representing the number in each filename is 0\-padded and \fIN\fR is the total number of 0\-padded digits representing the number. The literal character '%' can be specified in the pattern with the string \*(L"%%\*(R". .PP If the pattern contains \*(L"%d\*(R" or "%0\fIN\fRd", 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. .PP The pattern may contain a suffix which is used to automatically determine the format of the images contained in the files. .PP For example the pattern \*(L"img\-%03d.bmp\*(R" will match a sequence of filenames of the form \fIimg\-001.bmp\fR, \fIimg\-002.bmp\fR, ..., \&\fIimg\-010.bmp\fR, etc.; the pattern \*(L"i%%m%%g\-%d.jpg\*(R" will match a sequence of filenames of the form \fIi%m%g\-1.jpg\fR, \&\fIi%m%g\-2.jpg\fR, ..., \fIi%m%g\-10.jpg\fR, etc. .PP The size, the pixel format, and the format of each image must be the same for all the files in the sequence. .PP The following example shows how to use \fBavconv\fR for creating a video from the images in the file sequence \fIimg\-001.jpeg\fR, \&\fIimg\-002.jpeg\fR, ..., assuming an input framerate of 10 frames per second: .PP .Vb 1 \& avconv \-i \*(Aqimg\-%03d.jpeg\*(Aq \-r 10 out.mkv .Ve .PP Note that the pattern must not necessarily contain \*(L"%d\*(R" or "%0\fIN\fRd", for example to convert a single image file \&\fIimg.jpeg\fR you can employ the command: .PP .Vb 1 \& avconv \-i img.jpeg img.png .Ve .SS "applehttp" .IX Subsection "applehttp" Apple \s-1HTTP\s0 Live Streaming demuxer. .PP 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 avplay), 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 \*(L"variant_bitrate\*(R". .SH "MUXERS" .IX Header "MUXERS" Muxers are configured elements in Libav which allow writing multimedia streams to a particular type of file. .PP When you configure your Libav build, all the supported muxers are enabled by default. You can list all available muxers using the configure option \f(CW\*(C`\-\-list\-muxers\*(C'\fR. .PP You can disable all the muxers with the configure option \&\f(CW\*(C`\-\-disable\-muxers\*(C'\fR and selectively enable / disable single muxers with the options \f(CW\*(C`\-\-enable\-muxer=\f(CIMUXER\f(CW\*(C'\fR / \&\f(CW\*(C`\-\-disable\-muxer=\f(CIMUXER\f(CW\*(C'\fR. .PP The option \f(CW\*(C`\-formats\*(C'\fR of the av* tools will display the list of enabled muxers. .PP A description of some of the currently available muxers follows. .SS "crc" .IX Subsection "crc" \&\s-1CRC\s0 (Cyclic Redundancy Check) testing format. .PP This muxer computes and prints the Adler\-32 \s-1CRC\s0 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 \&\s-1CRC\s0. .PP The output of the muxer consists of a single line of the form: CRC=0x\fI\s-1CRC\s0\fR, where \fI\s-1CRC\s0\fR is a hexadecimal number 0\-padded to 8 digits containing the \s-1CRC\s0 for all the decoded input frames. .PP For example to compute the \s-1CRC\s0 of the input, and store it in the file \&\fIout.crc\fR: .PP .Vb 1 \& avconv \-i INPUT \-f crc out.crc .Ve .PP You can print the \s-1CRC\s0 to stdout with the command: .PP .Vb 1 \& avconv \-i INPUT \-f crc \- .Ve .PP You can select the output format of each frame with \fBavconv\fR by specifying the audio and video codec and format. For example to compute the \s-1CRC\s0 of the input audio converted to \s-1PCM\s0 unsigned 8\-bit and the input video converted to \s-1MPEG\-2\s0 video, use the command: .PP .Vb 1 \& avconv \-i INPUT \-c:a pcm_u8 \-c:v mpeg2video \-f crc \- .Ve .PP See also the framecrc muxer. .SS "framecrc" .IX Subsection "framecrc" Per-frame \s-1CRC\s0 (Cyclic Redundancy Check) testing format. .PP This muxer computes and prints the Adler\-32 \s-1CRC\s0 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 \&\s-1CRC\s0. .PP The output of the muxer consists of a line for each audio and video frame of the form: \fIstream_index\fR, \fIframe_dts\fR, \&\fIframe_size\fR, 0x\fI\s-1CRC\s0\fR, where \fI\s-1CRC\s0\fR is a hexadecimal number 0\-padded to 8 digits containing the \s-1CRC\s0 of the decoded frame. .PP For example to compute the \s-1CRC\s0 of each decoded frame in the input, and store it in the file \fIout.crc\fR: .PP .Vb 1 \& avconv \-i INPUT \-f framecrc out.crc .Ve .PP You can print the \s-1CRC\s0 of each decoded frame to stdout with the command: .PP .Vb 1 \& avconv \-i INPUT \-f framecrc \- .Ve .PP You can select the output format of each frame with \fBavconv\fR by specifying the audio and video codec and format. For example, to compute the \s-1CRC\s0 of each decoded input audio frame converted to \s-1PCM\s0 unsigned 8\-bit and of each decoded input video frame converted to \&\s-1MPEG\-2\s0 video, use the command: .PP .Vb 1 \& avconv \-i INPUT \-c:a pcm_u8 \-c:v mpeg2video \-f framecrc \- .Ve .PP See also the crc muxer. .SS "image2" .IX Subsection "image2" Image file muxer. .PP The image file muxer writes video frames to image files. .PP 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 \*(L"%d\*(R" or "%0\fIN\fRd\*(L", this string specifies the position of the characters representing a numbering in the filenames. If the form \*(R"%0\fIN\fRd" is used, the string representing the number in each filename is 0\-padded to \fIN\fR digits. The literal character '%' can be specified in the pattern with the string \*(L"%%\*(R". .PP If the pattern contains \*(L"%d\*(R" or "%0\fIN\fRd", the first filename of the file list specified will contain the number 1, all the following numbers will be sequential. .PP The pattern may contain a suffix which is used to automatically determine the format of the image files to write. .PP For example the pattern \*(L"img\-%03d.bmp\*(R" will specify a sequence of filenames of the form \fIimg\-001.bmp\fR, \fIimg\-002.bmp\fR, ..., \&\fIimg\-010.bmp\fR, etc. The pattern \*(L"img%%\-%d.jpg\*(R" will specify a sequence of filenames of the form \fIimg%\-1.jpg\fR, \fIimg%\-2.jpg\fR, ..., \fIimg%\-10.jpg\fR, etc. .PP The following example shows how to use \fBavconv\fR for creating a sequence of files \fIimg\-001.jpeg\fR, \fIimg\-002.jpeg\fR, ..., taking one image every second from the input video: .PP .Vb 1 \& avconv \-i in.avi \-vsync 1 \-r 1 \-f image2 \*(Aqimg\-%03d.jpeg\*(Aq .Ve .PP Note that with \fBavconv\fR, if the format is not specified with the \&\f(CW\*(C`\-f\*(C'\fR option and the output filename specifies an image file format, the image2 muxer is automatically selected, so the previous command can be written as: .PP .Vb 1 \& avconv \-i in.avi \-vsync 1 \-r 1 \*(Aqimg\-%03d.jpeg\*(Aq .Ve .PP Note also that the pattern must not necessarily contain \*(L"%d\*(R" or "%0\fIN\fRd", for example to create a single image file \&\fIimg.jpeg\fR from the input video you can employ the command: .PP .Vb 1 \& avconv \-i in.avi \-f image2 \-frames:v 1 img.jpeg .Ve .SS "mpegts" .IX Subsection "mpegts" \&\s-1MPEG\s0 transport stream muxer. .PP This muxer implements \s-1ISO\s0 13818\-1 and part of \s-1ETSI\s0 \s-1EN\s0 300 468. .PP The muxer options are: .IP "\fB\-mpegts_original_network_id\fR \fInumber\fR" 4 .IX Item "-mpegts_original_network_id number" Set the original_network_id (default 0x0001). This is unique identifier of a network in \s-1DVB\s0. Its main use is in the unique identification of a service through the path Original_Network_ID, Transport_Stream_ID. .IP "\fB\-mpegts_transport_stream_id\fR \fInumber\fR" 4 .IX Item "-mpegts_transport_stream_id number" Set the transport_stream_id (default 0x0001). This identifies a transponder in \s-1DVB\s0. .IP "\fB\-mpegts_service_id\fR \fInumber\fR" 4 .IX Item "-mpegts_service_id number" Set the service_id (default 0x0001) also known as program in \s-1DVB\s0. .IP "\fB\-mpegts_pmt_start_pid\fR \fInumber\fR" 4 .IX Item "-mpegts_pmt_start_pid number" Set the first \s-1PID\s0 for \s-1PMT\s0 (default 0x1000, max 0x1f00). .IP "\fB\-mpegts_start_pid\fR \fInumber\fR" 4 .IX Item "-mpegts_start_pid number" Set the first \s-1PID\s0 for data packets (default 0x0100, max 0x0f00). .PP The recognized metadata settings in mpegts muxer are \f(CW\*(C`service_provider\*(C'\fR and \f(CW\*(C`service_name\*(C'\fR. If they are not set the default for \&\f(CW\*(C`service_provider\*(C'\fR is \*(L"Libav\*(R" and the default for \&\f(CW\*(C`service_name\*(C'\fR is \*(L"Service01\*(R". .PP .Vb 9 \& avconv \-i file.mpg \-c copy \e \& \-mpegts_original_network_id 0x1122 \e \& \-mpegts_transport_stream_id 0x3344 \e \& \-mpegts_service_id 0x5566 \e \& \-mpegts_pmt_start_pid 0x1500 \e \& \-mpegts_start_pid 0x150 \e \& \-metadata service_provider="Some provider" \e \& \-metadata service_name="Some Channel" \e \& \-y out.ts .Ve .SS "null" .IX Subsection "null" Null muxer. .PP This muxer does not generate any output file, it is mainly useful for testing or benchmarking purposes. .PP For example to benchmark decoding with \fBavconv\fR you can use the command: .PP .Vb 1 \& avconv \-benchmark \-i INPUT \-f null out.null .Ve .PP Note that the above command does not read or write the \fIout.null\fR file, but specifying the output file is required by the \fBavconv\fR syntax. .PP Alternatively you can write the command as: .PP .Vb 1 \& avconv \-benchmark \-i INPUT \-f null \- .Ve .SS "matroska" .IX Subsection "matroska" Matroska container muxer. .PP This muxer implements the matroska and webm container specs. .PP The recognized metadata settings in this muxer are: .IP "\fBtitle=\fR\fItitle name\fR" 4 .IX Item "title=title name" Name provided to a single track .IP "\fBlanguage=\fR\fIlanguage name\fR" 4 .IX Item "language=language name" Specifies the language of the track in the Matroska languages form .IP "\fBSTEREO_MODE=\fR\fImode\fR" 4 .IX Item "STEREO_MODE=mode" Stereo 3D video layout of two views in a single video track .RS 4 .IP "\fBmono\fR" 4 .IX Item "mono" video is not stereo .IP "\fBleft_right\fR" 4 .IX Item "left_right" Both views are arranged side by side, Left-eye view is on the left .IP "\fBbottom_top\fR" 4 .IX Item "bottom_top" Both views are arranged in top-bottom orientation, Left-eye view is at bottom .IP "\fBtop_bottom\fR" 4 .IX Item "top_bottom" Both views are arranged in top-bottom orientation, Left-eye view is on top .IP "\fBcheckerboard_rl\fR" 4 .IX Item "checkerboard_rl" Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first .IP "\fBcheckerboard_lr\fR" 4 .IX Item "checkerboard_lr" Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first .IP "\fBrow_interleaved_rl\fR" 4 .IX Item "row_interleaved_rl" Each view is constituted by a row based interleaving, Right-eye view is first row .IP "\fBrow_interleaved_lr\fR" 4 .IX Item "row_interleaved_lr" Each view is constituted by a row based interleaving, Left-eye view is first row .IP "\fBcol_interleaved_rl\fR" 4 .IX Item "col_interleaved_rl" Both views are arranged in a column based interleaving manner, Right-eye view is first column .IP "\fBcol_interleaved_lr\fR" 4 .IX Item "col_interleaved_lr" Both views are arranged in a column based interleaving manner, Left-eye view is first column .IP "\fBanaglyph_cyan_red\fR" 4 .IX Item "anaglyph_cyan_red" All frames are in anaglyph format viewable through red-cyan filters .IP "\fBright_left\fR" 4 .IX Item "right_left" Both views are arranged side by side, Right-eye view is on the left .IP "\fBanaglyph_green_magenta\fR" 4 .IX Item "anaglyph_green_magenta" All frames are in anaglyph format viewable through green-magenta filters .IP "\fBblock_lr\fR" 4 .IX Item "block_lr" Both eyes laced in one Block, Left-eye view is first .IP "\fBblock_rl\fR" 4 .IX Item "block_rl" Both eyes laced in one Block, Right-eye view is first .RE .RS 4 .RE .PP For example a 3D WebM clip can be created using the following command line: .PP .Vb 1 \& avconv \-i sample_left_right_clip.mpg \-an \-c:v libvpx \-metadata STEREO_MODE=left_right \-y stereo_clip.webm .Ve .SS "segment" .IX Subsection "segment" Basic stream segmenter. .PP 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. .PP Every segment starts with a video keyframe, if a video stream is present. The segment muxer works best with a single constant frame rate video. .PP Optionally it can generate a flat list of the created segments, one segment per line. .IP "\fBsegment_format\fR \fIformat\fR" 4 .IX Item "segment_format format" Override the inner container format, by default it is guessed by the filename extension. .IP "\fBsegment_time\fR \fIt\fR" 4 .IX Item "segment_time t" Set segment duration to \fIt\fR seconds. .IP "\fBsegment_list\fR \fIname\fR" 4 .IX Item "segment_list name" Generate also a listfile named \fIname\fR. .IP "\fBsegment_list_size\fR \fIsize\fR" 4 .IX Item "segment_list_size size" Overwrite the listfile once it reaches \fIsize\fR entries. .PP .Vb 1 \& avconv \-i in.mkv \-c copy \-map 0 \-f segment \-list out.list out%03d.nut .Ve .SH "INPUT DEVICES" .IX Header "INPUT DEVICES" Input devices are configured elements in Libav which allow to access the data coming from a multimedia device attached to your system. .PP 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 \*(L"\-\-list\-indevs\*(R". .PP You can disable all the input devices using the configure option \&\*(L"\-\-disable\-indevs\*(R", and selectively enable an input device using the option "\-\-enable\-indev=\fI\s-1INDEV\s0\fR\*(L", or you can disable a particular input device using the option \*(R"\-\-disable\-indev=\fI\s-1INDEV\s0\fR". .PP The option \*(L"\-formats\*(R" of the av* tools will display the list of supported input devices (amongst the demuxers). .PP A description of the currently available input devices follows. .SS "alsa" .IX Subsection "alsa" \&\s-1ALSA\s0 (Advanced Linux Sound Architecture) input device. .PP To enable this input device during configuration you need libasound installed on your system. .PP This device allows capturing from an \s-1ALSA\s0 device. The name of the device to capture has to be an \s-1ALSA\s0 card identifier. .PP An \s-1ALSA\s0 identifier has the syntax: .PP .Vb 1 \& hw:[,[,]] .Ve .PP where the \fI\s-1DEV\s0\fR and \fI\s-1SUBDEV\s0\fR components are optional. .PP The three arguments (in order: \fI\s-1CARD\s0\fR,\fI\s-1DEV\s0\fR,\fI\s-1SUBDEV\s0\fR) specify card number or identifier, device number and subdevice number (\-1 means any). .PP To see the list of cards currently recognized by your system check the files \fI/proc/asound/cards\fR and \fI/proc/asound/devices\fR. .PP For example to capture with \fBavconv\fR from an \s-1ALSA\s0 device with card id 0, you may run the command: .PP .Vb 1 \& avconv \-f alsa \-i hw:0 alsaout.wav .Ve .PP For more information see: <\fBhttp://www.alsa\-project.org/alsa\-doc/alsa\-lib/pcm.html\fR> .SS "bktr" .IX Subsection "bktr" \&\s-1BSD\s0 video input device. .SS "dv1394" .IX Subsection "dv1394" Linux \s-1DV\s0 1394 input device. .SS "fbdev" .IX Subsection "fbdev" Linux framebuffer input device. .PP 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 \&\fI/dev/fb0\fR. .PP For more detailed information read the file Documentation/fb/framebuffer.txt included in the Linux source tree. .PP To record from the framebuffer device \fI/dev/fb0\fR with \&\fBavconv\fR: .PP .Vb 1 \& avconv \-f fbdev \-r 10 \-i /dev/fb0 out.avi .Ve .PP You can take a single screenshot image with the command: .PP .Vb 1 \& avconv \-f fbdev \-frames:v 1 \-r 1 \-i /dev/fb0 screenshot.jpeg .Ve .PP See also <\fBhttp://linux\-fbdev.sourceforge.net/\fR>, and \fIfbset\fR\|(1). .SS "jack" .IX Subsection "jack" \&\s-1JACK\s0 input device. .PP To enable this input device during configuration you need libjack installed on your system. .PP A \s-1JACK\s0 input device creates one or more \s-1JACK\s0 writable clients, one for each audio channel, with name \fIclient_name\fR:input_\fIN\fR, where \&\fIclient_name\fR is the name provided by the application, and \fIN\fR is a number which identifies the channel. Each writable client will send the acquired data to the Libav input device. .PP Once you have created one or more \s-1JACK\s0 readable clients, you need to connect them to one or more \s-1JACK\s0 writable clients. .PP To connect or disconnect \s-1JACK\s0 clients you can use the \&\fIjack_connect\fR and \fIjack_disconnect\fR programs, or do it through a graphical interface, for example with \fIqjackctl\fR. .PP To list the \s-1JACK\s0 clients and their properties you can invoke the command \&\fIjack_lsp\fR. .PP Follows an example which shows how to capture a \s-1JACK\s0 readable client with \fBavconv\fR. .PP .Vb 2 \& # 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 .Ve .PP For more information read: <\fBhttp://jackaudio.org/\fR> .SS "libdc1394" .IX Subsection "libdc1394" \&\s-1IIDC1394\s0 input device, based on libdc1394 and libraw1394. .SS "oss" .IX Subsection "oss" Open Sound System input device. .PP The filename to provide to the input device is the device node representing the \s-1OSS\s0 input device, and is usually set to \&\fI/dev/dsp\fR. .PP For example to grab from \fI/dev/dsp\fR using \fBavconv\fR use the command: .PP .Vb 1 \& avconv \-f oss \-i /dev/dsp /tmp/oss.wav .Ve .PP For more information about \s-1OSS\s0 see: <\fBhttp://manuals.opensound.com/usersguide/dsp.html\fR> .SS "pulse" .IX Subsection "pulse" pulseaudio input device. .PP To enable this input device during configuration you need libpulse-simple installed in your system. .PP The filename to provide to the input device is a source device or the string \*(L"default\*(R" .PP To list the pulse source devices and their properties you can invoke the command \fIpactl list sources\fR. .PP .Vb 1 \& avconv \-f pulse \-i default /tmp/pulse.wav .Ve .PP \fI\fIserver\fI AVOption\fR .IX Subsection "server AVOption" .PP The syntax is: .PP .Vb 1 \& \-server .Ve .PP Connects to a specific server. .PP \fI\fIname\fI AVOption\fR .IX Subsection "name AVOption" .PP The syntax is: .PP .Vb 1 \& \-name .Ve .PP Specify the application name pulse will use when showing active clients, by default it is \*(L"libav\*(R" .PP \fI\fIstream_name\fI AVOption\fR .IX Subsection "stream_name AVOption" .PP The syntax is: .PP .Vb 1 \& \-stream_name .Ve .PP Specify the stream name pulse will use when showing active streams, by default it is \*(L"record\*(R" .PP \fI\fIsample_rate\fI AVOption\fR .IX Subsection "sample_rate AVOption" .PP The syntax is: .PP .Vb 1 \& \-sample_rate .Ve .PP Specify the samplerate in Hz, by default 48kHz is used. .PP \fI\fIchannels\fI AVOption\fR .IX Subsection "channels AVOption" .PP The syntax is: .PP .Vb 1 \& \-channels .Ve .PP Specify the channels in use, by default 2 (stereo) is set. .PP \fI\fIframe_size\fI AVOption\fR .IX Subsection "frame_size AVOption" .PP The syntax is: .PP .Vb 1 \& \-frame_size .Ve .PP Specify the number of byte per frame, by default it is set to 1024. .PP \fI\fIfragment_size\fI AVOption\fR .IX Subsection "fragment_size AVOption" .PP The syntax is: .PP .Vb 1 \& \-fragment_size .Ve .PP Specify the minimal buffering fragment in pulseaudio, it will affect the audio latency. By default it is unset. .SS "sndio" .IX Subsection "sndio" sndio input device. .PP To enable this input device during configuration you need libsndio installed on your system. .PP The filename to provide to the input device is the device node representing the sndio input device, and is usually set to \&\fI/dev/audio0\fR. .PP For example to grab from \fI/dev/audio0\fR using \fBavconv\fR use the command: .PP .Vb 1 \& avconv \-f sndio \-i /dev/audio0 /tmp/oss.wav .Ve .SS "video4linux and video4linux2" .IX Subsection "video4linux and video4linux2" Video4Linux and Video4Linux2 input video devices. .PP 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 \s-1USB\s0 webcam) is plugged into the system, and has a name of the kind \fI/dev/video\fIN\fI\fR, where \fIN\fR is a number associated to the device. .PP Video4Linux and Video4Linux2 devices only support a limited set of \&\fIwidth\fRx\fIheight\fR sizes and framerates. You can check which are supported for example with the command \fIdov4l\fR for Video4Linux devices and using \fB\-list_formats all\fR for Video4Linux2 devices. .PP 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. .PP Video4Linux support is deprecated since Linux 2.6.30, and will be dropped in later versions. .PP Follow some usage examples of the video4linux devices with the av* tools. .PP .Vb 3 \& # 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 \& # driver. \& avconv \-f video4linux2 \-i /dev/video0 out.mpeg .Ve .SS "vfwcap" .IX Subsection "vfwcap" VfW (Video for Windows) capture input device. .PP The filename passed as input is the capture driver number, ranging from 0 to 9. You may use \*(L"list\*(R" as filename to print a list of drivers. Any other filename will be interpreted as device number 0. .SS "x11grab" .IX Subsection "x11grab" X11 video input device. .PP This device allows to capture a region of an X11 display. .PP The filename passed as input has the syntax: .PP .Vb 1 \& []:.[+,] .Ve .PP \&\fIhostname\fR:\fIdisplay_number\fR.\fIscreen_number\fR specifies the X11 display name of the screen to grab from. \fIhostname\fR can be ommitted, and defaults to \*(L"localhost\*(R". The environment variable \&\fB\s-1DISPLAY\s0\fR contains the default display name. .PP \&\fIx_offset\fR and \fIy_offset\fR specify the offsets of the grabbed area with respect to the top-left border of the X11 screen. They default to 0. .PP Check the X11 documentation (e.g. man X) for more detailed information. .PP Use the \fIdpyinfo\fR program for getting basic information about the properties of your X11 display (e.g. grep for \*(L"name\*(R" or \*(L"dimensions\*(R"). .PP For example to grab from \fI:0.0\fR using \fBavconv\fR: .PP .Vb 1 \& 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 .Ve .PP \fI\fIfollow_mouse\fI AVOption\fR .IX Subsection "follow_mouse AVOption" .PP The syntax is: .PP .Vb 1 \& \-follow_mouse centered| .Ve .PP When it is specified with \*(L"centered\*(R", the grabbing region follows the mouse pointer and keeps the pointer at the center of region; otherwise, the region follows only when the mouse pointer reaches within \fI\s-1PIXELS\s0\fR (greater than zero) to the edge of region. .PP For example: .PP .Vb 1 \& 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 .Ve .PP \fI\fIshow_region\fI AVOption\fR .IX Subsection "show_region AVOption" .PP The syntax is: .PP .Vb 1 \& \-show_region 1 .Ve .PP If \fIshow_region\fR AVOption is specified with \fI1\fR, 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. .PP For example: .PP .Vb 1 \& 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 .Ve .SH "OUTPUT DEVICES" .IX Header "OUTPUT DEVICES" Output devices are configured elements in Libav which allow to write multimedia data to an output device attached to your system. .PP 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 \*(L"\-\-list\-outdevs\*(R". .PP You can disable all the output devices using the configure option \&\*(L"\-\-disable\-outdevs\*(R", and selectively enable an output device using the option "\-\-enable\-outdev=\fI\s-1OUTDEV\s0\fR\*(L", or you can disable a particular input device using the option \*(R"\-\-disable\-outdev=\fI\s-1OUTDEV\s0\fR". .PP The option \*(L"\-formats\*(R" of the av* tools will display the list of enabled output devices (amongst the muxers). .PP A description of the currently available output devices follows. .SS "alsa" .IX Subsection "alsa" \&\s-1ALSA\s0 (Advanced Linux Sound Architecture) output device. .SS "oss" .IX Subsection "oss" \&\s-1OSS\s0 (Open Sound System) output device. .SS "sndio" .IX Subsection "sndio" sndio audio output device. .SH "PROTOCOLS" .IX Header "PROTOCOLS" Protocols are configured elements in Libav which allow to access resources which require the use of a particular protocol. .PP When you configure your Libav build, all the supported protocols are enabled by default. You can list all available ones using the configure option \*(L"\-\-list\-protocols\*(R". .PP You can disable all the protocols using the configure option \&\*(L"\-\-disable\-protocols\*(R", and selectively enable a protocol using the option "\-\-enable\-protocol=\fI\s-1PROTOCOL\s0\fR\*(L", or you can disable a particular protocol using the option \&\*(R"\-\-disable\-protocol=\fI\s-1PROTOCOL\s0\fR". .PP The option \*(L"\-protocols\*(R" of the av* tools will display the list of supported protocols. .PP A description of the currently available protocols follows. .SS "applehttp" .IX Subsection "applehttp" Read Apple \s-1HTTP\s0 Live Streaming compliant segmented stream as a uniform one. The M3U8 playlists describing the segments can be remote \s-1HTTP\s0 resources or local files, accessed using the standard file protocol. \&\s-1HTTP\s0 is default, specific protocol can be declared by specifying "+\fIproto\fR" after the applehttp \s-1URI\s0 scheme name, where \fIproto\fR is either \*(L"file\*(R" or \*(L"http\*(R". .PP .Vb 3 \& applehttp://host/path/to/remote/resource.m3u8 \& applehttp+http://host/path/to/remote/resource.m3u8 \& applehttp+file://path/to/local/resource.m3u8 .Ve .SS "concat" .IX Subsection "concat" Physical concatenation protocol. .PP Allow to read and seek from many resource in sequence as if they were a unique resource. .PP A \s-1URL\s0 accepted by this protocol has the syntax: .PP .Vb 1 \& concat:||...| .Ve .PP where \fI\s-1URL1\s0\fR, \fI\s-1URL2\s0\fR, ..., \fI\s-1URLN\s0\fR are the urls of the resource to be concatenated, each one possibly specifying a distinct protocol. .PP For example to read a sequence of files \fIsplit1.mpeg\fR, \&\fIsplit2.mpeg\fR, \fIsplit3.mpeg\fR with \fIavplay\fR use the command: .PP .Vb 1 \& avplay concat:split1.mpeg\e|split2.mpeg\e|split3.mpeg .Ve .PP Note that you may need to escape the character \*(L"|\*(R" which is special for many shells. .SS "file" .IX Subsection "file" File access protocol. .PP Allow to read from or read to a file. .PP For example to read from a file \fIinput.mpeg\fR with \fBavconv\fR use the command: .PP .Vb 1 \& avconv \-i file:input.mpeg output.mpeg .Ve .PP The av* tools default to the file protocol, that is a resource specified with the name \*(L"\s-1FILE\s0.mpeg\*(R" is interpreted as the \s-1URL\s0 \&\*(L"file:FILE.mpeg\*(R". .SS "gopher" .IX Subsection "gopher" Gopher protocol. .SS "http" .IX Subsection "http" \&\s-1HTTP\s0 (Hyper Text Transfer Protocol). .SS "mmst" .IX Subsection "mmst" \&\s-1MMS\s0 (Microsoft Media Server) protocol over \s-1TCP\s0. .SS "mmsh" .IX Subsection "mmsh" \&\s-1MMS\s0 (Microsoft Media Server) protocol over \s-1HTTP\s0. .PP The required syntax is: .PP .Vb 1 \& mmsh://[:][/][/] .Ve .SS "md5" .IX Subsection "md5" \&\s-1MD5\s0 output protocol. .PP Computes the \s-1MD5\s0 hash of the data to be written, and on close writes this to the designated output or stdout if none is specified. It can be used to test muxers without writing an actual file. .PP Some examples follow. .PP .Vb 2 \& # Write the MD5 hash of the encoded AVI file to the file output.avi.md5. \& avconv \-i input.flv \-f avi \-y md5:output.avi.md5 \& \& # Write the MD5 hash of the encoded AVI file to stdout. \& avconv \-i input.flv \-f avi \-y md5: .Ve .PP Note that some formats (typically \s-1MOV\s0) require the output protocol to be seekable, so they will fail with the \s-1MD5\s0 output protocol. .SS "pipe" .IX Subsection "pipe" \&\s-1UNIX\s0 pipe access protocol. .PP Allow to read and write from \s-1UNIX\s0 pipes. .PP The accepted syntax is: .PP .Vb 1 \& pipe:[] .Ve .PP \&\fInumber\fR is the number corresponding to the file descriptor of the pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If \fInumber\fR is not specified, by default the stdout file descriptor will be used for writing, stdin for reading. .PP For example to read from stdin with \fBavconv\fR: .PP .Vb 3 \& cat test.wav | avconv \-i pipe:0 \& # ...this is the same as... \& cat test.wav | avconv \-i pipe: .Ve .PP For writing to stdout with \fBavconv\fR: .PP .Vb 3 \& avconv \-i test.wav \-f avi pipe:1 | cat > test.avi \& # ...this is the same as... \& avconv \-i test.wav \-f avi pipe: | cat > test.avi .Ve .PP Note that some formats (typically \s-1MOV\s0), require the output protocol to be seekable, so they will fail with the pipe output protocol. .SS "rtmp" .IX Subsection "rtmp" Real-Time Messaging Protocol. .PP The Real-Time Messaging Protocol (\s-1RTMP\s0) is used for streaming multimedia content across a \s-1TCP/IP\s0 network. .PP The required syntax is: .PP .Vb 1 \& rtmp://[:][/][/] .Ve .PP The accepted parameters are: .IP "\fBserver\fR" 4 .IX Item "server" The address of the \s-1RTMP\s0 server. .IP "\fBport\fR" 4 .IX Item "port" The number of the \s-1TCP\s0 port to use (by default is 1935). .IP "\fBapp\fR" 4 .IX Item "app" It is the name of the application to access. It usually corresponds to the path where the application is installed on the \s-1RTMP\s0 server (e.g. \fI/ondemand/\fR, \fI/flash/live/\fR, etc.). .IP "\fBplaypath\fR" 4 .IX Item "playpath" It is the path or name of the resource to play with reference to the application specified in \fIapp\fR, may be prefixed by \*(L"mp4:\*(R". .PP For example to read with \fIavplay\fR a multimedia resource named \&\*(L"sample\*(R" from the application \*(L"vod\*(R" from an \s-1RTMP\s0 server \*(L"myserver\*(R": .PP .Vb 1 \& avplay rtmp://myserver/vod/sample .Ve .SS "rtmp, rtmpe, rtmps, rtmpt, rtmpte" .IX Subsection "rtmp, rtmpe, rtmps, rtmpt, rtmpte" Real-Time Messaging Protocol and its variants supported through librtmp. .PP Requires the presence of the librtmp headers and library during configuration. You need to explicitly configure the build with \&\*(L"\-\-enable\-librtmp\*(R". If enabled this will replace the native \s-1RTMP\s0 protocol. .PP This protocol provides most client functions and a few server functions needed to support \s-1RTMP\s0, \s-1RTMP\s0 tunneled in \s-1HTTP\s0 (\s-1RTMPT\s0), encrypted \s-1RTMP\s0 (\s-1RTMPE\s0), \s-1RTMP\s0 over \s-1SSL/TLS\s0 (\s-1RTMPS\s0) and tunneled variants of these encrypted types (\s-1RTMPTE\s0, \s-1RTMPTS\s0). .PP The required syntax is: .PP .Vb 1 \& ://[:][/][/] .Ve .PP where \fIrtmp_proto\fR is one of the strings \*(L"rtmp\*(R", \*(L"rtmpt\*(R", \*(L"rtmpe\*(R", \&\*(L"rtmps\*(R", \*(L"rtmpte\*(R", \*(L"rtmpts\*(R" corresponding to each \s-1RTMP\s0 variant, and \&\fIserver\fR, \fIport\fR, \fIapp\fR and \fIplaypath\fR have the same meaning as specified for the \s-1RTMP\s0 native protocol. \&\fIoptions\fR contains a list of space-separated options of the form \&\fIkey\fR=\fIval\fR. .PP See the librtmp manual page (man 3 librtmp) for more information. .PP For example, to stream a file in real-time to an \s-1RTMP\s0 server using \&\fBavconv\fR: .PP .Vb 1 \& avconv \-re \-i myfile \-f flv rtmp://myserver/live/mystream .Ve .PP To play the same stream using \fIavplay\fR: .PP .Vb 1 \& avplay "rtmp://myserver/live/mystream live=1" .Ve .SS "rtp" .IX Subsection "rtp" Real-Time Protocol. .SS "rtsp" .IX Subsection "rtsp" \&\s-1RTSP\s0 is not technically a protocol handler in libavformat, it is a demuxer and muxer. The demuxer supports both normal \s-1RTSP\s0 (with data transferred over \s-1RTP\s0; this is used by e.g. Apple and Microsoft) and Real-RTSP (with data transferred over \s-1RDT\s0). .PP The muxer can be used to send a stream using \s-1RTSP\s0 \s-1ANNOUNCE\s0 to a server supporting it (currently Darwin Streaming Server and Mischa Spiegelmock's \s-1RTSP\s0 server (\f(CW\*(C`http://github.com/revmischa/rtsp\-server\*(C'\fR)). .PP The required syntax for a \s-1RTSP\s0 url is: .PP .Vb 1 \& rtsp://[:]/ .Ve .PP The following options (set on the \fBavconv\fR/\fIavplay\fR command line, or set in code via \f(CW\*(C`AVOption\*(C'\fRs or in \f(CW\*(C`avformat_open_input\*(C'\fR), are supported: .PP Flags for \f(CW\*(C`rtsp_transport\*(C'\fR: .IP "\fBudp\fR" 4 .IX Item "udp" Use \s-1UDP\s0 as lower transport protocol. .IP "\fBtcp\fR" 4 .IX Item "tcp" Use \s-1TCP\s0 (interleaving within the \s-1RTSP\s0 control channel) as lower transport protocol. .IP "\fBudp_multicast\fR" 4 .IX Item "udp_multicast" Use \s-1UDP\s0 multicast as lower transport protocol. .IP "\fBhttp\fR" 4 .IX Item "http" Use \s-1HTTP\s0 tunneling as lower transport protocol, which is useful for passing proxies. .PP Multiple lower transport protocols may be specified, in that case they are tried one at a time (if the setup of one fails, the next one is tried). For the muxer, only the \f(CW\*(C`tcp\*(C'\fR and \f(CW\*(C`udp\*(C'\fR options are supported. .PP Flags for \f(CW\*(C`rtsp_flags\*(C'\fR: .IP "\fBfilter_src\fR" 4 .IX Item "filter_src" Accept packets only from negotiated peer address and port. .PP When receiving data over \s-1UDP\s0, the demuxer tries to reorder received packets (since they may arrive out of order, or packets may get lost totally). In order for this to be enabled, a maximum delay must be specified in the \&\f(CW\*(C`max_delay\*(C'\fR field of AVFormatContext. .PP When watching multi-bitrate Real-RTSP streams with \fIavplay\fR, the streams to display can be chosen with \f(CW\*(C`\-vst\*(C'\fR \fIn\fR and \&\f(CW\*(C`\-ast\*(C'\fR \fIn\fR for video and audio respectively, and can be switched on the fly by pressing \f(CW\*(C`v\*(C'\fR and \f(CW\*(C`a\*(C'\fR. .PP Example command lines: .PP To watch a stream over \s-1UDP\s0, with a max reordering delay of 0.5 seconds: .PP .Vb 1 \& avplay \-max_delay 500000 \-rtsp_transport udp rtsp://server/video.mp4 .Ve .PP To watch a stream tunneled over \s-1HTTP:\s0 .PP .Vb 1 \& avplay \-rtsp_transport http rtsp://server/video.mp4 .Ve .PP To send a stream in realtime to a \s-1RTSP\s0 server, for others to watch: .PP .Vb 1 \& avconv \-re \-i \-f rtsp \-muxdelay 0.1 rtsp://server/live.sdp .Ve .SS "sap" .IX Subsection "sap" Session Announcement Protocol (\s-1RFC\s0 2974). This is not technically a protocol handler in libavformat, it is a muxer and demuxer. It is used for signalling of \s-1RTP\s0 streams, by announcing the \s-1SDP\s0 for the streams regularly on a separate port. .PP \fIMuxer\fR .IX Subsection "Muxer" .PP The syntax for a \s-1SAP\s0 url given to the muxer is: .PP .Vb 1 \& sap://[:][?] .Ve .PP The \s-1RTP\s0 packets are sent to \fIdestination\fR on port \fIport\fR, or to port 5004 if no port is specified. \&\fIoptions\fR is a \f(CW\*(C`&\*(C'\fR\-separated list. The following options are supported: .IP "\fBannounce_addr=\fR\fIaddress\fR" 4 .IX Item "announce_addr=address" Specify the destination \s-1IP\s0 address for sending the announcements to. If omitted, the announcements are sent to the commonly used \s-1SAP\s0 announcement multicast address 224.2.127.254 (sap.mcast.net), or ff0e::2:7ffe if \fIdestination\fR is an IPv6 address. .IP "\fBannounce_port=\fR\fIport\fR" 4 .IX Item "announce_port=port" Specify the port to send the announcements on, defaults to 9875 if not specified. .IP "\fBttl=\fR\fIttl\fR" 4 .IX Item "ttl=ttl" Specify the time to live value for the announcements and \s-1RTP\s0 packets, defaults to 255. .IP "\fBsame_port=\fR\fI0|1\fR" 4 .IX Item "same_port=0|1" If set to 1, send all \s-1RTP\s0 streams on the same port pair. If zero (the default), all streams are sent on unique ports, with each stream on a port 2 numbers higher than the previous. VLC/Live555 requires this to be set to 1, to be able to receive the stream. The \s-1RTP\s0 stack in libavformat for receiving requires all streams to be sent on unique ports. .PP Example command lines follow. .PP To broadcast a stream on the local subnet, for watching in \s-1VLC:\s0 .PP .Vb 1 \& avconv \-re \-i \-f sap sap://224.0.0.255?same_port=1 .Ve .PP Similarly, for watching in avplay: .PP .Vb 1 \& avconv \-re \-i \-f sap sap://224.0.0.255 .Ve .PP And for watching in avplay, over IPv6: .PP .Vb 1 \& avconv \-re \-i \-f sap sap://[ff0e::1:2:3:4] .Ve .PP \fIDemuxer\fR .IX Subsection "Demuxer" .PP The syntax for a \s-1SAP\s0 url given to the demuxer is: .PP .Vb 1 \& sap://[
][:] .Ve .PP \&\fIaddress\fR is the multicast address to listen for announcements on, if omitted, the default 224.2.127.254 (sap.mcast.net) is used. \fIport\fR is the port that is listened on, 9875 if omitted. .PP The demuxers listens for announcements on the given address and port. Once an announcement is received, it tries to receive that particular stream. .PP Example command lines follow. .PP To play back the first stream announced on the normal \s-1SAP\s0 multicast address: .PP .Vb 1 \& avplay sap:// .Ve .PP To play back the first stream announced on one the default IPv6 \s-1SAP\s0 multicast address: .PP .Vb 1 \& avplay sap://[ff0e::2:7ffe] .Ve .SS "tcp" .IX Subsection "tcp" Trasmission Control Protocol. .PP The required syntax for a \s-1TCP\s0 url is: .PP .Vb 1 \& tcp://:[?] .Ve .IP "\fBlisten\fR" 4 .IX Item "listen" Listen for an incoming connection .Sp .Vb 2 \& avconv \-i \-f tcp://:?listen \& avplay tcp://: .Ve .SS "udp" .IX Subsection "udp" User Datagram Protocol. .PP The required syntax for a \s-1UDP\s0 url is: .PP .Vb 1 \& udp://:[?] .Ve .PP \&\fIoptions\fR contains a list of &\-seperated options of the form \fIkey\fR=\fIval\fR. Follow the list of supported options. .IP "\fBbuffer_size=\fR\fIsize\fR" 4 .IX Item "buffer_size=size" set the \s-1UDP\s0 buffer size in bytes .IP "\fBlocalport=\fR\fIport\fR" 4 .IX Item "localport=port" override the local \s-1UDP\s0 port to bind with .IP "\fBlocaladdr=\fR\fIaddr\fR" 4 .IX Item "localaddr=addr" Choose the local \s-1IP\s0 address. This is useful e.g. if sending multicast and the host has multiple interfaces, where the user can choose which interface to send on by specifying the \s-1IP\s0 address of that interface. .IP "\fBpkt_size=\fR\fIsize\fR" 4 .IX Item "pkt_size=size" set the size in bytes of \s-1UDP\s0 packets .IP "\fBreuse=\fR\fI1|0\fR" 4 .IX Item "reuse=1|0" explicitly allow or disallow reusing \s-1UDP\s0 sockets .IP "\fBttl=\fR\fIttl\fR" 4 .IX Item "ttl=ttl" set the time to live value (for multicast only) .IP "\fBconnect=\fR\fI1|0\fR" 4 .IX Item "connect=1|0" Initialize the \s-1UDP\s0 socket with \f(CW\*(C`connect()\*(C'\fR. In this case, the destination address can't be changed with ff_udp_set_remote_url later. If the destination address isn't known at the start, this option can be specified in ff_udp_set_remote_url, too. This allows finding out the source address for the packets with getsockname, and makes writes return with \s-1AVERROR\s0(\s-1ECONNREFUSED\s0) if \*(L"destination unreachable\*(R" is received. For receiving, this gives the benefit of only receiving packets from the specified peer address/port. .PP Some usage examples of the udp protocol with \fBavconv\fR follow. .PP To stream over \s-1UDP\s0 to a remote endpoint: .PP .Vb 1 \& avconv \-i \-f udp://: .Ve .PP To stream in mpegts format over \s-1UDP\s0 using 188 sized \s-1UDP\s0 packets, using a large input buffer: .PP .Vb 1 \& avconv \-i \-f mpegts udp://:?pkt_size=188&buffer_size=65535 .Ve .PP To receive over \s-1UDP\s0 from a remote endpoint: .PP .Vb 1 \& avconv \-i udp://[]: .Ve .SH "FILTERGRAPH DESCRIPTION" .IX Header "FILTERGRAPH DESCRIPTION" A filtergraph is a directed graph of connected filters. It can contain cycles, and there can be multiple links between a pair of filters. Each link has one input pad on one side connecting it to one filter from which it takes its input, and one output pad on the other side connecting it to the one filter accepting its output. .PP Each filter in a filtergraph is an instance of a filter class registered in the application, which defines the features and the number of input and output pads of the filter. .PP A filter with no input pads is called a \*(L"source\*(R", a filter with no output pads is called a \*(L"sink\*(R". .SS "Filtergraph syntax" .IX Subsection "Filtergraph syntax" A filtergraph can be represented using a textual representation, which is recognized by the \f(CW\*(C`\-vf\*(C'\fR and \f(CW\*(C`\-af\*(C'\fR options in \fBavconv\fR and \fBavplay\fR, and by the \f(CW\*(C`av_parse_graph()\*(C'\fR function defined in \&\fIlibavfilter/avfiltergraph\fR. .PP A filterchain consists of a sequence of connected filters, each one connected to the previous one in the sequence. A filterchain is represented by a list of \*(L",\*(R"\-separated filter descriptions. .PP A filtergraph consists of a sequence of filterchains. A sequence of filterchains is represented by a list of \*(L";\*(R"\-separated filterchain descriptions. .PP A filter is represented by a string of the form: [\fIin_link_1\fR]...[\fIin_link_N\fR]\fIfilter_name\fR=\fIarguments\fR[\fIout_link_1\fR]...[\fIout_link_M\fR] .PP \&\fIfilter_name\fR is the name of the filter class of which the described filter is an instance of, and has to be the name of one of the filter classes registered in the program. The name of the filter class is optionally followed by a string "=\fIarguments\fR". .PP \&\fIarguments\fR is a string which contains the parameters used to initialize the filter instance, and are described in the filter descriptions below. .PP The list of arguments can be quoted using the character \*(L"'\*(R" as initial and ending mark, and the character '\e' for escaping the characters within the quoted text; otherwise the argument string is considered terminated when the next special character (belonging to the set \&\*(L"[]=;,\*(R") is encountered. .PP The name and arguments of the filter are optionally preceded and followed by a list of link labels. A link label allows to name a link and associate it to a filter output or input pad. The preceding labels \fIin_link_1\fR \&... \fIin_link_N\fR, are associated to the filter input pads, the following labels \fIout_link_1\fR ... \fIout_link_M\fR, are associated to the output pads. .PP When two link labels with the same name are found in the filtergraph, a link between the corresponding input and output pad is created. .PP If an output pad is not labelled, it is linked by default to the first unlabelled input pad of the next filter in the filterchain. For example in the filterchain: .PP .Vb 1 \& nullsrc, split[L1], [L2]overlay, nullsink .Ve .PP the split filter instance has two output pads, and the overlay filter instance two input pads. The first output pad of split is labelled \&\*(L"L1\*(R", the first input pad of overlay is labelled \*(L"L2\*(R", and the second output pad of split is linked to the second input pad of overlay, which are both unlabelled. .PP In a complete filterchain all the unlabelled filter input and output pads must be connected. A filtergraph is considered valid if all the filter input and output pads of all the filterchains are connected. .PP Follows a \s-1BNF\s0 description for the filtergraph syntax: .PP .Vb 7 \& ::= sequence of alphanumeric characters and \*(Aq_\*(Aq \& ::= "[" "]" \& ::= [] \& ::= sequence of chars (eventually quoted) \& ::= [] ["=" ] [] \& ::= [,] \& ::= [;] .Ve .SH "AUDIO FILTERS" .IX Header "AUDIO FILTERS" When you configure your Libav build, you can disable any of the existing filters using \-\-disable\-filters. The configure output will show the audio filters included in your build. .PP Below is a description of the currently available audio filters. .SS "anull" .IX Subsection "anull" Pass the audio source unchanged to the output. .SH "AUDIO SOURCES" .IX Header "AUDIO SOURCES" Below is a description of the currently available audio sources. .SS "anullsrc" .IX Subsection "anullsrc" Null audio source, never return audio frames. It is mainly useful as a template and to be employed in analysis / debugging tools. .PP It accepts as optional parameter a string of the form \&\fIsample_rate\fR:\fIchannel_layout\fR. .PP \&\fIsample_rate\fR specify the sample rate, and defaults to 44100. .PP \&\fIchannel_layout\fR specify the channel layout, and can be either an integer or a string representing a channel layout. The default value of \fIchannel_layout\fR is 3, which corresponds to \s-1CH_LAYOUT_STEREO\s0. .PP Check the channel_layout_map definition in \&\fIlibavcodec/audioconvert.c\fR for the mapping between strings and channel layout values. .PP Follow some examples: .PP .Vb 2 \& # set the sample rate to 48000 Hz and the channel layout to CH_LAYOUT_MONO. \& anullsrc=48000:4 \& \& # same as \& anullsrc=48000:mono .Ve .SH "AUDIO SINKS" .IX Header "AUDIO SINKS" Below is a description of the currently available audio sinks. .SS "anullsink" .IX Subsection "anullsink" Null audio sink, do absolutely nothing with the input audio. It is mainly useful as a template and to be employed in analysis / debugging tools. .SH "VIDEO FILTERS" .IX Header "VIDEO FILTERS" When you configure your Libav build, you can disable any of the existing filters using \-\-disable\-filters. The configure output will show the video filters included in your build. .PP Below is a description of the currently available video filters. .SS "blackframe" .IX Subsection "blackframe" Detect frames that are (almost) completely black. Can be useful to detect chapter transitions or commercials. Output lines consist of the frame number of the detected frame, the percentage of blackness, the position in the file if known or \-1 and the timestamp in seconds. .PP In order to display the output lines, you need to set the loglevel at least to the \s-1AV_LOG_INFO\s0 value. .PP The filter accepts the syntax: .PP .Vb 1 \& blackframe[=:[]] .Ve .PP \&\fIamount\fR is the percentage of the pixels that have to be below the threshold, and defaults to 98. .PP \&\fIthreshold\fR is the threshold below which a pixel value is considered black, and defaults to 32. .SS "boxblur" .IX Subsection "boxblur" Apply boxblur algorithm to the input video. .PP This filter accepts the parameters: \&\fIluma_power\fR:\fIluma_radius\fR:\fIchroma_radius\fR:\fIchroma_power\fR:\fIalpha_radius\fR:\fIalpha_power\fR .PP Chroma and alpha parameters are optional, if not specified they default to the corresponding values set for \fIluma_radius\fR and \&\fIluma_power\fR. .PP \&\fIluma_radius\fR, \fIchroma_radius\fR, and \fIalpha_radius\fR represent the radius in pixels of the box used for blurring the corresponding input plane. They are expressions, and can contain the following constants: .IP "\fBw, h\fR" 4 .IX Item "w, h" the input width and height in pixels .IP "\fBcw, ch\fR" 4 .IX Item "cw, ch" the input chroma image width and height in pixels .IP "\fBhsub, vsub\fR" 4 .IX Item "hsub, vsub" horizontal and vertical chroma subsample values. For example for the pixel format \*(L"yuv422p\*(R" \fIhsub\fR is 2 and \fIvsub\fR is 1. .PP The radius must be a non-negative number, and must not be greater than the value of the expression \f(CW\*(C`min(w,h)/2\*(C'\fR for the luma and alpha planes, and of \f(CW\*(C`min(cw,ch)/2\*(C'\fR for the chroma planes. .PP \&\fIluma_power\fR, \fIchroma_power\fR, and \fIalpha_power\fR represent how many times the boxblur filter is applied to the corresponding plane. .PP Some examples follow: .IP "\(bu" 4 Apply a boxblur filter with luma, chroma, and alpha radius set to 2: .Sp .Vb 1 \& boxblur=2:1 .Ve .IP "\(bu" 4 Set luma radius to 2, alpha and chroma radius to 0 .Sp .Vb 1 \& boxblur=2:1:0:0:0:0 .Ve .IP "\(bu" 4 Set luma and chroma radius to a fraction of the video dimension .Sp .Vb 1 \& boxblur=min(h,w)/10:1:min(cw,ch)/10:1 .Ve .SS "copy" .IX Subsection "copy" Copy the input source unchanged to the output. Mainly useful for testing purposes. .SS "crop" .IX Subsection "crop" Crop the input video to \fIout_w\fR:\fIout_h\fR:\fIx\fR:\fIy\fR. .PP The parameters are expressions containing the following constants: .IP "\fBE, \s-1PI\s0, \s-1PHI\s0\fR" 4 .IX Item "E, PI, PHI" the corresponding mathematical approximated values for e (euler number), pi (greek \s-1PI\s0), \s-1PHI\s0 (golden ratio) .IP "\fBx, y\fR" 4 .IX Item "x, y" the computed values for \fIx\fR and \fIy\fR. They are evaluated for each new frame. .IP "\fBin_w, in_h\fR" 4 .IX Item "in_w, in_h" the input width and height .IP "\fBiw, ih\fR" 4 .IX Item "iw, ih" same as \fIin_w\fR and \fIin_h\fR .IP "\fBout_w, out_h\fR" 4 .IX Item "out_w, out_h" the output (cropped) width and height .IP "\fBow, oh\fR" 4 .IX Item "ow, oh" same as \fIout_w\fR and \fIout_h\fR .IP "\fBn\fR" 4 .IX Item "n" the number of input frame, starting from 0 .IP "\fBpos\fR" 4 .IX Item "pos" the position in the file of the input frame, \s-1NAN\s0 if unknown .IP "\fBt\fR" 4 .IX Item "t" timestamp expressed in seconds, \s-1NAN\s0 if the input timestamp is unknown .PP The \fIout_w\fR and \fIout_h\fR parameters specify the expressions for the width and height of the output (cropped) video. They are evaluated just at the configuration of the filter. .PP The default value of \fIout_w\fR is \*(L"in_w\*(R", and the default value of \&\fIout_h\fR is \*(L"in_h\*(R". .PP The expression for \fIout_w\fR may depend on the value of \fIout_h\fR, and the expression for \fIout_h\fR may depend on \fIout_w\fR, but they cannot depend on \fIx\fR and \fIy\fR, as \fIx\fR and \fIy\fR are evaluated after \fIout_w\fR and \fIout_h\fR. .PP The \fIx\fR and \fIy\fR parameters specify the expressions for the position of the top-left corner of the output (non-cropped) area. They are evaluated for each frame. If the evaluated value is not valid, it is approximated to the nearest valid value. .PP The default value of \fIx\fR is \*(L"(in_w\-out_w)/2\*(R", and the default value for \fIy\fR is \*(L"(in_h\-out_h)/2\*(R", which set the cropped area at the center of the input image. .PP The expression for \fIx\fR may depend on \fIy\fR, and the expression for \fIy\fR may depend on \fIx\fR. .PP Follow some examples: .PP .Vb 2 \& # crop the central input area with size 100x100 \& crop=100:100 \& \& # crop the central input area with size 2/3 of the input video \& "crop=2/3*in_w:2/3*in_h" \& \& # crop the input video central square \& crop=in_h \& \& # delimit the rectangle with the top\-left corner placed at position \& # 100:100 and the right\-bottom corner corresponding to the right\-bottom \& # corner of the input image. \& crop=in_w\-100:in_h\-100:100:100 \& \& # crop 10 pixels from the left and right borders, and 20 pixels from \& # the top and bottom borders \& "crop=in_w\-2*10:in_h\-2*20" \& \& # keep only the bottom right quarter of the input image \& "crop=in_w/2:in_h/2:in_w/2:in_h/2" \& \& # crop height for getting Greek harmony \& "crop=in_w:1/PHI*in_w" \& \& # trembling effect \& "crop=in_w/2:in_h/2:(in_w\-out_w)/2+((in_w\-out_w)/2)*sin(n/10):(in_h\-out_h)/2 +((in_h\-out_h)/2)*sin(n/7)" \& \& # erratic camera effect depending on timestamp \& "crop=in_w/2:in_h/2:(in_w\-out_w)/2+((in_w\-out_w)/2)*sin(t*10):(in_h\-out_h)/2 +((in_h\-out_h)/2)*sin(t*13)" \& \& # set x depending on the value of y \& "crop=in_w/2:in_h/2:y:10+10*sin(n/10)" .Ve .SS "cropdetect" .IX Subsection "cropdetect" Auto-detect crop size. .PP Calculate necessary cropping parameters and prints the recommended parameters through the logging system. The detected dimensions correspond to the non-black area of the input video. .PP It accepts the syntax: .PP .Vb 1 \& cropdetect[=[:[:]]] .Ve .IP "\fBlimit\fR" 4 .IX Item "limit" Threshold, which can be optionally specified from nothing (0) to everything (255), defaults to 24. .IP "\fBround\fR" 4 .IX Item "round" Value which the width/height should be divisible by, defaults to 16. The offset is automatically adjusted to center the video. Use 2 to get only even dimensions (needed for 4:2:2 video). 16 is best when encoding to most video codecs. .IP "\fBreset\fR" 4 .IX Item "reset" Counter that determines after how many frames cropdetect will reset the previously detected largest video area and start over to detect the current optimal crop area. Defaults to 0. .Sp This can be useful when channel logos distort the video area. 0 indicates never reset and return the largest area encountered during playback. .SS "delogo" .IX Subsection "delogo" Suppress a \s-1TV\s0 station logo by a simple interpolation of the surrounding pixels. Just set a rectangle covering the logo and watch it disappear (and sometimes something even uglier appear \- your mileage may vary). .PP The filter accepts parameters as a string of the form "\fIx\fR:\fIy\fR:\fIw\fR:\fIh\fR:\fIband\fR", or as a list of \&\fIkey\fR=\fIvalue\fR pairs, separated by \*(L":\*(R". .PP The description of the accepted parameters follows. .IP "\fBx, y\fR" 4 .IX Item "x, y" Specify the top left corner coordinates of the logo. They must be specified. .IP "\fBw, h\fR" 4 .IX Item "w, h" Specify the width and height of the logo to clear. They must be specified. .IP "\fBband, t\fR" 4 .IX Item "band, t" Specify the thickness of the fuzzy edge of the rectangle (added to \&\fIw\fR and \fIh\fR). The default value is 4. .IP "\fBshow\fR" 4 .IX Item "show" When set to 1, a green rectangle is drawn on the screen to simplify finding the right \fIx\fR, \fIy\fR, \fIw\fR, \fIh\fR parameters, and \&\fIband\fR is set to 4. The default value is 0. .PP Some examples follow. .IP "\(bu" 4 Set a rectangle covering the area with top left corner coordinates 0,0 and size 100x77, setting a band of size 10: .Sp .Vb 1 \& delogo=0:0:100:77:10 .Ve .IP "\(bu" 4 As the previous example, but use named options: .Sp .Vb 1 \& delogo=x=0:y=0:w=100:h=77:band=10 .Ve .SS "drawbox" .IX Subsection "drawbox" Draw a colored box on the input image. .PP It accepts the syntax: .PP .Vb 1 \& drawbox=:::: .Ve .IP "\fBx, y\fR" 4 .IX Item "x, y" Specify the top left corner coordinates of the box. Default to 0. .IP "\fBwidth, height\fR" 4 .IX Item "width, height" Specify the width and height of the box, if 0 they are interpreted as the input width and height. Default to 0. .IP "\fBcolor\fR" 4 .IX Item "color" Specify the color of the box to write, it can be the name of a color (case insensitive match) or a 0xRRGGBB[\s-1AA\s0] sequence. .PP Follow some examples: .PP .Vb 2 \& # draw a black box around the edge of the input image \& drawbox \& \& # draw a box with color red and an opacity of 50% \& drawbox=10:20:200:60:red@0.5" .Ve .SS "drawtext" .IX Subsection "drawtext" Draw text string or text from specified file on top of video using the libfreetype library. .PP To enable compilation of this filter you need to configure Libav with \&\f(CW\*(C`\-\-enable\-libfreetype\*(C'\fR. .PP The filter also recognizes \fIstrftime()\fR sequences in the provided text and expands them accordingly. Check the documentation of \fIstrftime()\fR. .PP The filter accepts parameters as a list of \fIkey\fR=\fIvalue\fR pairs, separated by \*(L":\*(R". .PP The description of the accepted parameters follows. .IP "\fBfontfile\fR" 4 .IX Item "fontfile" The font file to be used for drawing text. Path must be included. This parameter is mandatory. .IP "\fBtext\fR" 4 .IX Item "text" The text string to be drawn. The text must be a sequence of \s-1UTF\-8\s0 encoded characters. This parameter is mandatory if no file is specified with the parameter \&\fItextfile\fR. .IP "\fBtextfile\fR" 4 .IX Item "textfile" A text file containing text to be drawn. The text must be a sequence of \s-1UTF\-8\s0 encoded characters. .Sp This parameter is mandatory if no text string is specified with the parameter \fItext\fR. .Sp If both text and textfile are specified, an error is thrown. .IP "\fBx, y\fR" 4 .IX Item "x, y" The offsets where text will be drawn within the video frame. Relative to the top/left border of the output image. They accept expressions similar to the overlay filter: .RS 4 .IP "\fBx, y\fR" 4 .IX Item "x, y" the computed values for \fIx\fR and \fIy\fR. They are evaluated for each new frame. .IP "\fBmain_w, main_h\fR" 4 .IX Item "main_w, main_h" main input width and height .IP "\fBW, H\fR" 4 .IX Item "W, H" same as \fImain_w\fR and \fImain_h\fR .IP "\fBtext_w, text_h\fR" 4 .IX Item "text_w, text_h" rendered text width and height .IP "\fBw, h\fR" 4 .IX Item "w, h" same as \fItext_w\fR and \fItext_h\fR .IP "\fBn\fR" 4 .IX Item "n" the number of frames processed, starting from 0 .IP "\fBt\fR" 4 .IX Item "t" timestamp expressed in seconds, \s-1NAN\s0 if the input timestamp is unknown .RE .RS 4 .Sp The default value of \fIx\fR and \fIy\fR is 0. .RE .IP "\fBfontsize\fR" 4 .IX Item "fontsize" The font size to be used for drawing text. The default value of \fIfontsize\fR is 16. .IP "\fBfontcolor\fR" 4 .IX Item "fontcolor" The color to be used for drawing fonts. Either a string (e.g. \*(L"red\*(R") or in 0xRRGGBB[\s-1AA\s0] format (e.g. \*(L"0xff000033\*(R"), possibly followed by an alpha specifier. The default value of \fIfontcolor\fR is \*(L"black\*(R". .IP "\fBboxcolor\fR" 4 .IX Item "boxcolor" The color to be used for drawing box around text. Either a string (e.g. \*(L"yellow\*(R") or in 0xRRGGBB[\s-1AA\s0] format (e.g. \*(L"0xff00ff\*(R"), possibly followed by an alpha specifier. The default value of \fIboxcolor\fR is \*(L"white\*(R". .IP "\fBbox\fR" 4 .IX Item "box" Used to draw a box around text using background color. Value should be either 1 (enable) or 0 (disable). The default value of \fIbox\fR is 0. .IP "\fBshadowx, shadowy\fR" 4 .IX Item "shadowx, shadowy" The x and y offsets for the text shadow position with respect to the position of the text. They can be either positive or negative values. Default value for both is \*(L"0\*(R". .IP "\fBshadowcolor\fR" 4 .IX Item "shadowcolor" The color to be used for drawing a shadow behind the drawn text. It can be a color name (e.g. \*(L"yellow\*(R") or a string in the 0xRRGGBB[\s-1AA\s0] form (e.g. \*(L"0xff00ff\*(R"), possibly followed by an alpha specifier. The default value of \fIshadowcolor\fR is \*(L"black\*(R". .IP "\fBft_load_flags\fR" 4 .IX Item "ft_load_flags" Flags to be used for loading the fonts. .Sp The flags map the corresponding flags supported by libfreetype, and are a combination of the following values: .RS 4 .IP "\fIdefault\fR" 4 .IX Item "default" .PD 0 .IP "\fIno_scale\fR" 4 .IX Item "no_scale" .IP "\fIno_hinting\fR" 4 .IX Item "no_hinting" .IP "\fIrender\fR" 4 .IX Item "render" .IP "\fIno_bitmap\fR" 4 .IX Item "no_bitmap" .IP "\fIvertical_layout\fR" 4 .IX Item "vertical_layout" .IP "\fIforce_autohint\fR" 4 .IX Item "force_autohint" .IP "\fIcrop_bitmap\fR" 4 .IX Item "crop_bitmap" .IP "\fIpedantic\fR" 4 .IX Item "pedantic" .IP "\fIignore_global_advance_width\fR" 4 .IX Item "ignore_global_advance_width" .IP "\fIno_recurse\fR" 4 .IX Item "no_recurse" .IP "\fIignore_transform\fR" 4 .IX Item "ignore_transform" .IP "\fImonochrome\fR" 4 .IX Item "monochrome" .IP "\fIlinear_design\fR" 4 .IX Item "linear_design" .IP "\fIno_autohint\fR" 4 .IX Item "no_autohint" .IP "\fIend table\fR" 4 .IX Item "end table" .RE .RS 4 .PD .Sp Default value is \*(L"render\*(R". .Sp For more information consult the documentation for the FT_LOAD_* libfreetype flags. .RE .IP "\fBtabsize\fR" 4 .IX Item "tabsize" The size in number of spaces to use for rendering the tab. Default value is 4. .PP For example the command: .PP .Vb 1 \& drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text=\*(AqTest Text\*(Aq" .Ve .PP will draw \*(L"Test Text\*(R" with font FreeSerif, using the default values for the optional parameters. .PP The command: .PP .Vb 2 \& drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text=\*(AqTest Text\*(Aq:\e \& x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2" .Ve .PP will draw 'Test Text' with font FreeSerif of size 24 at position x=100 and y=50 (counting from the top-left corner of the screen), text is yellow with a red box around it. Both the text and the box have an opacity of 20%. .PP Note that the double quotes are not necessary if spaces are not used within the parameter list. .PP For more information about libfreetype, check: <\fBhttp://www.freetype.org/\fR>. .SS "fade" .IX Subsection "fade" Apply fade\-in/out effect to input video. .PP It accepts the parameters: \&\fItype\fR:\fIstart_frame\fR:\fInb_frames\fR .PP \&\fItype\fR specifies if the effect type, can be either \*(L"in\*(R" for fade-in, or \*(L"out\*(R" for a fade-out effect. .PP \&\fIstart_frame\fR specifies the number of the start frame for starting to apply the fade effect. .PP \&\fInb_frames\fR specifies the number of frames for which the fade effect has to last. At the end of the fade-in effect the output video will have the same intensity as the input video, at the end of the fade-out transition the output video will be completely black. .PP A few usage examples follow, usable too as test scenarios. .PP .Vb 2 \& # fade in first 30 frames of video \& fade=in:0:30 \& \& # fade out last 45 frames of a 200\-frame video \& fade=out:155:45 \& \& # fade in first 25 frames and fade out last 25 frames of a 1000\-frame video \& fade=in:0:25, fade=out:975:25 \& \& # make first 5 frames black, then fade in from frame 5\-24 \& fade=in:5:20 .Ve .SS "fieldorder" .IX Subsection "fieldorder" Transform the field order of the input video. .PP It accepts one parameter which specifies the required field order that the input interlaced video will be transformed to. The parameter can assume one of the following values: .IP "\fB0 or bff\fR" 4 .IX Item "0 or bff" output bottom field first .IP "\fB1 or tff\fR" 4 .IX Item "1 or tff" output top field first .PP Default value is \*(L"tff\*(R". .PP Transformation is achieved by shifting the picture content up or down by one line, and filling the remaining line with appropriate picture content. This method is consistent with most broadcast field order converters. .PP If the input video is not flagged as being interlaced, or it is already flagged as being of the required output field order then this filter does not alter the incoming video. .PP This filter is very useful when converting to or from \s-1PAL\s0 \s-1DV\s0 material, which is bottom field first. .PP For example: .PP .Vb 1 \& ./avconv \-i in.vob \-vf "fieldorder=bff" out.dv .Ve .SS "fifo" .IX Subsection "fifo" Buffer input images and send them when they are requested. .PP This filter is mainly useful when auto-inserted by the libavfilter framework. .PP The filter does not take parameters. .SS "format" .IX Subsection "format" Convert the input video to one of the specified pixel formats. Libavfilter will try to pick one that is supported for the input to the next filter. .PP The filter accepts a list of pixel format names, separated by \*(L":\*(R", for example \*(L"yuv420p:monow:rgb24\*(R". .PP Some examples follow: .PP .Vb 2 \& # convert the input video to the format "yuv420p" \& format=yuv420p \& \& # convert the input video to any of the formats in the list \& format=yuv420p:yuv444p:yuv410p .Ve .SS "frei0r" .IX Subsection "frei0r" Apply a frei0r effect to the input video. .PP To enable compilation of this filter you need to install the frei0r header and configure Libav with \-\-enable\-frei0r. .PP The filter supports the syntax: .PP .Vb 1 \& [{:|=}::...:] .Ve .PP \&\fIfilter_name\fR is the name to the frei0r effect to load. If the environment variable \fB\s-1FREI0R_PATH\s0\fR is defined, the frei0r effect is searched in each one of the directories specified by the colon separated list in \fB\s-1FREIOR_PATH\s0\fR, otherwise in the standard frei0r paths, which are in this order: \fI\s-1HOME/\s0.frei0r\-1/lib/\fR, \&\fI/usr/local/lib/frei0r\-1/\fR, \fI/usr/lib/frei0r\-1/\fR. .PP \&\fIparam1\fR, \fIparam2\fR, ... , \fIparamN\fR specify the parameters for the frei0r effect. .PP A frei0r effect parameter can be a boolean (whose values are specified with \*(L"y\*(R" and \*(L"n\*(R"), a double, a color (specified by the syntax \&\fIR\fR/\fIG\fR/\fIB\fR, \fIR\fR, \fIG\fR, and \fIB\fR being float numbers from 0.0 to 1.0) or by an \f(CW\*(C`av_parse_color()\*(C'\fR color description), a position (specified by the syntax \fIX\fR/\fIY\fR, \&\fIX\fR and \fIY\fR being float numbers) and a string. .PP The number and kind of parameters depend on the loaded effect. If an effect parameter is not specified the default value is set. .PP Some examples follow: .PP .Vb 2 \& # apply the distort0r effect, set the first two double parameters \& frei0r=distort0r:0.5:0.01 \& \& # apply the colordistance effect, takes a color as first parameter \& frei0r=colordistance:0.2/0.3/0.4 \& frei0r=colordistance:violet \& frei0r=colordistance:0x112233 \& \& # apply the perspective effect, specify the top left and top right \& # image positions \& frei0r=perspective:0.2/0.2:0.8/0.2 .Ve .PP For more information see: <\fBhttp://piksel.org/frei0r\fR> .SS "gradfun" .IX Subsection "gradfun" Fix the banding artifacts that are sometimes introduced into nearly flat regions by truncation to 8bit colordepth. Interpolate the gradients that should go where the bands are, and dither them. .PP This filter is designed for playback only. Do not use it prior to lossy compression, because compression tends to lose the dither and bring back the bands. .PP The filter takes two optional parameters, separated by ':': \&\fIstrength\fR:\fIradius\fR .PP \&\fIstrength\fR is the maximum amount by which the filter will change any one pixel. Also the threshold for detecting nearly flat regions. Acceptable values range from .51 to 255, default value is 1.2, out-of-range values will be clipped to the valid range. .PP \&\fIradius\fR is the neighborhood to fit the gradient to. A larger radius makes for smoother gradients, but also prevents the filter from modifying the pixels near detailed regions. Acceptable values are 8\-32, default value is 16, out-of-range values will be clipped to the valid range. .PP .Vb 2 \& # default parameters \& gradfun=1.2:16 \& \& # omitting radius \& gradfun=1.2 .Ve .SS "hflip" .IX Subsection "hflip" Flip the input video horizontally. .PP For example to horizontally flip the input video with \fBavconv\fR: .PP .Vb 1 \& avconv \-i in.avi \-vf "hflip" out.avi .Ve .SS "hqdn3d" .IX Subsection "hqdn3d" High precision/quality 3d denoise filter. This filter aims to reduce image noise producing smooth images and making still images really still. It should enhance compressibility. .PP It accepts the following optional parameters: \&\fIluma_spatial\fR:\fIchroma_spatial\fR:\fIluma_tmp\fR:\fIchroma_tmp\fR .IP "\fBluma_spatial\fR" 4 .IX Item "luma_spatial" a non-negative float number which specifies spatial luma strength, defaults to 4.0 .IP "\fBchroma_spatial\fR" 4 .IX Item "chroma_spatial" a non-negative float number which specifies spatial chroma strength, defaults to 3.0*\fIluma_spatial\fR/4.0 .IP "\fBluma_tmp\fR" 4 .IX Item "luma_tmp" a float number which specifies luma temporal strength, defaults to 6.0*\fIluma_spatial\fR/4.0 .IP "\fBchroma_tmp\fR" 4 .IX Item "chroma_tmp" a float number which specifies chroma temporal strength, defaults to \&\fIluma_tmp\fR*\fIchroma_spatial\fR/\fIluma_spatial\fR .SS "lut, lutrgb, lutyuv" .IX Subsection "lut, lutrgb, lutyuv" Compute a look-up table for binding each pixel component input value to an output value, and apply it to input video. .PP \&\fIlutyuv\fR applies a lookup table to a \s-1YUV\s0 input video, \fIlutrgb\fR to an \s-1RGB\s0 input video. .PP These filters accept in input a \*(L":\*(R"\-separated list of options, which specify the expressions used for computing the lookup table for the corresponding pixel component values. .PP The \fIlut\fR filter requires either \s-1YUV\s0 or \s-1RGB\s0 pixel formats in input, and accepts the options: .Sp .RS 4 \&\fIc0\fR (first pixel component) \&\fIc1\fR (second pixel component) \&\fIc2\fR (third pixel component) \&\fIc3\fR (fourth pixel component, corresponds to the alpha component) .RE .PP The exact component associated to each option depends on the format in input. .PP The \fIlutrgb\fR filter requires \s-1RGB\s0 pixel formats in input, and accepts the options: .Sp .RS 4 \&\fIr\fR (red component) \&\fIg\fR (green component) \&\fIb\fR (blue component) \&\fIa\fR (alpha component) .RE .PP The \fIlutyuv\fR filter requires \s-1YUV\s0 pixel formats in input, and accepts the options: .Sp .RS 4 \&\fIy\fR (Y/luminance component) \&\fIu\fR (U/Cb component) \&\fIv\fR (V/Cr component) \&\fIa\fR (alpha component) .RE .PP The expressions can contain the following constants and functions: .IP "\fBE, \s-1PI\s0, \s-1PHI\s0\fR" 4 .IX Item "E, PI, PHI" the corresponding mathematical approximated values for e (euler number), pi (greek \s-1PI\s0), \s-1PHI\s0 (golden ratio) .IP "\fBw, h\fR" 4 .IX Item "w, h" the input width and height .IP "\fBval\fR" 4 .IX Item "val" input value for the pixel component .IP "\fBclipval\fR" 4 .IX Item "clipval" the input value clipped in the \fIminval\fR\-\fImaxval\fR range .IP "\fBmaxval\fR" 4 .IX Item "maxval" maximum value for the pixel component .IP "\fBminval\fR" 4 .IX Item "minval" minimum value for the pixel component .IP "\fBnegval\fR" 4 .IX Item "negval" the negated value for the pixel component value clipped in the \&\fIminval\fR\-\fImaxval\fR range , it corresponds to the expression \&\*(L"maxval\-clipval+minval\*(R" .IP "\fBclip(val)\fR" 4 .IX Item "clip(val)" the computed value in \fIval\fR clipped in the \&\fIminval\fR\-\fImaxval\fR range .IP "\fBgammaval(gamma)\fR" 4 .IX Item "gammaval(gamma)" the computed gamma correction value of the pixel component value clipped in the \fIminval\fR\-\fImaxval\fR range, corresponds to the expression "pow((clipval\-minval)/(maxval\-minval),\fIgamma\fR)*(maxval\-minval)+minval" .PP All expressions default to \*(L"val\*(R". .PP Some examples follow: .PP .Vb 3 \& # negate input video \& lutrgb="r=maxval+minval\-val:g=maxval+minval\-val:b=maxval+minval\-val" \& lutyuv="y=maxval+minval\-val:u=maxval+minval\-val:v=maxval+minval\-val" \& \& # the above is the same as \& lutrgb="r=negval:g=negval:b=negval" \& lutyuv="y=negval:u=negval:v=negval" \& \& # negate luminance \& lutyuv=negval \& \& # remove chroma components, turns the video into a graytone image \& lutyuv="u=128:v=128" \& \& # apply a luma burning effect \& lutyuv="y=2*val" \& \& # remove green and blue components \& lutrgb="g=0:b=0" \& \& # set a constant alpha channel value on input \& format=rgba,lutrgb=a="maxval\-minval/2" \& \& # correct luminance gamma by a 0.5 factor \& lutyuv=y=gammaval(0.5) .Ve .SS "negate" .IX Subsection "negate" Negate input video. .PP This filter accepts an integer in input, if non-zero it negates the alpha component (if available). The default value in input is 0. .PP Force libavfilter not to use any of the specified pixel formats for the input to the next filter. .PP The filter accepts a list of pixel format names, separated by \*(L":\*(R", for example \*(L"yuv420p:monow:rgb24\*(R". .PP Some examples follow: .PP .Vb 3 \& # force libavfilter to use a format different from "yuv420p" for the \& # input to the vflip filter \& noformat=yuv420p,vflip \& \& # convert the input video to any of the formats not contained in the list \& noformat=yuv420p:yuv444p:yuv410p .Ve .SS "null" .IX Subsection "null" Pass the video source unchanged to the output. .SS "ocv" .IX Subsection "ocv" Apply video transform using libopencv. .PP To enable this filter install libopencv library and headers and configure Libav with \-\-enable\-libopencv. .PP The filter takes the parameters: \fIfilter_name\fR{:=}\fIfilter_params\fR. .PP \&\fIfilter_name\fR is the name of the libopencv filter to apply. .PP \&\fIfilter_params\fR specifies the parameters to pass to the libopencv filter. If not specified the default values are assumed. .PP Refer to the official libopencv documentation for more precise information: <\fBhttp://opencv.willowgarage.com/documentation/c/image_filtering.html\fR> .PP Follows the list of supported libopencv filters. .PP \fIdilate\fR .IX Subsection "dilate" .PP Dilate an image by using a specific structuring element. This filter corresponds to the libopencv function \f(CW\*(C`cvDilate\*(C'\fR. .PP It accepts the parameters: \fIstruct_el\fR:\fInb_iterations\fR. .PP \&\fIstruct_el\fR represents a structuring element, and has the syntax: \&\fIcols\fRx\fIrows\fR+\fIanchor_x\fRx\fIanchor_y\fR/\fIshape\fR .PP \&\fIcols\fR and \fIrows\fR represent the number of columns and rows of the structuring element, \fIanchor_x\fR and \fIanchor_y\fR the anchor point, and \fIshape\fR the shape for the structuring element, and can be one of the values \*(L"rect\*(R", \*(L"cross\*(R", \*(L"ellipse\*(R", \*(L"custom\*(R". .PP If the value for \fIshape\fR is \*(L"custom\*(R", it must be followed by a string of the form "=\fIfilename\fR". The file with name \&\fIfilename\fR is assumed to represent a binary image, with each printable character corresponding to a bright pixel. When a custom \&\fIshape\fR is used, \fIcols\fR and \fIrows\fR are ignored, the number or columns and rows of the read file are assumed instead. .PP The default value for \fIstruct_el\fR is \*(L"3x3+0x0/rect\*(R". .PP \&\fInb_iterations\fR specifies the number of times the transform is applied to the image, and defaults to 1. .PP Follow some example: .PP .Vb 2 \& # use the default values \& ocv=dilate \& \& # dilate using a structuring element with a 5x5 cross, iterate two times \& ocv=dilate=5x5+2x2/cross:2 \& \& # read the shape from the file diamond.shape, iterate two times \& # the file diamond.shape may contain a pattern of characters like this: \& # * \& # *** \& # ***** \& # *** \& # * \& # the specified cols and rows are ignored (but not the anchor point coordinates) \& ocv=0x0+2x2/custom=diamond.shape:2 .Ve .PP \fIerode\fR .IX Subsection "erode" .PP Erode an image by using a specific structuring element. This filter corresponds to the libopencv function \f(CW\*(C`cvErode\*(C'\fR. .PP The filter accepts the parameters: \fIstruct_el\fR:\fInb_iterations\fR, with the same syntax and semantics as the dilate filter. .PP \fIsmooth\fR .IX Subsection "smooth" .PP Smooth the input video. .PP The filter takes the following parameters: \&\fItype\fR:\fIparam1\fR:\fIparam2\fR:\fIparam3\fR:\fIparam4\fR. .PP \&\fItype\fR is the type of smooth filter to apply, and can be one of the following values: \*(L"blur\*(R", \*(L"blur_no_scale\*(R", \*(L"median\*(R", \*(L"gaussian\*(R", \&\*(L"bilateral\*(R". The default value is \*(L"gaussian\*(R". .PP \&\fIparam1\fR, \fIparam2\fR, \fIparam3\fR, and \fIparam4\fR are parameters whose meanings depend on smooth type. \fIparam1\fR and \&\fIparam2\fR accept integer positive values or 0, \fIparam3\fR and \&\fIparam4\fR accept float values. .PP The default value for \fIparam1\fR is 3, the default value for the other parameters is 0. .PP These parameters correspond to the parameters assigned to the libopencv function \f(CW\*(C`cvSmooth\*(C'\fR. .SS "overlay" .IX Subsection "overlay" Overlay one video on top of another. .PP It takes two inputs and one output, the first input is the \*(L"main\*(R" video on which the second input is overlayed. .PP It accepts the parameters: \fIx\fR:\fIy\fR. .PP \&\fIx\fR is the x coordinate of the overlayed video on the main video, \&\fIy\fR is the y coordinate. The parameters are expressions containing the following parameters: .IP "\fBmain_w, main_h\fR" 4 .IX Item "main_w, main_h" main input width and height .IP "\fBW, H\fR" 4 .IX Item "W, H" same as \fImain_w\fR and \fImain_h\fR .IP "\fBoverlay_w, overlay_h\fR" 4 .IX Item "overlay_w, overlay_h" overlay input width and height .IP "\fBw, h\fR" 4 .IX Item "w, h" same as \fIoverlay_w\fR and \fIoverlay_h\fR .PP Be aware that frames are taken from each input video in timestamp order, hence, if their initial timestamps differ, it is a a good idea to pass the two inputs through a \fIsetpts=PTS\-STARTPTS\fR filter to have them begin in the same zero timestamp, as it does the example for the \fImovie\fR filter. .PP Follow some examples: .PP .Vb 3 \& # draw the overlay at 10 pixels from the bottom right \& # corner of the main video. \& overlay=main_w\-overlay_w\-10:main_h\-overlay_h\-10 \& \& # insert a transparent PNG logo in the bottom left corner of the input \& movie=logo.png [logo]; \& [in][logo] overlay=10:main_h\-overlay_h\-10 [out] \& \& # insert 2 different transparent PNG logos (second logo on bottom \& # right corner): \& movie=logo1.png [logo1]; \& movie=logo2.png [logo2]; \& [in][logo1] overlay=10:H\-h\-10 [in+logo1]; \& [in+logo1][logo2] overlay=W\-w\-10:H\-h\-10 [out] \& \& # add a transparent color layer on top of the main video, \& # WxH specifies the size of the main input to the overlay filter \& color=red.3:WxH [over]; [in][over] overlay [out] .Ve .PP You can chain together more overlays but the efficiency of such approach is yet to be tested. .SS "pad" .IX Subsection "pad" Add paddings to the input image, and places the original input at the given coordinates \fIx\fR, \fIy\fR. .PP It accepts the following parameters: \&\fIwidth\fR:\fIheight\fR:\fIx\fR:\fIy\fR:\fIcolor\fR. .PP The parameters \fIwidth\fR, \fIheight\fR, \fIx\fR, and \fIy\fR are expressions containing the following constants: .IP "\fBE, \s-1PI\s0, \s-1PHI\s0\fR" 4 .IX Item "E, PI, PHI" the corresponding mathematical approximated values for e (euler number), pi (greek \s-1PI\s0), phi (golden ratio) .IP "\fBin_w, in_h\fR" 4 .IX Item "in_w, in_h" the input video width and height .IP "\fBiw, ih\fR" 4 .IX Item "iw, ih" same as \fIin_w\fR and \fIin_h\fR .IP "\fBout_w, out_h\fR" 4 .IX Item "out_w, out_h" the output width and height, that is the size of the padded area as specified by the \fIwidth\fR and \fIheight\fR expressions .IP "\fBow, oh\fR" 4 .IX Item "ow, oh" same as \fIout_w\fR and \fIout_h\fR .IP "\fBx, y\fR" 4 .IX Item "x, y" x and y offsets as specified by the \fIx\fR and \fIy\fR expressions, or \s-1NAN\s0 if not yet specified .IP "\fBa\fR" 4 .IX Item "a" input display aspect ratio, same as \fIiw\fR / \fIih\fR .IP "\fBhsub, vsub\fR" 4 .IX Item "hsub, vsub" horizontal and vertical chroma subsample values. For example for the pixel format \*(L"yuv422p\*(R" \fIhsub\fR is 2 and \fIvsub\fR is 1. .PP Follows the description of the accepted parameters. .IP "\fBwidth, height\fR" 4 .IX Item "width, height" Specify the size of the output image with the paddings added. If the value for \fIwidth\fR or \fIheight\fR is 0, the corresponding input size is used for the output. .Sp The \fIwidth\fR expression can reference the value set by the \&\fIheight\fR expression, and vice versa. .Sp The default value of \fIwidth\fR and \fIheight\fR is 0. .IP "\fBx, y\fR" 4 .IX Item "x, y" Specify the offsets where to place the input image in the padded area with respect to the top/left border of the output image. .Sp The \fIx\fR expression can reference the value set by the \fIy\fR expression, and vice versa. .Sp The default value of \fIx\fR and \fIy\fR is 0. .IP "\fBcolor\fR" 4 .IX Item "color" Specify the color of the padded area, it can be the name of a color (case insensitive match) or a 0xRRGGBB[\s-1AA\s0] sequence. .Sp The default value of \fIcolor\fR is \*(L"black\*(R". .PP Some examples follow: .PP .Vb 4 \& # Add paddings with color "violet" to the input video. Output video \& # size is 640x480, the top\-left corner of the input video is placed at \& # column 0, row 40. \& pad=640:480:0:40:violet \& \& # pad the input to get an output with dimensions increased bt 3/2, \& # and put the input video at the center of the padded area \& pad="3/2*iw:3/2*ih:(ow\-iw)/2:(oh\-ih)/2" \& \& # pad the input to get a squared output with size equal to the maximum \& # value between the input width and height, and put the input video at \& # the center of the padded area \& pad="max(iw,ih):ow:(ow\-iw)/2:(oh\-ih)/2" \& \& # pad the input to get a final w/h ratio of 16:9 \& pad="ih*16/9:ih:(ow\-iw)/2:(oh\-ih)/2" \& \& # double output size and put the input video in the bottom\-right \& # corner of the output padded area \& pad="2*iw:2*ih:ow\-iw:oh\-ih" .Ve .SS "pixdesctest" .IX Subsection "pixdesctest" Pixel format descriptor test filter, mainly useful for internal testing. The output video should be equal to the input video. .PP For example: .PP .Vb 1 \& format=monow, pixdesctest .Ve .PP can be used to test the monowhite pixel format descriptor definition. .SS "scale" .IX Subsection "scale" Scale the input video to \fIwidth\fR:\fIheight\fR and/or convert the image format. .PP The parameters \fIwidth\fR and \fIheight\fR are expressions containing the following constants: .IP "\fBE, \s-1PI\s0, \s-1PHI\s0\fR" 4 .IX Item "E, PI, PHI" the corresponding mathematical approximated values for e (euler number), pi (greek \s-1PI\s0), phi (golden ratio) .IP "\fBin_w, in_h\fR" 4 .IX Item "in_w, in_h" the input width and height .IP "\fBiw, ih\fR" 4 .IX Item "iw, ih" same as \fIin_w\fR and \fIin_h\fR .IP "\fBout_w, out_h\fR" 4 .IX Item "out_w, out_h" the output (cropped) width and height .IP "\fBow, oh\fR" 4 .IX Item "ow, oh" same as \fIout_w\fR and \fIout_h\fR .IP "\fBdar, a\fR" 4 .IX Item "dar, a" input display aspect ratio, same as \fIiw\fR / \fIih\fR .IP "\fBsar\fR" 4 .IX Item "sar" input sample aspect ratio .IP "\fBhsub, vsub\fR" 4 .IX Item "hsub, vsub" horizontal and vertical chroma subsample values. For example for the pixel format \*(L"yuv422p\*(R" \fIhsub\fR is 2 and \fIvsub\fR is 1. .PP If the input image format is different from the format requested by the next filter, the scale filter will convert the input to the requested format. .PP If the value for \fIwidth\fR or \fIheight\fR is 0, the respective input size is used for the output. .PP If the value for \fIwidth\fR or \fIheight\fR is \-1, the scale filter will use, for the respective output size, a value that maintains the aspect ratio of the input image. .PP The default value of \fIwidth\fR and \fIheight\fR is 0. .PP Some examples follow: .PP .Vb 2 \& # scale the input video to a size of 200x100. \& scale=200:100 \& \& # scale the input to 2x \& scale=2*iw:2*ih \& # the above is the same as \& scale=2*in_w:2*in_h \& \& # scale the input to half size \& scale=iw/2:ih/2 \& \& # increase the width, and set the height to the same size \& scale=3/2*iw:ow \& \& # seek for Greek harmony \& scale=iw:1/PHI*iw \& scale=ih*PHI:ih \& \& # increase the height, and set the width to 3/2 of the height \& scale=3/2*oh:3/5*ih \& \& # increase the size, but make the size a multiple of the chroma \& scale="trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub" \& \& # increase the width to a maximum of 500 pixels, keep the same input aspect ratio \& scale=\*(Aqmin(500, iw*3/2):\-1\*(Aq .Ve .SS "select" .IX Subsection "select" Select frames to pass in output. .PP It accepts in input an expression, which is evaluated for each input frame. If the expression is evaluated to a non-zero value, the frame is selected and passed to the output, otherwise it is discarded. .PP The expression can contain the following constants: .IP "\fB\s-1PI\s0\fR" 4 .IX Item "PI" Greek \s-1PI\s0 .IP "\fB\s-1PHI\s0\fR" 4 .IX Item "PHI" golden ratio .IP "\fBE\fR" 4 .IX Item "E" Euler number .IP "\fBn\fR" 4 .IX Item "n" the sequential number of the filtered frame, starting from 0 .IP "\fBselected_n\fR" 4 .IX Item "selected_n" the sequential number of the selected frame, starting from 0 .IP "\fBprev_selected_n\fR" 4 .IX Item "prev_selected_n" the sequential number of the last selected frame, \s-1NAN\s0 if undefined .IP "\fB\s-1TB\s0\fR" 4 .IX Item "TB" timebase of the input timestamps .IP "\fBpts\fR" 4 .IX Item "pts" the \s-1PTS\s0 (Presentation TimeStamp) of the filtered video frame, expressed in \fI\s-1TB\s0\fR units, \s-1NAN\s0 if undefined .IP "\fBt\fR" 4 .IX Item "t" the \s-1PTS\s0 (Presentation TimeStamp) of the filtered video frame, expressed in seconds, \s-1NAN\s0 if undefined .IP "\fBprev_pts\fR" 4 .IX Item "prev_pts" the \s-1PTS\s0 of the previously filtered video frame, \s-1NAN\s0 if undefined .IP "\fBprev_selected_pts\fR" 4 .IX Item "prev_selected_pts" the \s-1PTS\s0 of the last previously filtered video frame, \s-1NAN\s0 if undefined .IP "\fBprev_selected_t\fR" 4 .IX Item "prev_selected_t" the \s-1PTS\s0 of the last previously selected video frame, \s-1NAN\s0 if undefined .IP "\fBstart_pts\fR" 4 .IX Item "start_pts" the \s-1PTS\s0 of the first video frame in the video, \s-1NAN\s0 if undefined .IP "\fBstart_t\fR" 4 .IX Item "start_t" the time of the first video frame in the video, \s-1NAN\s0 if undefined .IP "\fBpict_type\fR" 4 .IX Item "pict_type" the type of the filtered frame, can assume one of the following values: .RS 4 .IP "\fBI\fR" 4 .IX Item "I" .PD 0 .IP "\fBP\fR" 4 .IX Item "P" .IP "\fBB\fR" 4 .IX Item "B" .IP "\fBS\fR" 4 .IX Item "S" .IP "\fB\s-1SI\s0\fR" 4 .IX Item "SI" .IP "\fB\s-1SP\s0\fR" 4 .IX Item "SP" .IP "\fB\s-1BI\s0\fR" 4 .IX Item "BI" .RE .RS 4 .RE .IP "\fBinterlace_type\fR" 4 .IX Item "interlace_type" .PD the frame interlace type, can assume one of the following values: .RS 4 .IP "\fB\s-1PROGRESSIVE\s0\fR" 4 .IX Item "PROGRESSIVE" the frame is progressive (not interlaced) .IP "\fB\s-1TOPFIRST\s0\fR" 4 .IX Item "TOPFIRST" the frame is top-field-first .IP "\fB\s-1BOTTOMFIRST\s0\fR" 4 .IX Item "BOTTOMFIRST" the frame is bottom-field-first .RE .RS 4 .RE .IP "\fBkey\fR" 4 .IX Item "key" 1 if the filtered frame is a key-frame, 0 otherwise .IP "\fBpos\fR" 4 .IX Item "pos" the position in the file of the filtered frame, \-1 if the information is not available (e.g. for synthetic video) .PP The default value of the select expression is \*(L"1\*(R". .PP Some examples follow: .PP .Vb 2 \& # select all frames in input \& select \& \& # the above is the same as: \& select=1 \& \& # skip all frames: \& select=0 \& \& # select only I\-frames \& select=\*(Aqeq(pict_type,I)\*(Aq \& \& # select one frame every 100 \& select=\*(Aqnot(mod(n,100))\*(Aq \& \& # select only frames contained in the 10\-20 time interval \& select=\*(Aqgte(t,10)*lte(t,20)\*(Aq \& \& # select only I frames contained in the 10\-20 time interval \& select=\*(Aqgte(t,10)*lte(t,20)*eq(pict_type,I)\*(Aq \& \& # select frames with a minimum distance of 10 seconds \& select=\*(Aqisnan(prev_selected_t)+gte(t\-prev_selected_t,10)\*(Aq .Ve .SS "setdar" .IX Subsection "setdar" Set the Display Aspect Ratio for the filter output video. .PP This is done by changing the specified Sample (aka Pixel) Aspect Ratio, according to the following equation: \&\s-1DAR\s0 = \s-1HORIZONTAL_RESOLUTION\s0 / \s-1VERTICAL_RESOLUTION\s0 * \s-1SAR\s0 .PP Keep in mind that this filter does not modify the pixel dimensions of the video frame. Also the display aspect ratio set by this filter may be changed by later filters in the filterchain, e.g. in case of scaling or if another \*(L"setdar\*(R" or a \*(L"setsar\*(R" filter is applied. .PP The filter accepts a parameter string which represents the wanted display aspect ratio. The parameter can be a floating point number string, or an expression of the form \fInum\fR:\fIden\fR, where \fInum\fR and \fIden\fR are the numerator and denominator of the aspect ratio. If the parameter is not specified, it is assumed the value \*(L"0:1\*(R". .PP For example to change the display aspect ratio to 16:9, specify: .PP .Vb 3 \& setdar=16:9 \& # the above is equivalent to \& setdar=1.77777 .Ve .PP See also the setsar filter documentation. .SS "setpts" .IX Subsection "setpts" Change the \s-1PTS\s0 (presentation timestamp) of the input video frames. .PP Accept in input an expression evaluated through the eval \s-1API\s0, which can contain the following constants: .IP "\fB\s-1PTS\s0\fR" 4 .IX Item "PTS" the presentation timestamp in input .IP "\fB\s-1PI\s0\fR" 4 .IX Item "PI" Greek \s-1PI\s0 .IP "\fB\s-1PHI\s0\fR" 4 .IX Item "PHI" golden ratio .IP "\fBE\fR" 4 .IX Item "E" Euler number .IP "\fBN\fR" 4 .IX Item "N" the count of the input frame, starting from 0. .IP "\fB\s-1STARTPTS\s0\fR" 4 .IX Item "STARTPTS" the \s-1PTS\s0 of the first video frame .IP "\fB\s-1INTERLACED\s0\fR" 4 .IX Item "INTERLACED" tell if the current frame is interlaced .IP "\fB\s-1POS\s0\fR" 4 .IX Item "POS" original position in the file of the frame, or undefined if undefined for the current frame .IP "\fB\s-1PREV_INPTS\s0\fR" 4 .IX Item "PREV_INPTS" previous input \s-1PTS\s0 .IP "\fB\s-1PREV_OUTPTS\s0\fR" 4 .IX Item "PREV_OUTPTS" previous output \s-1PTS\s0 .PP Some examples follow: .PP .Vb 2 \& # start counting PTS from zero \& setpts=PTS\-STARTPTS \& \& # fast motion \& setpts=0.5*PTS \& \& # slow motion \& setpts=2.0*PTS \& \& # fixed rate 25 fps \& setpts=N/(25*TB) \& \& # fixed rate 25 fps with some jitter \& setpts=\*(Aq1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))\*(Aq .Ve .SS "setsar" .IX Subsection "setsar" Set the Sample (aka Pixel) Aspect Ratio for the filter output video. .PP Note that as a consequence of the application of this filter, the output display aspect ratio will change according to the following equation: \&\s-1DAR\s0 = \s-1HORIZONTAL_RESOLUTION\s0 / \s-1VERTICAL_RESOLUTION\s0 * \s-1SAR\s0 .PP Keep in mind that the sample aspect ratio set by this filter may be changed by later filters in the filterchain, e.g. if another \*(L"setsar\*(R" or a \*(L"setdar\*(R" filter is applied. .PP The filter accepts a parameter string which represents the wanted sample aspect ratio. The parameter can be a floating point number string, or an expression of the form \fInum\fR:\fIden\fR, where \fInum\fR and \fIden\fR are the numerator and denominator of the aspect ratio. If the parameter is not specified, it is assumed the value \*(L"0:1\*(R". .PP For example to change the sample aspect ratio to 10:11, specify: .PP .Vb 1 \& setsar=10:11 .Ve .SS "settb" .IX Subsection "settb" Set the timebase to use for the output frames timestamps. It is mainly useful for testing timebase configuration. .PP It accepts in input an arithmetic expression representing a rational. The expression can contain the constants \*(L"\s-1PI\s0\*(R", \*(L"E\*(R", \*(L"\s-1PHI\s0\*(R", \*(L"\s-1AVTB\s0\*(R" (the default timebase), and \*(L"intb\*(R" (the input timebase). .PP The default value for the input is \*(L"intb\*(R". .PP Follow some examples. .PP .Vb 2 \& # set the timebase to 1/25 \& settb=1/25 \& \& # set the timebase to 1/10 \& settb=0.1 \& \& #set the timebase to 1001/1000 \& settb=1+0.001 \& \& #set the timebase to 2*intb \& settb=2*intb \& \& #set the default timebase value \& settb=AVTB .Ve .SS "showinfo" .IX Subsection "showinfo" Show a line containing various information for each input video frame. The input video is not modified. .PP The shown line contains a sequence of key/value pairs of the form \&\fIkey\fR:\fIvalue\fR. .PP A description of each shown parameter follows: .IP "\fBn\fR" 4 .IX Item "n" sequential number of the input frame, starting from 0 .IP "\fBpts\fR" 4 .IX Item "pts" Presentation TimeStamp of the input frame, expressed as a number of time base units. The time base unit depends on the filter input pad. .IP "\fBpts_time\fR" 4 .IX Item "pts_time" Presentation TimeStamp of the input frame, expressed as a number of seconds .IP "\fBpos\fR" 4 .IX Item "pos" position of the frame in the input stream, \-1 if this information in unavailable and/or meaningless (for example in case of synthetic video) .IP "\fBfmt\fR" 4 .IX Item "fmt" pixel format name .IP "\fBsar\fR" 4 .IX Item "sar" sample aspect ratio of the input frame, expressed in the form \&\fInum\fR/\fIden\fR .IP "\fBs\fR" 4 .IX Item "s" size of the input frame, expressed in the form \&\fIwidth\fRx\fIheight\fR .IP "\fBi\fR" 4 .IX Item "i" interlaced mode (\*(L"P\*(R" for \*(L"progressive\*(R", \*(L"T\*(R" for top field first, \*(L"B\*(R" for bottom field first) .IP "\fBiskey\fR" 4 .IX Item "iskey" 1 if the frame is a key frame, 0 otherwise .IP "\fBtype\fR" 4 .IX Item "type" picture type of the input frame (\*(L"I\*(R" for an I\-frame, \*(L"P\*(R" for a P\-frame, \*(L"B\*(R" for a B\-frame, \*(L"?\*(R" for unknown type). Check also the documentation of the \f(CW\*(C`AVPictureType\*(C'\fR enum and of the \f(CW\*(C`av_get_picture_type_char\*(C'\fR function defined in \&\fIlibavutil/avutil.h\fR. .IP "\fBchecksum\fR" 4 .IX Item "checksum" Adler\-32 checksum of all the planes of the input frame .IP "\fBplane_checksum\fR" 4 .IX Item "plane_checksum" Adler\-32 checksum of each plane of the input frame, expressed in the form "[\fIc0\fR \fIc1\fR \fIc2\fR \fIc3\fR]" .SS "slicify" .IX Subsection "slicify" Pass the images of input video on to next video filter as multiple slices. .PP .Vb 1 \& ./avconv \-i in.avi \-vf "slicify=32" out.avi .Ve .PP The filter accepts the slice height as parameter. If the parameter is not specified it will use the default value of 16. .PP Adding this in the beginning of filter chains should make filtering faster due to better use of the memory cache. .SS "transpose" .IX Subsection "transpose" Transpose rows with columns in the input video and optionally flip it. .PP It accepts a parameter representing an integer, which can assume the values: .IP "\fB0\fR" 4 .IX Item "0" Rotate by 90 degrees counterclockwise and vertically flip (default), that is: .Sp .Vb 3 \& L.R L.l \& . . \-> . . \& l.r R.r .Ve .IP "\fB1\fR" 4 .IX Item "1" Rotate by 90 degrees clockwise, that is: .Sp .Vb 3 \& L.R l.L \& . . \-> . . \& l.r r.R .Ve .IP "\fB2\fR" 4 .IX Item "2" Rotate by 90 degrees counterclockwise, that is: .Sp .Vb 3 \& L.R R.r \& . . \-> . . \& l.r L.l .Ve .IP "\fB3\fR" 4 .IX Item "3" Rotate by 90 degrees clockwise and vertically flip, that is: .Sp .Vb 3 \& L.R r.R \& . . \-> . . \& l.r l.L .Ve .SS "unsharp" .IX Subsection "unsharp" Sharpen or blur the input video. .PP It accepts the following parameters: \&\fIluma_msize_x\fR:\fIluma_msize_y\fR:\fIluma_amount\fR:\fIchroma_msize_x\fR:\fIchroma_msize_y\fR:\fIchroma_amount\fR .PP Negative values for the amount will blur the input video, while positive values will sharpen. All parameters are optional and default to the equivalent of the string '5:5:1.0:5:5:0.0'. .IP "\fBluma_msize_x\fR" 4 .IX Item "luma_msize_x" Set the luma matrix horizontal size. It can be an integer between 3 and 13, default value is 5. .IP "\fBluma_msize_y\fR" 4 .IX Item "luma_msize_y" Set the luma matrix vertical size. It can be an integer between 3 and 13, default value is 5. .IP "\fBluma_amount\fR" 4 .IX Item "luma_amount" Set the luma effect strength. It can be a float number between \-2.0 and 5.0, default value is 1.0. .IP "\fBchroma_msize_x\fR" 4 .IX Item "chroma_msize_x" Set the chroma matrix horizontal size. It can be an integer between 3 and 13, default value is 5. .IP "\fBchroma_msize_y\fR" 4 .IX Item "chroma_msize_y" Set the chroma matrix vertical size. It can be an integer between 3 and 13, default value is 5. .IP "\fBluma_amount\fR" 4 .IX Item "luma_amount" Set the chroma effect strength. It can be a float number between \-2.0 and 5.0, default value is 0.0. .PP .Vb 2 \& # Strong luma sharpen effect parameters \& unsharp=7:7:2.5 \& \& # Strong blur of both luma and chroma parameters \& unsharp=7:7:\-2:7:7:\-2 \& \& # Use the default values with B \& ./avconv \-i in.avi \-vf "unsharp" out.mp4 .Ve .SS "vflip" .IX Subsection "vflip" Flip the input video vertically. .PP .Vb 1 \& ./avconv \-i in.avi \-vf "vflip" out.avi .Ve .SS "yadif" .IX Subsection "yadif" Deinterlace the input video (\*(L"yadif\*(R" means \*(L"yet another deinterlacing filter\*(R"). .PP It accepts the optional parameters: \fImode\fR:\fIparity\fR:\fIauto\fR. .PP \&\fImode\fR specifies the interlacing mode to adopt, accepts one of the following values: .IP "\fB0\fR" 4 .IX Item "0" output 1 frame for each frame .IP "\fB1\fR" 4 .IX Item "1" output 1 frame for each field .IP "\fB2\fR" 4 .IX Item "2" like 0 but skips spatial interlacing check .IP "\fB3\fR" 4 .IX Item "3" like 1 but skips spatial interlacing check .PP Default value is 0. .PP \&\fIparity\fR specifies the picture field parity assumed for the input interlaced video, accepts one of the following values: .IP "\fB0\fR" 4 .IX Item "0" assume top field first .IP "\fB1\fR" 4 .IX Item "1" assume bottom field first .IP "\fB\-1\fR" 4 .IX Item "-1" enable automatic detection .PP Default value is \-1. If interlacing is unknown or decoder does not export this information, top field first will be assumed. .PP \&\fIauto\fR specifies if deinterlacer should trust the interlaced flag and only deinterlace frames marked as interlaced .IP "\fB0\fR" 4 .IX Item "0" deinterlace all frames .IP "\fB1\fR" 4 .IX Item "1" only deinterlace frames marked as interlaced .PP Default value is 0. .SH "VIDEO SOURCES" .IX Header "VIDEO SOURCES" Below is a description of the currently available video sources. .SS "buffer" .IX Subsection "buffer" Buffer video frames, and make them available to the filter chain. .PP This source is mainly intended for a programmatic use, in particular through the interface defined in \fIlibavfilter/vsrc_buffer.h\fR. .PP It accepts the following parameters: \&\fIwidth\fR:\fIheight\fR:\fIpix_fmt_string\fR:\fItimebase_num\fR:\fItimebase_den\fR:\fIsample_aspect_ratio_num\fR:\fIsample_aspect_ratio.den\fR .PP All the parameters need to be explicitly defined. .PP Follows the list of the accepted parameters. .IP "\fBwidth, height\fR" 4 .IX Item "width, height" Specify the width and height of the buffered video frames. .IP "\fBpix_fmt_string\fR" 4 .IX Item "pix_fmt_string" A string representing the pixel format of the buffered video frames. It may be a number corresponding to a pixel format, or a pixel format name. .IP "\fBtimebase_num, timebase_den\fR" 4 .IX Item "timebase_num, timebase_den" Specify numerator and denomitor of the timebase assumed by the timestamps of the buffered frames. .IP "\fBsample_aspect_ratio.num, sample_aspect_ratio.den\fR" 4 .IX Item "sample_aspect_ratio.num, sample_aspect_ratio.den" Specify numerator and denominator of the sample aspect ratio assumed by the video frames. .PP For example: .PP .Vb 1 \& buffer=320:240:yuv410p:1:24:1:1 .Ve .PP will instruct the source to accept video frames with size 320x240 and with format \*(L"yuv410p\*(R", assuming 1/24 as the timestamps timebase and square pixels (1:1 sample aspect ratio). Since the pixel format with name \*(L"yuv410p\*(R" corresponds to the number 6 (check the enum PixelFormat definition in \fIlibavutil/pixfmt.h\fR), this example corresponds to: .PP .Vb 1 \& buffer=320:240:6:1:24 .Ve .SS "color" .IX Subsection "color" Provide an uniformly colored input. .PP It accepts the following parameters: \&\fIcolor\fR:\fIframe_size\fR:\fIframe_rate\fR .PP Follows the description of the accepted parameters. .IP "\fBcolor\fR" 4 .IX Item "color" Specify the color of the source. It can be the name of a color (case insensitive match) or a 0xRRGGBB[\s-1AA\s0] sequence, possibly followed by an alpha specifier. The default value is \*(L"black\*(R". .IP "\fBframe_size\fR" 4 .IX Item "frame_size" Specify the size of the sourced video, it may be a string of the form \&\fIwidth\fRx\fIheight\fR, or the name of a size abbreviation. The default value is \*(L"320x240\*(R". .IP "\fBframe_rate\fR" 4 .IX Item "frame_rate" Specify the frame rate of the sourced video, as the number of frames generated per second. It has to be a string in the format \&\fIframe_rate_num\fR/\fIframe_rate_den\fR, an integer number, a float number or a valid video frame rate abbreviation. The default value is \&\*(L"25\*(R". .PP For example the following graph description will generate a red source with an opacity of 0.2, with size \*(L"qcif\*(R" and a frame rate of 10 frames per second, which will be overlayed over the source connected to the pad with identifier \*(L"in\*(R". .PP .Vb 1 \& "color=red@0.2:qcif:10 [color]; [in][color] overlay [out]" .Ve .SS "movie" .IX Subsection "movie" Read a video stream from a movie container. .PP It accepts the syntax: \fImovie_name\fR[:\fIoptions\fR] where \&\fImovie_name\fR is the name of the resource to read (not necessarily a file but also a device or a stream accessed through some protocol), and \fIoptions\fR is an optional sequence of \fIkey\fR=\fIvalue\fR pairs, separated by \*(L":\*(R". .PP The description of the accepted options follows. .IP "\fBformat_name, f\fR" 4 .IX Item "format_name, f" Specifies the format assumed for the movie to read, and can be either the name of a container or an input device. If not specified the format is guessed from \fImovie_name\fR or by probing. .IP "\fBseek_point, sp\fR" 4 .IX Item "seek_point, sp" Specifies the seek point in seconds, the frames will be output starting from this seek point, the parameter is evaluated with \&\f(CW\*(C`av_strtod\*(C'\fR so the numerical value may be suffixed by an \s-1IS\s0 postfix. Default value is \*(L"0\*(R". .IP "\fBstream_index, si\fR" 4 .IX Item "stream_index, si" Specifies the index of the video stream to read. If the value is \-1, the best suited video stream will be automatically selected. Default value is \*(L"\-1\*(R". .PP This filter allows to overlay a second video on top of main input of a filtergraph as shown in this graph: .PP .Vb 4 \& input \-\-\-\-\-\-\-\-\-\-\-> deltapts0 \-\-> overlay \-\-> output \& ^ \& | \& movie \-\-> scale\-\-> deltapts1 \-\-\-\-\-\-\-+ .Ve .PP Some examples follow: .PP .Vb 4 \& # skip 3.2 seconds from the start of the avi file in.avi, and overlay it \& # on top of the input labelled as "in". \& movie=in.avi:seek_point=3.2, scale=180:\-1, setpts=PTS\-STARTPTS [movie]; \& [in] setpts=PTS\-STARTPTS, [movie] overlay=16:16 [out] \& \& # read from a video4linux2 device, and overlay it on top of the input \& # labelled as "in" \& movie=/dev/video0:f=video4linux2, scale=180:\-1, setpts=PTS\-STARTPTS [movie]; \& [in] setpts=PTS\-STARTPTS, [movie] overlay=16:16 [out] .Ve .SS "nullsrc" .IX Subsection "nullsrc" Null video source, never return images. It is mainly useful as a template and to be employed in analysis / debugging tools. .PP It accepts as optional parameter a string of the form \&\fIwidth\fR:\fIheight\fR:\fItimebase\fR. .PP \&\fIwidth\fR and \fIheight\fR specify the size of the configured source. The default values of \fIwidth\fR and \fIheight\fR are respectively 352 and 288 (corresponding to the \s-1CIF\s0 size format). .PP \&\fItimebase\fR specifies an arithmetic expression representing a timebase. The expression can contain the constants \*(L"\s-1PI\s0\*(R", \*(L"E\*(R", \*(L"\s-1PHI\s0\*(R", \&\*(L"\s-1AVTB\s0\*(R" (the default timebase), and defaults to the value \*(L"\s-1AVTB\s0\*(R". .SS "frei0r_src" .IX Subsection "frei0r_src" Provide a frei0r source. .PP To enable compilation of this filter you need to install the frei0r header and configure Libav with \-\-enable\-frei0r. .PP The source supports the syntax: .PP .Vb 1 \& ::[{=|:}::...:] .Ve .PP \&\fIsize\fR is the size of the video to generate, may be a string of the form \fIwidth\fRx\fIheight\fR or a frame size abbreviation. \&\fIrate\fR is the rate of the video to generate, may be a string of the form \fInum\fR/\fIden\fR or a frame rate abbreviation. \&\fIsrc_name\fR is the name to the frei0r source to load. For more information regarding frei0r and how to set the parameters read the section frei0r in the description of the video filters. .PP Some examples follow: .PP .Vb 3 \& # generate a frei0r partik0l source with size 200x200 and framerate 10 \& # which is overlayed on the overlay filter main input \& frei0r_src=200x200:10:partik0l=1234 [overlay]; [in][overlay] overlay .Ve .SS "rgbtestsrc, testsrc" .IX Subsection "rgbtestsrc, testsrc" The \f(CW\*(C`rgbtestsrc\*(C'\fR source generates an \s-1RGB\s0 test pattern useful for detecting \s-1RGB\s0 vs \s-1BGR\s0 issues. You should see a red, green and blue stripe from top to bottom. .PP The \f(CW\*(C`testsrc\*(C'\fR source generates a test video pattern, showing a color pattern, a scrolling gradient and a timestamp. This is mainly intended for testing purposes. .PP Both sources accept an optional sequence of \fIkey\fR=\fIvalue\fR pairs, separated by \*(L":\*(R". The description of the accepted options follows. .IP "\fBsize, s\fR" 4 .IX Item "size, s" Specify the size of the sourced video, it may be a string of the form \&\fIwidth\fRx\fIheight\fR, or the name of a size abbreviation. The default value is \*(L"320x240\*(R". .IP "\fBrate, r\fR" 4 .IX Item "rate, r" Specify the frame rate of the sourced video, as the number of frames generated per second. It has to be a string in the format \&\fIframe_rate_num\fR/\fIframe_rate_den\fR, an integer number, a float number or a valid video frame rate abbreviation. The default value is \&\*(L"25\*(R". .IP "\fBsar\fR" 4 .IX Item "sar" Set the sample aspect ratio of the sourced video. .IP "\fBduration\fR" 4 .IX Item "duration" Set the video duration of the sourced video. The accepted syntax is: .Sp .Vb 2 \& [\-]HH[:MM[:SS[.m...]]] \& [\-]S+[.m...] .Ve .Sp See also the function \f(CW\*(C`av_parse_time()\*(C'\fR. .Sp If not specified, or the expressed duration is negative, the video is supposed to be generated forever. .PP For example the following: .PP .Vb 1 \& testsrc=duration=5.3:size=qcif:rate=10 .Ve .PP will generate a video with a duration of 5.3 seconds, with size 176x144 and a framerate of 10 frames per second. .SH "VIDEO SINKS" .IX Header "VIDEO SINKS" Below is a description of the currently available video sinks. .SS "nullsink" .IX Subsection "nullsink" Null video sink, do absolutely nothing with the input video. It is mainly useful as a template and to be employed in analysis / debugging tools. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIavconv\fR\|(1), \fIavprobe\fR\|(1) and the Libav \s-1HTML\s0 documentation .SH "AUTHORS" .IX Header "AUTHORS" The Libav developers