yading@10: =head1 NAME yading@10: yading@10: ffprobe - ffprobe media prober yading@10: yading@10: =head1 SYNOPSIS yading@10: yading@10: yading@10: ffprobe [I] [F] yading@10: yading@10: yading@10: =head1 DESCRIPTION yading@10: yading@10: yading@10: ffprobe gathers information from multimedia streams and prints it in yading@10: human- and machine-readable fashion. yading@10: yading@10: For example it can be used to check the format of the container used yading@10: by a multimedia stream and the format and type of each media stream yading@10: contained in it. yading@10: yading@10: If a filename is specified in input, ffprobe will try to open and yading@10: probe the file content. If the file cannot be opened or recognized as yading@10: a multimedia file, a positive exit code is returned. yading@10: yading@10: ffprobe may be employed both as a standalone application or in yading@10: combination with a textual filter, which may perform more yading@10: sophisticated processing, e.g. statistical processing or plotting. yading@10: yading@10: Options are used to list some of the formats supported by ffprobe or yading@10: for specifying which information to display, and for setting how yading@10: ffprobe will show it. yading@10: yading@10: ffprobe output is designed to be easily parsable by a textual filter, yading@10: and consists of one or more sections of a form defined by the selected yading@10: writer, which is specified by the B option. yading@10: yading@10: Sections may contain other nested sections, and are identified by a yading@10: name (which may be shared by other sections), and an unique yading@10: name. See the output of B. yading@10: yading@10: Metadata tags stored in the container or in the streams are recognized yading@10: and printed in the corresponding "FORMAT" or "STREAM" section. yading@10: yading@10: yading@10: yading@10: =head1 OPTIONS yading@10: yading@10: yading@10: All the numerical options, if not specified otherwise, accept a string yading@10: representing a number as input, which may be followed by one of the SI yading@10: unit prefixes, for example: 'K', 'M', or 'G'. yading@10: yading@10: If 'i' is appended to the SI unit prefix, the complete prefix will be yading@10: interpreted as a unit prefix for binary multiplies, which are based on yading@10: powers of 1024 instead of powers of 1000. Appending 'B' to the SI unit yading@10: prefix multiplies the value by 8. This allows using, for example: yading@10: 'KB', 'MiB', 'G' and 'B' as number suffixes. yading@10: yading@10: Options which do not take arguments are boolean options, and set the yading@10: corresponding value to true. They can be set to false by prefixing yading@10: the option name with "no". For example using "-nofoo" yading@10: will set the boolean option with name "foo" to false. yading@10: yading@10: yading@10: yading@10: =head2 Stream specifiers yading@10: yading@10: Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers yading@10: are used to precisely specify which stream(s) a given option belongs to. yading@10: yading@10: A stream specifier is a string generally appended to the option name and yading@10: separated from it by a colon. E.g. C<-codec:a:1 ac3> contains the yading@10: C stream specifier, which matches the second audio stream. Therefore, it yading@10: would select the ac3 codec for the second audio stream. yading@10: yading@10: A stream specifier can match several streams, so that the option is applied to all yading@10: of them. E.g. the stream specifier in C<-b:a 128k> matches all audio yading@10: streams. yading@10: yading@10: An empty stream specifier matches all streams. For example, C<-codec copy> yading@10: or C<-codec: copy> would copy all the streams without reencoding. yading@10: yading@10: Possible forms of stream specifiers are: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item I yading@10: yading@10: Matches the stream with this index. E.g. C<-threads:1 4> would set the yading@10: thread count for the second stream to 4. yading@10: yading@10: =item IB<[:>IB<]> yading@10: yading@10: I is one of following: 'v' for video, 'a' for audio, 's' for subtitle, yading@10: 'd' for data, and 't' for attachments. If I is given, then it matches yading@10: stream number I of this type. Otherwise, it matches all yading@10: streams of this type. yading@10: yading@10: =item BIB<[:>IB<]> yading@10: yading@10: If I is given, then it matches the stream with number I yading@10: in the program with the id I. Otherwise, it matches all streams in the yading@10: program. yading@10: yading@10: =item B<#>I yading@10: yading@10: Matches the stream by a format-specific ID. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 Generic options yading@10: yading@10: yading@10: These options are shared amongst the ff* tools. yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<-L> yading@10: yading@10: Show license. yading@10: yading@10: yading@10: =item B<-h, -?, -help, --help [>IB<]> yading@10: yading@10: Show help. An optional parameter may be specified to print help about a specific yading@10: item. yading@10: yading@10: Possible values of I are: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item BI yading@10: yading@10: Print detailed information about the decoder named I. Use the yading@10: B<-decoders> option to get a list of all decoders. yading@10: yading@10: yading@10: =item BI yading@10: yading@10: Print detailed information about the encoder named I. Use the yading@10: B<-encoders> option to get a list of all encoders. yading@10: yading@10: yading@10: =item BI yading@10: yading@10: Print detailed information about the demuxer named I. Use the yading@10: B<-formats> option to get a list of all demuxers and muxers. yading@10: yading@10: yading@10: =item BI yading@10: yading@10: Print detailed information about the muxer named I. Use the yading@10: B<-formats> option to get a list of all muxers and demuxers. yading@10: yading@10: yading@10: =item BI yading@10: yading@10: Print detailed information about the filter name I. Use the yading@10: B<-filters> option to get a list of all filters. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<-version> yading@10: yading@10: Show version. yading@10: yading@10: yading@10: =item B<-formats> yading@10: yading@10: Show available formats. yading@10: yading@10: yading@10: =item B<-codecs> yading@10: yading@10: Show all codecs known to libavcodec. yading@10: yading@10: Note that the term 'codec' is used throughout this documentation as a shortcut yading@10: for what is more correctly called a media bitstream format. yading@10: yading@10: yading@10: =item B<-decoders> yading@10: yading@10: Show available decoders. yading@10: yading@10: yading@10: =item B<-encoders> yading@10: yading@10: Show all available encoders. yading@10: yading@10: yading@10: =item B<-bsfs> yading@10: yading@10: Show available bitstream filters. yading@10: yading@10: yading@10: =item B<-protocols> yading@10: yading@10: Show available protocols. yading@10: yading@10: yading@10: =item B<-filters> yading@10: yading@10: Show available libavfilter filters. yading@10: yading@10: yading@10: =item B<-pix_fmts> yading@10: yading@10: Show available pixel formats. yading@10: yading@10: yading@10: =item B<-sample_fmts> yading@10: yading@10: Show available sample formats. yading@10: yading@10: yading@10: =item B<-layouts> yading@10: yading@10: Show channel names and standard channel layouts. yading@10: yading@10: yading@10: =item B<-loglevel [repeat+]>I B<| -v [repeat+]>I yading@10: yading@10: Set the logging level used by the library. yading@10: Adding "repeat+" indicates that repeated log output should not be compressed yading@10: to the first line and the "Last message repeated n times" line will be yading@10: omitted. "repeat" can also be used alone. yading@10: If "repeat" is used alone, and with no prior loglevel set, the default yading@10: loglevel will be used. If multiple loglevel parameters are given, using yading@10: 'repeat' will not change the loglevel. yading@10: I is a number or a string containing one of the following values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B yading@10: yading@10: Show nothing at all; be silent. yading@10: yading@10: =item B yading@10: yading@10: Only show fatal errors which could lead the process to crash, such as yading@10: and assert failure. This is not currently used for anything. yading@10: yading@10: =item B yading@10: yading@10: Only show fatal errors. These are errors after which the process absolutely yading@10: cannot continue after. yading@10: yading@10: =item B yading@10: yading@10: Show all errors, including ones which can be recovered from. yading@10: yading@10: =item B yading@10: yading@10: Show all warnings and errors. Any message related to possibly yading@10: incorrect or unexpected events will be shown. yading@10: yading@10: =item B yading@10: yading@10: Show informative messages during processing. This is in addition to yading@10: warnings and errors. This is the default value. yading@10: yading@10: =item B yading@10: yading@10: Same as C, except more verbose. yading@10: yading@10: =item B yading@10: yading@10: Show everything, including debugging information. yading@10: yading@10: =back yading@10: yading@10: yading@10: By default the program logs to stderr, if coloring is supported by the yading@10: terminal, colors are used to mark errors and warnings. Log coloring yading@10: can be disabled setting the environment variable yading@10: B or B, or can be forced setting yading@10: the environment variable B. yading@10: The use of the environment variable B is deprecated and yading@10: will be dropped in a following FFmpeg version. yading@10: yading@10: yading@10: =item B<-report> yading@10: yading@10: Dump full command line and console output to a file named yading@10: C-I-I.log> in the current yading@10: directory. yading@10: This file can be useful for bug reports. yading@10: It also implies C<-loglevel verbose>. yading@10: yading@10: Setting the environment variable C to any value has the yading@10: same effect. If the value is a ':'-separated key=value sequence, these yading@10: options will affect the report; options values must be escaped if they yading@10: contain special characters or the options delimiter ':' (see the yading@10: ``Quoting and escaping'' section in the ffmpeg-utils manual). The yading@10: following option is recognized: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B yading@10: yading@10: set the file name to use for the report; C<%p> is expanded to the name yading@10: of the program, C<%t> is expanded to a timestamp, C<%%> is expanded yading@10: to a plain C<%> yading@10: yading@10: =back yading@10: yading@10: yading@10: Errors in parsing the environment variable are not fatal, and will not yading@10: appear in the report. yading@10: yading@10: yading@10: =item B<-cpuflags flags (>IB<)> yading@10: yading@10: Allows setting and clearing cpu flags. This option is intended yading@10: for testing. Do not use it unless you know what you're doing. yading@10: yading@10: ffmpeg -cpuflags -sse+mmx ... yading@10: ffmpeg -cpuflags mmx ... yading@10: ffmpeg -cpuflags 0 ... yading@10: yading@10: Possible flags for this option are: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =item B<3dnow> yading@10: yading@10: yading@10: =item B<3dnowext> yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =item B yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<-opencl_options options (>IB<)> yading@10: yading@10: Set OpenCL environment options. This option is only available when yading@10: FFmpeg has been compiled with C<--enable-opencl>. yading@10: yading@10: I must be a list of I=I option pairs yading@10: separated by ':'. See the ``OpenCL Options'' section in the yading@10: ffmpeg-utils manual for the list of supported options. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 AVOptions yading@10: yading@10: yading@10: These options are provided directly by the libavformat, libavdevice and yading@10: libavcodec libraries. To see the list of available AVOptions, use the yading@10: B<-help> option. They are separated into two categories: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B yading@10: yading@10: These options can be set for any container, codec or device. Generic options yading@10: are listed under AVFormatContext options for containers/devices and under yading@10: AVCodecContext options for codecs. yading@10: yading@10: =item B yading@10: yading@10: These options are specific to the given container, device or codec. Private yading@10: options are listed under their corresponding containers/devices/codecs. yading@10: yading@10: =back yading@10: yading@10: yading@10: For example to write an ID3v2.3 header instead of a default ID3v2.4 to yading@10: an MP3 file, use the B private option of the MP3 yading@10: muxer: yading@10: yading@10: ffmpeg -i input.flac -id3v2_version 3 out.mp3 yading@10: yading@10: yading@10: All codec AVOptions are obviously per-stream, so the chapter on stream yading@10: specifiers applies to them yading@10: yading@10: Note B<-nooption> syntax cannot be used for boolean AVOptions, yading@10: use B<-option 0>/B<-option 1>. yading@10: yading@10: Note2 old undocumented way of specifying per-stream AVOptions by prepending yading@10: v/a/s to the options name is now obsolete and will be removed soon. yading@10: yading@10: yading@10: =head2 Main options yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<-f> I yading@10: yading@10: Force format to use. yading@10: yading@10: yading@10: =item B<-unit> yading@10: yading@10: Show the unit of the displayed values. yading@10: yading@10: yading@10: =item B<-prefix> yading@10: yading@10: Use SI prefixes for the displayed values. yading@10: Unless the "-byte_binary_prefix" option is used all the prefixes yading@10: are decimal. yading@10: yading@10: yading@10: =item B<-byte_binary_prefix> yading@10: yading@10: Force the use of binary prefixes for byte values. yading@10: yading@10: yading@10: =item B<-sexagesimal> yading@10: yading@10: Use sexagesimal format HH:MM:SS.MICROSECONDS for time values. yading@10: yading@10: yading@10: =item B<-pretty> yading@10: yading@10: Prettify the format of the displayed values, it corresponds to the yading@10: options "-unit -prefix -byte_binary_prefix -sexagesimal". yading@10: yading@10: yading@10: =item B<-of, -print_format> IB<[=>IB<]> yading@10: yading@10: Set the output printing format. yading@10: yading@10: I specifies the name of the writer, and yading@10: I specifies the options to be passed to the writer. yading@10: yading@10: For example for printing the output in JSON format, specify: yading@10: yading@10: -print_format json yading@10: yading@10: yading@10: For more details on the available output printing formats, see the yading@10: Writers section below. yading@10: yading@10: yading@10: =item B<-sections> yading@10: yading@10: Print sections structure and section information, and exit. The output yading@10: is not meant to be parsed by a machine. yading@10: yading@10: yading@10: =item B<-select_streams> I yading@10: yading@10: Select only the streams specified by I. This yading@10: option affects only the options related to streams yading@10: (e.g. C, C, etc.). yading@10: yading@10: For example to show only audio streams, you can use the command: yading@10: yading@10: ffprobe -show_streams -select_streams a INPUT yading@10: yading@10: yading@10: To show only video packets belonging to the video stream with index 1: yading@10: yading@10: ffprobe -show_packets -select_streams v:1 INPUT yading@10: yading@10: yading@10: yading@10: =item B<-show_data> yading@10: yading@10: Show payload data, as an hexadecimal and ASCII dump. Coupled with yading@10: B<-show_packets>, it will dump the packets' data. Coupled with yading@10: B<-show_streams>, it will dump the codec extradata. yading@10: yading@10: The dump is printed as the "data" field. It may contain newlines. yading@10: yading@10: yading@10: =item B<-show_error> yading@10: yading@10: Show information about the error found when trying to probe the input. yading@10: yading@10: The error information is printed within a section with name "ERROR". yading@10: yading@10: yading@10: =item B<-show_format> yading@10: yading@10: Show information about the container format of the input multimedia yading@10: stream. yading@10: yading@10: All the container format information is printed within a section with yading@10: name "FORMAT". yading@10: yading@10: yading@10: =item B<-show_format_entry> I yading@10: yading@10: Like B<-show_format>, but only prints the specified entry of the yading@10: container format information, rather than all. This option may be given more yading@10: than once, then all specified entries will be shown. yading@10: yading@10: This option is deprecated, use C instead. yading@10: yading@10: yading@10: =item B<-show_entries> I yading@10: yading@10: Set list of entries to show. yading@10: yading@10: Entries are specified according to the following yading@10: syntax. I contains a list of section entries yading@10: separated by C<:>. Each section entry is composed by a section yading@10: name (or unique name), optionally followed by a list of entries local yading@10: to that section, separated by C<,>. yading@10: yading@10: If section name is specified but is followed by no C<=>, all yading@10: entries are printed to output, together with all the contained yading@10: sections. Otherwise only the entries specified in the local section yading@10: entries list are printed. In particular, if C<=> is specified but yading@10: the list of local entries is empty, then no entries will be shown for yading@10: that section. yading@10: yading@10: Note that the order of specification of the local section entries is yading@10: not honored in the output, and the usual display order will be yading@10: retained. yading@10: yading@10: The formal syntax is given by: yading@10: yading@10: ::= [,] yading@10: ::= [=[]] yading@10: ::= [:] yading@10: yading@10: yading@10: For example, to show only the index and type of each stream, and the PTS yading@10: time, duration time, and stream index of the packets, you can specify yading@10: the argument: yading@10: yading@10: packet=pts_time,duration_time,stream_index : stream=index,codec_type yading@10: yading@10: yading@10: To show all the entries in the section "format", but only the codec yading@10: type in the section "stream", specify the argument: yading@10: yading@10: format : stream=codec_type yading@10: yading@10: yading@10: To show all the tags in the stream and format sections: yading@10: yading@10: format_tags : format_tags yading@10: yading@10: yading@10: To show only the C tag (if available) in the stream yading@10: sections: yading@10: yading@10: stream_tags=title yading@10: yading@10: yading@10: yading@10: =item B<-show_packets> yading@10: yading@10: Show information about each packet contained in the input multimedia yading@10: stream. yading@10: yading@10: The information for each single packet is printed within a dedicated yading@10: section with name "PACKET". yading@10: yading@10: yading@10: =item B<-show_frames> yading@10: yading@10: Show information about each frame contained in the input multimedia yading@10: stream. yading@10: yading@10: The information for each single frame is printed within a dedicated yading@10: section with name "FRAME". yading@10: yading@10: yading@10: =item B<-show_streams> yading@10: yading@10: Show information about each media stream contained in the input yading@10: multimedia stream. yading@10: yading@10: Each media stream information is printed within a dedicated section yading@10: with name "STREAM". yading@10: yading@10: yading@10: =item B<-count_frames> yading@10: yading@10: Count the number of frames per stream and report it in the yading@10: corresponding stream section. yading@10: yading@10: yading@10: =item B<-count_packets> yading@10: yading@10: Count the number of packets per stream and report it in the yading@10: corresponding stream section. yading@10: yading@10: yading@10: =item B<-show_private_data, -private> yading@10: yading@10: Show private data, that is data depending on the format of the yading@10: particular shown element. yading@10: This option is enabled by default, but you may need to disable it yading@10: for specific uses, for example when creating XSD-compliant XML output. yading@10: yading@10: yading@10: =item B<-show_program_version> yading@10: yading@10: Show information related to program version. yading@10: yading@10: Version information is printed within a section with name yading@10: "PROGRAM_VERSION". yading@10: yading@10: yading@10: =item B<-show_library_versions> yading@10: yading@10: Show information related to library versions. yading@10: yading@10: Version information for each library is printed within a section with yading@10: name "LIBRARY_VERSION". yading@10: yading@10: yading@10: =item B<-show_versions> yading@10: yading@10: Show information related to program and library versions. This is the yading@10: equivalent of setting both B<-show_program_version> and yading@10: B<-show_library_versions> options. yading@10: yading@10: yading@10: =item B<-bitexact> yading@10: yading@10: Force bitexact output, useful to produce output which is not dependent yading@10: on the specific build. yading@10: yading@10: yading@10: =item B<-i> I<input_file> yading@10: yading@10: Read I<input_file>. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head1 WRITERS yading@10: yading@10: yading@10: A writer defines the output format adopted by B<ffprobe>, and will be yading@10: used for printing all the parts of the output. yading@10: yading@10: A writer may accept one or more arguments, which specify the options yading@10: to adopt. The options are specified as a list of I<key>=I<value> yading@10: pairs, separated by ":". yading@10: yading@10: A description of the currently available writers follows. yading@10: yading@10: yading@10: =head2 default yading@10: yading@10: Default format. yading@10: yading@10: Print each section in the form: yading@10: yading@10: [SECTION] yading@10: key1=val1 yading@10: ... yading@10: keyN=valN yading@10: [/SECTION] yading@10: yading@10: yading@10: Metadata tags are printed as a line in the corresponding FORMAT or yading@10: STREAM section, and are prefixed by the string "TAG:". yading@10: yading@10: A description of the accepted options follows. yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<nokey, nk> yading@10: yading@10: If set to 1 specify not to print the key of each field. Default value yading@10: is 0. yading@10: yading@10: yading@10: =item B<noprint_wrappers, nw> yading@10: yading@10: If set to 1 specify not to print the section header and footer. yading@10: Default value is 0. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 compact, csv yading@10: yading@10: Compact and CSV format. yading@10: yading@10: The C<csv> writer is equivalent to C<compact>, but supports yading@10: different defaults. yading@10: yading@10: Each section is printed on a single line. yading@10: If no option is specifid, the output has the form: yading@10: yading@10: section|key1=val1| ... |keyN=valN yading@10: yading@10: yading@10: Metadata tags are printed in the corresponding "format" or "stream" yading@10: section. A metadata tag key, if printed, is prefixed by the string yading@10: "tag:". yading@10: yading@10: The description of the accepted options follows. yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<item_sep, s> yading@10: yading@10: Specify the character to use for separating fields in the output line. yading@10: It must be a single printable character, it is "|" by default ("," for yading@10: the C<csv> writer). yading@10: yading@10: yading@10: =item B<nokey, nk> yading@10: yading@10: If set to 1 specify not to print the key of each field. Its default yading@10: value is 0 (1 for the C<csv> writer). yading@10: yading@10: yading@10: =item B<escape, e> yading@10: yading@10: Set the escape mode to use, default to "c" ("csv" for the C<csv> yading@10: writer). yading@10: yading@10: It can assume one of the following values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<c> yading@10: yading@10: Perform C-like escaping. Strings containing a newline ('\n'), carriage yading@10: return ('\r'), a tab ('\t'), a form feed ('\f'), the escaping yading@10: character ('\') or the item separator character I<SEP> are escaped using C-like fashioned yading@10: escaping, so that a newline is converted to the sequence "\n", a yading@10: carriage return to "\r", '\' to "\\" and the separator I<SEP> is yading@10: converted to "\I<SEP>". yading@10: yading@10: yading@10: =item B<csv> yading@10: yading@10: Perform CSV-like escaping, as described in RFC4180. Strings yading@10: containing a newline ('\n'), a carriage return ('\r'), a double quote yading@10: ('"'), or I<SEP> are enclosed in double-quotes. yading@10: yading@10: yading@10: =item B<none> yading@10: yading@10: Perform no escaping. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<print_section, p> yading@10: yading@10: Print the section name at the begin of each line if the value is yading@10: C<1>, disable it with value set to C<0>. Default value is yading@10: C<1>. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 flat yading@10: yading@10: Flat format. yading@10: yading@10: A free-form output where each line contains an explicit key=value, such as yading@10: "streams.stream.3.tags.foo=bar". The output is shell escaped, so it can be yading@10: directly embedded in sh scripts as long as the separator character is an yading@10: alphanumeric character or an underscore (see I<sep_char> option). yading@10: yading@10: The description of the accepted options follows. yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<sep_char, s> yading@10: yading@10: Separator character used to separate the chapter, the section name, IDs and yading@10: potential tags in the printed field key. yading@10: yading@10: Default value is '.'. yading@10: yading@10: yading@10: =item B<hierarchical, h> yading@10: yading@10: Specify if the section name specification should be hierarchical. If yading@10: set to 1, and if there is more than one section in the current yading@10: chapter, the section name will be prefixed by the name of the yading@10: chapter. A value of 0 will disable this behavior. yading@10: yading@10: Default value is 1. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 ini yading@10: yading@10: INI format output. yading@10: yading@10: Print output in an INI based format. yading@10: yading@10: The following conventions are adopted: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: all key and values are UTF-8 yading@10: yading@10: =item * yading@10: yading@10: '.' is the subgroup separator yading@10: yading@10: =item * yading@10: yading@10: newline, '\t', '\f', '\b' and the following characters are escaped yading@10: yading@10: =item * yading@10: yading@10: '\' is the escape character yading@10: yading@10: =item * yading@10: yading@10: '#' is the comment indicator yading@10: yading@10: =item * yading@10: yading@10: '=' is the key/value separator yading@10: yading@10: =item * yading@10: yading@10: ':' is not used but usually parsed as key/value separator yading@10: yading@10: =back yading@10: yading@10: yading@10: This writer accepts options as a list of I<key>=I<value> pairs, yading@10: separated by ":". yading@10: yading@10: The description of the accepted options follows. yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<hierarchical, h> yading@10: yading@10: Specify if the section name specification should be hierarchical. If yading@10: set to 1, and if there is more than one section in the current yading@10: chapter, the section name will be prefixed by the name of the yading@10: chapter. A value of 0 will disable this behavior. yading@10: yading@10: Default value is 1. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 json yading@10: yading@10: JSON based format. yading@10: yading@10: Each section is printed using JSON notation. yading@10: yading@10: The description of the accepted options follows. yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<compact, c> yading@10: yading@10: If set to 1 enable compact output, that is each section will be yading@10: printed on a single line. Default value is 0. yading@10: yading@10: =back yading@10: yading@10: yading@10: For more information about JSON, see E<lt>B<http://www.json.org/>E<gt>. yading@10: yading@10: yading@10: =head2 xml yading@10: yading@10: XML based format. yading@10: yading@10: The XML output is described in the XML schema description file yading@10: F<ffprobe.xsd> installed in the FFmpeg datadir. yading@10: yading@10: An updated version of the schema can be retrieved at the url yading@10: E<lt>B<http://www.ffmpeg.org/schema/ffprobe.xsd>E<gt>, which redirects to the yading@10: latest schema committed into the FFmpeg development source code tree. yading@10: yading@10: Note that the output issued will be compliant to the yading@10: F<ffprobe.xsd> schema only when no special global output options yading@10: (B<unit>, B<prefix>, B<byte_binary_prefix>, yading@10: B<sexagesimal> etc.) are specified. yading@10: yading@10: The description of the accepted options follows. yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<fully_qualified, q> yading@10: yading@10: If set to 1 specify if the output should be fully qualified. Default yading@10: value is 0. yading@10: This is required for generating an XML file which can be validated yading@10: through an XSD file. yading@10: yading@10: yading@10: =item B<xsd_compliant, x> yading@10: yading@10: If set to 1 perform more checks for ensuring that the output is XSD yading@10: compliant. Default value is 0. yading@10: This option automatically sets B<fully_qualified> to 1. yading@10: yading@10: =back yading@10: yading@10: yading@10: For more information about the XML format, see yading@10: E<lt>B<http://www.w3.org/XML/>E<gt>. yading@10: yading@10: yading@10: =head1 TIMECODE yading@10: yading@10: yading@10: B<ffprobe> supports Timecode extraction: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: MPEG1/2 timecode is extracted from the GOP, and is available in the video yading@10: stream details (B<-show_streams>, see I<timecode>). yading@10: yading@10: yading@10: =item * yading@10: yading@10: MOV timecode is extracted from tmcd track, so is available in the tmcd yading@10: stream metadata (B<-show_streams>, see I<TAG:timecode>). yading@10: yading@10: yading@10: =item * yading@10: yading@10: DV, GXF and AVI timecodes are available in format metadata yading@10: (B<-show_format>, see I<TAG:timecode>). yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: yading@10: =head1 SYNTAX yading@10: yading@10: yading@10: This section documents the syntax and formats employed by the FFmpeg yading@10: libraries and tools. yading@10: yading@10: yading@10: yading@10: =head2 Quoting and escaping yading@10: yading@10: yading@10: FFmpeg adopts the following quoting and escaping mechanism, unless yading@10: explicitly specified. The following rules are applied: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: C<'> and C<\> are special characters (respectively used for yading@10: quoting and escaping). In addition to them, there might be other yading@10: special characters depending on the specific syntax where the escaping yading@10: and quoting are employed. yading@10: yading@10: yading@10: =item * yading@10: yading@10: A special character is escaped by prefixing it with a '\'. yading@10: yading@10: yading@10: =item * yading@10: yading@10: All characters enclosed between '' are included literally in the yading@10: parsed string. The quote character C<'> itself cannot be quoted, yading@10: so you may need to close the quote and escape it. yading@10: yading@10: yading@10: =item * yading@10: yading@10: Leading and trailing whitespaces, unless escaped or quoted, are yading@10: removed from the parsed string. yading@10: yading@10: =back yading@10: yading@10: yading@10: Note that you may need to add a second level of escaping when using yading@10: the command line or a script, which depends on the syntax of the yading@10: adopted shell language. yading@10: yading@10: The function C<av_get_token> defined in yading@10: F<libavutil/avstring.h> can be used to parse a token quoted or yading@10: escaped according to the rules defined above. yading@10: yading@10: The tool F<tools/ffescape> in the FFmpeg source tree can be used yading@10: to automatically quote or escape a string in a script. yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Escape the string C<Crime d'Amour> containing the C<'> special yading@10: character: yading@10: yading@10: Crime d\'Amour yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: The string above contains a quote, so the C<'> needs to be escaped yading@10: when quoting it: yading@10: yading@10: 'Crime d'\''Amour' yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Include leading or trailing whitespaces using quoting: yading@10: yading@10: ' this string starts and ends with whitespaces ' yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Escaping and quoting can be mixed together: yading@10: yading@10: ' The string '\'string\'' is a string ' yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: To include a literal C<\> you can use either escaping or quoting: yading@10: yading@10: 'c:\foo' can be written as c:\\foo yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: yading@10: =head2 Date yading@10: yading@10: yading@10: The accepted syntax is: yading@10: yading@10: [(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...]]])|(HHMMSS[.m...]]]))[Z] yading@10: now yading@10: yading@10: yading@10: If the value is "now" it takes the current time. yading@10: yading@10: Time is local time unless Z is appended, in which case it is yading@10: interpreted as UTC. yading@10: If the year-month-day part is not specified it takes the current yading@10: year-month-day. yading@10: yading@10: yading@10: yading@10: =head2 Time duration yading@10: yading@10: yading@10: The accepted syntax is: yading@10: yading@10: [-][HH:]MM:SS[.m...] yading@10: [-]S+[.m...] yading@10: yading@10: yading@10: I<HH> expresses the number of hours, I<MM> the number a of minutes yading@10: and I<SS> the number of seconds. yading@10: yading@10: yading@10: yading@10: =head2 Video size yading@10: yading@10: Specify the size of the sourced video, it may be a string of the form yading@10: I<width>xI<height>, or the name of a size abbreviation. yading@10: yading@10: The following abbreviations are recognized: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<ntsc> yading@10: yading@10: 720x480 yading@10: yading@10: =item B<pal> yading@10: yading@10: 720x576 yading@10: yading@10: =item B<qntsc> yading@10: yading@10: 352x240 yading@10: yading@10: =item B<qpal> yading@10: yading@10: 352x288 yading@10: yading@10: =item B<sntsc> yading@10: yading@10: 640x480 yading@10: yading@10: =item B<spal> yading@10: yading@10: 768x576 yading@10: yading@10: =item B<film> yading@10: yading@10: 352x240 yading@10: yading@10: =item B<ntsc-film> yading@10: yading@10: 352x240 yading@10: yading@10: =item B<sqcif> yading@10: yading@10: 128x96 yading@10: yading@10: =item B<qcif> yading@10: yading@10: 176x144 yading@10: yading@10: =item B<cif> yading@10: yading@10: 352x288 yading@10: yading@10: =item B<4cif> yading@10: yading@10: 704x576 yading@10: yading@10: =item B<16cif> yading@10: yading@10: 1408x1152 yading@10: yading@10: =item B<qqvga> yading@10: yading@10: 160x120 yading@10: yading@10: =item B<qvga> yading@10: yading@10: 320x240 yading@10: yading@10: =item B<vga> yading@10: yading@10: 640x480 yading@10: yading@10: =item B<svga> yading@10: yading@10: 800x600 yading@10: yading@10: =item B<xga> yading@10: yading@10: 1024x768 yading@10: yading@10: =item B<uxga> yading@10: yading@10: 1600x1200 yading@10: yading@10: =item B<qxga> yading@10: yading@10: 2048x1536 yading@10: yading@10: =item B<sxga> yading@10: yading@10: 1280x1024 yading@10: yading@10: =item B<qsxga> yading@10: yading@10: 2560x2048 yading@10: yading@10: =item B<hsxga> yading@10: yading@10: 5120x4096 yading@10: yading@10: =item B<wvga> yading@10: yading@10: 852x480 yading@10: yading@10: =item B<wxga> yading@10: yading@10: 1366x768 yading@10: yading@10: =item B<wsxga> yading@10: yading@10: 1600x1024 yading@10: yading@10: =item B<wuxga> yading@10: yading@10: 1920x1200 yading@10: yading@10: =item B<woxga> yading@10: yading@10: 2560x1600 yading@10: yading@10: =item B<wqsxga> yading@10: yading@10: 3200x2048 yading@10: yading@10: =item B<wquxga> yading@10: yading@10: 3840x2400 yading@10: yading@10: =item B<whsxga> yading@10: yading@10: 6400x4096 yading@10: yading@10: =item B<whuxga> yading@10: yading@10: 7680x4800 yading@10: yading@10: =item B<cga> yading@10: yading@10: 320x200 yading@10: yading@10: =item B<ega> yading@10: yading@10: 640x350 yading@10: yading@10: =item B<hd480> yading@10: yading@10: 852x480 yading@10: yading@10: =item B<hd720> yading@10: yading@10: 1280x720 yading@10: yading@10: =item B<hd1080> yading@10: yading@10: 1920x1080 yading@10: yading@10: =item B<2k> yading@10: yading@10: 2048x1080 yading@10: yading@10: =item B<2kflat> yading@10: yading@10: 1998x1080 yading@10: yading@10: =item B<2kscope> yading@10: yading@10: 2048x858 yading@10: yading@10: =item B<4k> yading@10: yading@10: 4096x2160 yading@10: yading@10: =item B<4kflat> yading@10: yading@10: 3996x2160 yading@10: yading@10: =item B<4kscope> yading@10: yading@10: 4096x1716 yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: yading@10: =head2 Video rate yading@10: yading@10: yading@10: Specify the frame rate of a video, expressed as the number of frames yading@10: generated per second. It has to be a string in the format yading@10: I<frame_rate_num>/I<frame_rate_den>, an integer number, a float yading@10: number or a valid video frame rate abbreviation. yading@10: yading@10: The following abbreviations are recognized: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<ntsc> yading@10: yading@10: 30000/1001 yading@10: yading@10: =item B<pal> yading@10: yading@10: 25/1 yading@10: yading@10: =item B<qntsc> yading@10: yading@10: 30000/1001 yading@10: yading@10: =item B<qpal> yading@10: yading@10: 25/1 yading@10: yading@10: =item B<sntsc> yading@10: yading@10: 30000/1001 yading@10: yading@10: =item B<spal> yading@10: yading@10: 25/1 yading@10: yading@10: =item B<film> yading@10: yading@10: 24/1 yading@10: yading@10: =item B<ntsc-film> yading@10: yading@10: 24000/1001 yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: yading@10: =head2 Ratio yading@10: yading@10: yading@10: A ratio can be expressed as an expression, or in the form yading@10: I<numerator>:I<denominator>. yading@10: yading@10: Note that a ratio with infinite (1/0) or negative value is yading@10: considered valid, so you should check on the returned value if you yading@10: want to exclude those values. yading@10: yading@10: The undefined value can be expressed using the "0:0" string. yading@10: yading@10: yading@10: yading@10: =head2 Color yading@10: yading@10: yading@10: It can be the name of a color (case insensitive match) or a yading@10: [0x|#]RRGGBB[AA] sequence, possibly followed by "@" and a string yading@10: representing the alpha component. yading@10: yading@10: The alpha component may be a string composed by "0x" followed by an yading@10: hexadecimal number or a decimal number between 0.0 and 1.0, which yading@10: represents the opacity value (0x00/0.0 means completely transparent, yading@10: 0xff/1.0 completely opaque). yading@10: If the alpha component is not specified then 0xff is assumed. yading@10: yading@10: The string "random" will result in a random color. yading@10: yading@10: yading@10: yading@10: =head1 EXPRESSION EVALUATION yading@10: yading@10: yading@10: When evaluating an arithmetic expression, FFmpeg uses an internal yading@10: formula evaluator, implemented through the F<libavutil/eval.h> yading@10: interface. yading@10: yading@10: An expression may contain unary, binary operators, constants, and yading@10: functions. yading@10: yading@10: Two expressions I<expr1> and I<expr2> can be combined to form yading@10: another expression "I<expr1>;I<expr2>". yading@10: I<expr1> and I<expr2> are evaluated in turn, and the new yading@10: expression evaluates to the value of I<expr2>. yading@10: yading@10: The following binary operators are available: C<+>, C<->, yading@10: C<*>, C</>, C<^>. yading@10: yading@10: The following unary operators are available: C<+>, C<->. yading@10: yading@10: The following functions are available: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<abs(x)> yading@10: yading@10: Compute absolute value of I<x>. yading@10: yading@10: yading@10: =item B<acos(x)> yading@10: yading@10: Compute arccosine of I<x>. yading@10: yading@10: yading@10: =item B<asin(x)> yading@10: yading@10: Compute arcsine of I<x>. yading@10: yading@10: yading@10: =item B<atan(x)> yading@10: yading@10: Compute arctangent of I<x>. yading@10: yading@10: yading@10: =item B<between(x, min, max)> yading@10: yading@10: Return 1 if I<x> is greater than or equal to I<min> and lesser than or yading@10: equal to I<max>, 0 otherwise. yading@10: yading@10: yading@10: =item B<bitand(x, y)> yading@10: yading@10: yading@10: =item B<bitor(x, y)> yading@10: yading@10: Compute bitwise and/or operation on I<x> and I<y>. yading@10: yading@10: The results of the evaluation of I<x> and I<y> are converted to yading@10: integers before executing the bitwise operation. yading@10: yading@10: Note that both the conversion to integer and the conversion back to yading@10: floating point can lose precision. Beware of unexpected results for yading@10: large numbers (usually 2^53 and larger). yading@10: yading@10: yading@10: =item B<ceil(expr)> yading@10: yading@10: Round the value of expression I<expr> upwards to the nearest yading@10: integer. For example, "ceil(1.5)" is "2.0". yading@10: yading@10: yading@10: =item B<cos(x)> yading@10: yading@10: Compute cosine of I<x>. yading@10: yading@10: yading@10: =item B<cosh(x)> yading@10: yading@10: Compute hyperbolic cosine of I<x>. yading@10: yading@10: yading@10: =item B<eq(x, y)> yading@10: yading@10: Return 1 if I<x> and I<y> are equivalent, 0 otherwise. yading@10: yading@10: yading@10: =item B<exp(x)> yading@10: yading@10: Compute exponential of I<x> (with base C<e>, the Euler's number). yading@10: yading@10: yading@10: =item B<floor(expr)> yading@10: yading@10: Round the value of expression I<expr> downwards to the nearest yading@10: integer. For example, "floor(-1.5)" is "-2.0". yading@10: yading@10: yading@10: =item B<gauss(x)> yading@10: yading@10: Compute Gauss function of I<x>, corresponding to yading@10: C<exp(-x*x/2) / sqrt(2*PI)>. yading@10: yading@10: yading@10: =item B<gcd(x, y)> yading@10: yading@10: Return the greatest common divisor of I<x> and I<y>. If both I<x> and yading@10: I<y> are 0 or either or both are less than zero then behavior is undefined. yading@10: yading@10: yading@10: =item B<gt(x, y)> yading@10: yading@10: Return 1 if I<x> is greater than I<y>, 0 otherwise. yading@10: yading@10: yading@10: =item B<gte(x, y)> yading@10: yading@10: Return 1 if I<x> is greater than or equal to I<y>, 0 otherwise. yading@10: yading@10: yading@10: =item B<hypot(x, y)> yading@10: yading@10: This function is similar to the C function with the same name; it returns yading@10: "sqrt(I<x>*I<x> + I<y>*I<y>)", the length of the hypotenuse of a yading@10: right triangle with sides of length I<x> and I<y>, or the distance of the yading@10: point (I<x>, I<y>) from the origin. yading@10: yading@10: yading@10: =item B<if(x, y)> yading@10: yading@10: Evaluate I<x>, and if the result is non-zero return the result of yading@10: the evaluation of I<y>, return 0 otherwise. yading@10: yading@10: yading@10: =item B<if(x, y, z)> yading@10: yading@10: Evaluate I<x>, and if the result is non-zero return the evaluation yading@10: result of I<y>, otherwise the evaluation result of I<z>. yading@10: yading@10: yading@10: =item B<ifnot(x, y)> yading@10: yading@10: Evaluate I<x>, and if the result is zero return the result of the yading@10: evaluation of I<y>, return 0 otherwise. yading@10: yading@10: yading@10: =item B<ifnot(x, y, z)> yading@10: yading@10: Evaluate I<x>, and if the result is zero return the evaluation yading@10: result of I<y>, otherwise the evaluation result of I<z>. yading@10: yading@10: yading@10: =item B<isinf(x)> yading@10: yading@10: Return 1.0 if I<x> is +/-INFINITY, 0.0 otherwise. yading@10: yading@10: yading@10: =item B<isnan(x)> yading@10: yading@10: Return 1.0 if I<x> is NAN, 0.0 otherwise. yading@10: yading@10: yading@10: =item B<ld(var)> yading@10: yading@10: Allow to load the value of the internal variable with number yading@10: I<var>, which was previously stored with st(I<var>, I<expr>). yading@10: The function returns the loaded value. yading@10: yading@10: yading@10: =item B<log(x)> yading@10: yading@10: Compute natural logarithm of I<x>. yading@10: yading@10: yading@10: =item B<lt(x, y)> yading@10: yading@10: Return 1 if I<x> is lesser than I<y>, 0 otherwise. yading@10: yading@10: yading@10: =item B<lte(x, y)> yading@10: yading@10: Return 1 if I<x> is lesser than or equal to I<y>, 0 otherwise. yading@10: yading@10: yading@10: =item B<max(x, y)> yading@10: yading@10: Return the maximum between I<x> and I<y>. yading@10: yading@10: yading@10: =item B<min(x, y)> yading@10: yading@10: Return the maximum between I<x> and I<y>. yading@10: yading@10: yading@10: =item B<mod(x, y)> yading@10: yading@10: Compute the remainder of division of I<x> by I<y>. yading@10: yading@10: yading@10: =item B<not(expr)> yading@10: yading@10: Return 1.0 if I<expr> is zero, 0.0 otherwise. yading@10: yading@10: yading@10: =item B<pow(x, y)> yading@10: yading@10: Compute the power of I<x> elevated I<y>, it is equivalent to yading@10: "(I<x>)^(I<y>)". yading@10: yading@10: yading@10: =item B<print(t)> yading@10: yading@10: yading@10: =item B<print(t, l)> yading@10: yading@10: Print the value of expression I<t> with loglevel I<l>. If yading@10: I<l> is not specified then a default log level is used. yading@10: Returns the value of the expression printed. yading@10: yading@10: Prints t with loglevel l yading@10: yading@10: yading@10: =item B<random(x)> yading@10: yading@10: Return a pseudo random value between 0.0 and 1.0. I<x> is the index of the yading@10: internal variable which will be used to save the seed/state. yading@10: yading@10: yading@10: =item B<root(expr, max)> yading@10: yading@10: Find an input value for which the function represented by I<expr> yading@10: with argument I<ld(0)> is 0 in the interval 0..I<max>. yading@10: yading@10: The expression in I<expr> must denote a continuous function or the yading@10: result is undefined. yading@10: yading@10: I<ld(0)> is used to represent the function input value, which means yading@10: that the given expression will be evaluated multiple times with yading@10: various input values that the expression can access through yading@10: C<ld(0)>. When the expression evaluates to 0 then the yading@10: corresponding input value will be returned. yading@10: yading@10: yading@10: =item B<sin(x)> yading@10: yading@10: Compute sine of I<x>. yading@10: yading@10: yading@10: =item B<sinh(x)> yading@10: yading@10: Compute hyperbolic sine of I<x>. yading@10: yading@10: yading@10: =item B<sqrt(expr)> yading@10: yading@10: Compute the square root of I<expr>. This is equivalent to yading@10: "(I<expr>)^.5". yading@10: yading@10: yading@10: =item B<squish(x)> yading@10: yading@10: Compute expression C<1/(1 + exp(4*x))>. yading@10: yading@10: yading@10: =item B<st(var, expr)> yading@10: yading@10: Allow to store the value of the expression I<expr> in an internal yading@10: variable. I<var> specifies the number of the variable where to yading@10: store the value, and it is a value ranging from 0 to 9. The function yading@10: returns the value stored in the internal variable. yading@10: Note, Variables are currently not shared between expressions. yading@10: yading@10: yading@10: =item B<tan(x)> yading@10: yading@10: Compute tangent of I<x>. yading@10: yading@10: yading@10: =item B<tanh(x)> yading@10: yading@10: Compute hyperbolic tangent of I<x>. yading@10: yading@10: yading@10: =item B<taylor(expr, x)> yading@10: yading@10: yading@10: =item B<taylor(expr, x, id)> yading@10: yading@10: Evaluate a Taylor series at I<x>, given an expression representing yading@10: the C<ld(id)>-th derivative of a function at 0. yading@10: yading@10: When the series does not converge the result is undefined. yading@10: yading@10: I<ld(id)> is used to represent the derivative order in I<expr>, yading@10: which means that the given expression will be evaluated multiple times yading@10: with various input values that the expression can access through yading@10: C<ld(id)>. If I<id> is not specified then 0 is assumed. yading@10: yading@10: Note, when you have the derivatives at y instead of 0, yading@10: C<taylor(expr, x-y)> can be used. yading@10: yading@10: yading@10: =item B<time(0)> yading@10: yading@10: Return the current (wallclock) time in seconds. yading@10: yading@10: yading@10: =item B<trunc(expr)> yading@10: yading@10: Round the value of expression I<expr> towards zero to the nearest yading@10: integer. For example, "trunc(-1.5)" is "-1.0". yading@10: yading@10: yading@10: =item B<while(cond, expr)> yading@10: yading@10: Evaluate expression I<expr> while the expression I<cond> is yading@10: non-zero, and returns the value of the last I<expr> evaluation, or yading@10: NAN if I<cond> was always false. yading@10: yading@10: =back yading@10: yading@10: yading@10: The following constants are available: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<PI> yading@10: yading@10: area of the unit disc, approximately 3.14 yading@10: yading@10: =item B<E> yading@10: yading@10: exp(1) (Euler's number), approximately 2.718 yading@10: yading@10: =item B<PHI> yading@10: yading@10: golden ratio (1+sqrt(5))/2, approximately 1.618 yading@10: yading@10: =back yading@10: yading@10: yading@10: Assuming that an expression is considered "true" if it has a non-zero yading@10: value, note that: yading@10: yading@10: C<*> works like AND yading@10: yading@10: C<+> works like OR yading@10: yading@10: For example the construct: yading@10: yading@10: if (A AND B) then C yading@10: yading@10: is equivalent to: yading@10: yading@10: if(A*B, C) yading@10: yading@10: yading@10: In your C code, you can extend the list of unary and binary functions, yading@10: and define recognized constants, so that they are available for your yading@10: expressions. yading@10: yading@10: The evaluator also recognizes the International System unit prefixes. yading@10: If 'i' is appended after the prefix, binary prefixes are used, which yading@10: are based on powers of 1024 instead of powers of 1000. yading@10: The 'B' postfix multiplies the value by 8, and can be appended after a yading@10: unit prefix or used alone. This allows using for example 'KB', 'MiB', yading@10: 'G' and 'B' as number postfix. yading@10: yading@10: The list of available International System prefixes follows, with yading@10: indication of the corresponding powers of 10 and of 2. yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<y> yading@10: yading@10: 10^-24 / 2^-80 yading@10: yading@10: =item B<z> yading@10: yading@10: 10^-21 / 2^-70 yading@10: yading@10: =item B<a> yading@10: yading@10: 10^-18 / 2^-60 yading@10: yading@10: =item B<f> yading@10: yading@10: 10^-15 / 2^-50 yading@10: yading@10: =item B<p> yading@10: yading@10: 10^-12 / 2^-40 yading@10: yading@10: =item B<n> yading@10: yading@10: 10^-9 / 2^-30 yading@10: yading@10: =item B<u> yading@10: yading@10: 10^-6 / 2^-20 yading@10: yading@10: =item B<m> yading@10: yading@10: 10^-3 / 2^-10 yading@10: yading@10: =item B<c> yading@10: yading@10: 10^-2 yading@10: yading@10: =item B<d> yading@10: yading@10: 10^-1 yading@10: yading@10: =item B<h> yading@10: yading@10: 10^2 yading@10: yading@10: =item B<k> yading@10: yading@10: 10^3 / 2^10 yading@10: yading@10: =item B<K> yading@10: yading@10: 10^3 / 2^10 yading@10: yading@10: =item B<M> yading@10: yading@10: 10^6 / 2^20 yading@10: yading@10: =item B<G> yading@10: yading@10: 10^9 / 2^30 yading@10: yading@10: =item B<T> yading@10: yading@10: 10^12 / 2^40 yading@10: yading@10: =item B<P> yading@10: yading@10: 10^15 / 2^40 yading@10: yading@10: =item B<E> yading@10: yading@10: 10^18 / 2^50 yading@10: yading@10: =item B<Z> yading@10: yading@10: 10^21 / 2^60 yading@10: yading@10: =item B<Y> yading@10: yading@10: 10^24 / 2^70 yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: yading@10: =head1 OPENCL OPTIONS yading@10: yading@10: yading@10: When FFmpeg is configured with C<--enable-opencl>, it is possible yading@10: to set the options for the global OpenCL context. yading@10: yading@10: The list of supported options follows: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<build_options> yading@10: yading@10: Set build options used to compile the registered kernels. yading@10: yading@10: See reference "OpenCL Specification Version: 1.2 chapter 5.6.4". yading@10: yading@10: yading@10: =item B<platform_idx> yading@10: yading@10: Select the index of the platform to run OpenCL code. yading@10: yading@10: The specified index must be one of the indexes in the device list yading@10: which can be obtained with C<av_opencl_get_device_list()>. yading@10: yading@10: yading@10: =item B<device_idx> yading@10: yading@10: Select the index of the device used to run OpenCL code. yading@10: yading@10: The specifed index must be one of the indexes in the device list which yading@10: can be obtained with C<av_opencl_get_device_list()>. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: yading@10: =head1 CODEC OPTIONS yading@10: yading@10: yading@10: libavcodec provides some generic global options, which can be set on yading@10: all the encoders and decoders. In addition each codec may support yading@10: so-called private options, which are specific for a given codec. yading@10: yading@10: Sometimes, a global option may only affect a specific kind of codec, yading@10: and may be unsensical or ignored by another, so you need to be aware yading@10: of the meaning of the specified options. Also some options are yading@10: meant only for decoding or encoding. yading@10: yading@10: Options may be set by specifying -I<option> I<value> in the yading@10: FFmpeg tools, or by setting the value explicitly in the yading@10: C<AVCodecContext> options or using the F<libavutil/opt.h> API yading@10: for programmatic use. yading@10: yading@10: The list of supported options follow: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<b> I<integer> B<(>I<encoding,audio,video>B<)> yading@10: yading@10: Set bitrate in bits/s. Default value is 200K. yading@10: yading@10: yading@10: =item B<ab> I<integer> B<(>I<encoding,audio>B<)> yading@10: yading@10: Set audio bitrate (in bits/s). Default value is 128K. yading@10: yading@10: yading@10: =item B<bt> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set video bitrate tolerance (in bits/s). In 1-pass mode, bitrate yading@10: tolerance specifies how far ratecontrol is willing to deviate from the yading@10: target average bitrate value. This is not related to min/max yading@10: bitrate. Lowering tolerance too much has an adverse effect on quality. yading@10: yading@10: yading@10: =item B<flags> I<flags> B<(>I<decoding/encoding,audio,video,subtitles>B<)> yading@10: yading@10: Set generic flags. yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<mv4> yading@10: yading@10: Use four motion vector by macroblock (mpeg4). yading@10: yading@10: =item B<qpel> yading@10: yading@10: Use 1/4 pel motion compensation. yading@10: yading@10: =item B<loop> yading@10: yading@10: Use loop filter. yading@10: yading@10: =item B<qscale> yading@10: yading@10: Use fixed qscale. yading@10: yading@10: =item B<gmc> yading@10: yading@10: Use gmc. yading@10: yading@10: =item B<mv0> yading@10: yading@10: Always try a mb with mv=E<lt>0,0E<gt>. yading@10: yading@10: =item B<input_preserved> yading@10: yading@10: yading@10: yading@10: =item B<pass1> yading@10: yading@10: Use internal 2pass ratecontrol in first pass mode. yading@10: yading@10: =item B<pass2> yading@10: yading@10: Use internal 2pass ratecontrol in second pass mode. yading@10: yading@10: =item B<gray> yading@10: yading@10: Only decode/encode grayscale. yading@10: yading@10: =item B<emu_edge> yading@10: yading@10: Do not draw edges. yading@10: yading@10: =item B<psnr> yading@10: yading@10: Set error[?] variables during encoding. yading@10: yading@10: =item B<truncated> yading@10: yading@10: yading@10: yading@10: =item B<naq> yading@10: yading@10: Normalize adaptive quantization. yading@10: yading@10: =item B<ildct> yading@10: yading@10: Use interlaced DCT. yading@10: yading@10: =item B<low_delay> yading@10: yading@10: Force low delay. yading@10: yading@10: =item B<global_header> yading@10: yading@10: Place global headers in extradata instead of every keyframe. yading@10: yading@10: =item B<bitexact> yading@10: yading@10: Use only bitexact stuff (except (I)DCT). yading@10: yading@10: =item B<aic> yading@10: yading@10: Apply H263 advanced intra coding / mpeg4 ac prediction. yading@10: yading@10: =item B<cbp> yading@10: yading@10: Deprecated, use mpegvideo private options instead. yading@10: yading@10: =item B<qprd> yading@10: yading@10: Deprecated, use mpegvideo private options instead. yading@10: yading@10: =item B<ilme> yading@10: yading@10: Apply interlaced motion estimation. yading@10: yading@10: =item B<cgop> yading@10: yading@10: Use closed gop. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<sub_id> I<integer> yading@10: yading@10: Deprecated, currently unused. yading@10: yading@10: yading@10: =item B<me_method> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set motion estimation method. yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<zero> yading@10: yading@10: zero motion estimation (fastest) yading@10: yading@10: =item B<full> yading@10: yading@10: full motion estimation (slowest) yading@10: yading@10: =item B<epzs> yading@10: yading@10: EPZS motion estimation (default) yading@10: yading@10: =item B<esa> yading@10: yading@10: esa motion estimation (alias for full) yading@10: yading@10: =item B<tesa> yading@10: yading@10: tesa motion estimation yading@10: yading@10: =item B<dia> yading@10: yading@10: dia motion estimation (alias for epzs) yading@10: yading@10: =item B<log> yading@10: yading@10: log motion estimation yading@10: yading@10: =item B<phods> yading@10: yading@10: phods motion estimation yading@10: yading@10: =item B<x1> yading@10: yading@10: X1 motion estimation yading@10: yading@10: =item B<hex> yading@10: yading@10: hex motion estimation yading@10: yading@10: =item B<umh> yading@10: yading@10: umh motion estimation yading@10: yading@10: =item B<iter> yading@10: yading@10: iter motion estimation yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<extradata_size> I<integer> yading@10: yading@10: Set extradata size. yading@10: yading@10: yading@10: =item B<time_base> I<rational number> yading@10: yading@10: Set codec time base. yading@10: yading@10: It is the fundamental unit of time (in seconds) in terms of which yading@10: frame timestamps are represented. For fixed-fps content, timebase yading@10: should be C<1 / frame_rate> and timestamp increments should be yading@10: identically 1. yading@10: yading@10: yading@10: =item B<g> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set the group of picture size. Default value is 12. yading@10: yading@10: yading@10: =item B<ar> I<integer> B<(>I<decoding/encoding,audio>B<)> yading@10: yading@10: Set audio sampling rate (in Hz). yading@10: yading@10: yading@10: =item B<ac> I<integer> B<(>I<decoding/encoding,audio>B<)> yading@10: yading@10: Set number of audio channels. yading@10: yading@10: yading@10: =item B<cutoff> I<integer> B<(>I<encoding,audio>B<)> yading@10: yading@10: Set cutoff bandwidth. yading@10: yading@10: yading@10: =item B<frame_size> I<integer> B<(>I<encoding,audio>B<)> yading@10: yading@10: Set audio frame size. yading@10: yading@10: Each submitted frame except the last must contain exactly frame_size yading@10: samples per channel. May be 0 when the codec has yading@10: CODEC_CAP_VARIABLE_FRAME_SIZE set, in that case the frame size is not yading@10: restricted. It is set by some decoders to indicate constant frame yading@10: size. yading@10: yading@10: yading@10: =item B<frame_number> I<integer> yading@10: yading@10: Set the frame number. yading@10: yading@10: yading@10: =item B<delay> I<integer> yading@10: yading@10: yading@10: yading@10: =item B<qcomp> I<float> B<(>I<encoding,video>B<)> yading@10: yading@10: Set video quantizer scale compression (VBR). It is used as a constant yading@10: in the ratecontrol equation. Recommended range for default rc_eq: yading@10: 0.0-1.0. yading@10: yading@10: yading@10: =item B<qblur> I<float> B<(>I<encoding,video>B<)> yading@10: yading@10: Set video quantizer scale blur (VBR). yading@10: yading@10: yading@10: =item B<qmin> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set min video quantizer scale (VBR). Must be included between -1 and yading@10: 69, default value is 2. yading@10: yading@10: yading@10: =item B<qmax> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set max video quantizer scale (VBR). Must be included between -1 and yading@10: 1024, default value is 31. yading@10: yading@10: yading@10: =item B<qdiff> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set max difference between the quantizer scale (VBR). yading@10: yading@10: yading@10: =item B<bf> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set max number of B frames. yading@10: yading@10: yading@10: =item B<b_qfactor> I<float> B<(>I<encoding,video>B<)> yading@10: yading@10: Set qp factor between P and B frames. yading@10: yading@10: yading@10: =item B<rc_strategy> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set ratecontrol method. yading@10: yading@10: yading@10: =item B<b_strategy> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set strategy to choose between I/P/B-frames. yading@10: yading@10: yading@10: =item B<ps> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set RTP payload size in bytes. yading@10: yading@10: yading@10: =item B<mv_bits> I<integer> yading@10: yading@10: yading@10: =item B<header_bits> I<integer> yading@10: yading@10: yading@10: =item B<i_tex_bits> I<integer> yading@10: yading@10: yading@10: =item B<p_tex_bits> I<integer> yading@10: yading@10: yading@10: =item B<i_count> I<integer> yading@10: yading@10: yading@10: =item B<p_count> I<integer> yading@10: yading@10: yading@10: =item B<skip_count> I<integer> yading@10: yading@10: yading@10: =item B<misc_bits> I<integer> yading@10: yading@10: yading@10: =item B<frame_bits> I<integer> yading@10: yading@10: yading@10: =item B<codec_tag> I<integer> yading@10: yading@10: yading@10: =item B<bug> I<flags> B<(>I<decoding,video>B<)> yading@10: yading@10: Workaround not auto detected encoder bugs. yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<autodetect> yading@10: yading@10: yading@10: yading@10: =item B<old_msmpeg4> yading@10: yading@10: some old lavc generated msmpeg4v3 files (no autodetection) yading@10: yading@10: =item B<xvid_ilace> yading@10: yading@10: Xvid interlacing bug (autodetected if fourcc==XVIX) yading@10: yading@10: =item B<ump4> yading@10: yading@10: (autodetected if fourcc==UMP4) yading@10: yading@10: =item B<no_padding> yading@10: yading@10: padding bug (autodetected) yading@10: yading@10: =item B<amv> yading@10: yading@10: yading@10: yading@10: =item B<ac_vlc> yading@10: yading@10: illegal vlc bug (autodetected per fourcc) yading@10: yading@10: =item B<qpel_chroma> yading@10: yading@10: yading@10: yading@10: =item B<std_qpel> yading@10: yading@10: old standard qpel (autodetected per fourcc/version) yading@10: yading@10: =item B<qpel_chroma2> yading@10: yading@10: yading@10: yading@10: =item B<direct_blocksize> yading@10: yading@10: direct-qpel-blocksize bug (autodetected per fourcc/version) yading@10: yading@10: =item B<edge> yading@10: yading@10: edge padding bug (autodetected per fourcc/version) yading@10: yading@10: =item B<hpel_chroma> yading@10: yading@10: yading@10: yading@10: =item B<dc_clip> yading@10: yading@10: yading@10: yading@10: =item B<ms> yading@10: yading@10: Workaround various bugs in microsoft broken decoders. yading@10: yading@10: =item B<trunc> yading@10: yading@10: trancated frames yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<lelim> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set single coefficient elimination threshold for luminance (negative yading@10: values also consider DC coefficient). yading@10: yading@10: yading@10: =item B<celim> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set single coefficient elimination threshold for chrominance (negative yading@10: values also consider dc coefficient) yading@10: yading@10: yading@10: =item B<strict> I<integer> B<(>I<decoding/encoding,audio,video>B<)> yading@10: yading@10: Specify how strictly to follow the standards. yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<very> yading@10: yading@10: strictly conform to a older more strict version of the spec or reference software yading@10: yading@10: =item B<strict> yading@10: yading@10: strictly conform to all the things in the spec no matter what consequences yading@10: yading@10: =item B<normal> yading@10: yading@10: yading@10: yading@10: =item B<unofficial> yading@10: yading@10: allow unofficial extensions yading@10: yading@10: =item B<experimental> yading@10: yading@10: allow non standardized experimental things yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<b_qoffset> I<float> B<(>I<encoding,video>B<)> yading@10: yading@10: Set QP offset between P and B frames. yading@10: yading@10: yading@10: =item B<err_detect> I<flags> B<(>I<decoding,audio,video>B<)> yading@10: yading@10: Set error detection flags. yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<crccheck> yading@10: yading@10: verify embedded CRCs yading@10: yading@10: =item B<bitstream> yading@10: yading@10: detect bitstream specification deviations yading@10: yading@10: =item B<buffer> yading@10: yading@10: detect improper bitstream length yading@10: yading@10: =item B<explode> yading@10: yading@10: abort decoding on minor error detection yading@10: yading@10: =item B<careful> yading@10: yading@10: consider things that violate the spec and have not been seen in the wild as errors yading@10: yading@10: =item B<compliant> yading@10: yading@10: consider all spec non compliancies as errors yading@10: yading@10: =item B<aggressive> yading@10: yading@10: consider things that a sane encoder should not do as an error yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<has_b_frames> I<integer> yading@10: yading@10: yading@10: yading@10: =item B<block_align> I<integer> yading@10: yading@10: yading@10: yading@10: =item B<mpeg_quant> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Use MPEG quantizers instead of H.263. yading@10: yading@10: yading@10: =item B<qsquish> I<float> B<(>I<encoding,video>B<)> yading@10: yading@10: How to keep quantizer between qmin and qmax (0 = clip, 1 = use yading@10: differentiable function). yading@10: yading@10: yading@10: =item B<rc_qmod_amp> I<float> B<(>I<encoding,video>B<)> yading@10: yading@10: Set experimental quantizer modulation. yading@10: yading@10: yading@10: =item B<rc_qmod_freq> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set experimental quantizer modulation. yading@10: yading@10: yading@10: =item B<rc_override_count> I<integer> yading@10: yading@10: yading@10: yading@10: =item B<rc_eq> I<string> B<(>I<encoding,video>B<)> yading@10: yading@10: Set rate control equation. When computing the expression, besides the yading@10: standard functions defined in the section 'Expression Evaluation', the yading@10: following functions are available: bits2qp(bits), qp2bits(qp). Also yading@10: the following constants are available: iTex pTex tex mv fCode iCount yading@10: mcVar var isI isP isB avgQP qComp avgIITex avgPITex avgPPTex avgBPTex yading@10: avgTex. yading@10: yading@10: yading@10: =item B<maxrate> I<integer> B<(>I<encoding,audio,video>B<)> yading@10: yading@10: Set max bitrate tolerance (in bits/s). Requires bufsize to be set. yading@10: yading@10: yading@10: =item B<minrate> I<integer> B<(>I<encoding,audio,video>B<)> yading@10: yading@10: Set min bitrate tolerance (in bits/s). Most useful in setting up a CBR yading@10: encode. It is of little use elsewise. yading@10: yading@10: yading@10: =item B<bufsize> I<integer> B<(>I<encoding,audio,video>B<)> yading@10: yading@10: Set ratecontrol buffer size (in bits). yading@10: yading@10: yading@10: =item B<rc_buf_aggressivity> I<float> B<(>I<encoding,video>B<)> yading@10: yading@10: Currently useless. yading@10: yading@10: yading@10: =item B<i_qfactor> I<float> B<(>I<encoding,video>B<)> yading@10: yading@10: Set QP factor between P and I frames. yading@10: yading@10: yading@10: =item B<i_qoffset> I<float> B<(>I<encoding,video>B<)> yading@10: yading@10: Set QP offset between P and I frames. yading@10: yading@10: yading@10: =item B<rc_init_cplx> I<float> B<(>I<encoding,video>B<)> yading@10: yading@10: Set initial complexity for 1-pass encoding. yading@10: yading@10: yading@10: =item B<dct> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set DCT algorithm. yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<auto> yading@10: yading@10: autoselect a good one (default) yading@10: yading@10: =item B<fastint> yading@10: yading@10: fast integer yading@10: yading@10: =item B<int> yading@10: yading@10: accurate integer yading@10: yading@10: =item B<mmx> yading@10: yading@10: yading@10: yading@10: =item B<altivec> yading@10: yading@10: yading@10: yading@10: =item B<faan> yading@10: yading@10: floating point AAN DCT yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<lumi_mask> I<float> B<(>I<encoding,video>B<)> yading@10: yading@10: Compress bright areas stronger than medium ones. yading@10: yading@10: yading@10: =item B<tcplx_mask> I<float> B<(>I<encoding,video>B<)> yading@10: yading@10: Set temporal complexity masking. yading@10: yading@10: yading@10: =item B<scplx_mask> I<float> B<(>I<encoding,video>B<)> yading@10: yading@10: Set spatial complexity masking. yading@10: yading@10: yading@10: =item B<p_mask> I<float> B<(>I<encoding,video>B<)> yading@10: yading@10: Set inter masking. yading@10: yading@10: yading@10: =item B<dark_mask> I<float> B<(>I<encoding,video>B<)> yading@10: yading@10: Compress dark areas stronger than medium ones. yading@10: yading@10: yading@10: =item B<idct> I<integer> B<(>I<decoding/encoding,video>B<)> yading@10: yading@10: Select IDCT implementation. yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<auto> yading@10: yading@10: yading@10: yading@10: =item B<int> yading@10: yading@10: yading@10: yading@10: =item B<simple> yading@10: yading@10: yading@10: yading@10: =item B<simplemmx> yading@10: yading@10: yading@10: yading@10: =item B<libmpeg2mmx> yading@10: yading@10: yading@10: yading@10: =item B<mmi> yading@10: yading@10: yading@10: yading@10: =item B<arm> yading@10: yading@10: yading@10: yading@10: =item B<altivec> yading@10: yading@10: yading@10: yading@10: =item B<sh4> yading@10: yading@10: yading@10: yading@10: =item B<simplearm> yading@10: yading@10: yading@10: yading@10: =item B<simplearmv5te> yading@10: yading@10: yading@10: yading@10: =item B<simplearmv6> yading@10: yading@10: yading@10: yading@10: =item B<simpleneon> yading@10: yading@10: yading@10: yading@10: =item B<simplealpha> yading@10: yading@10: yading@10: yading@10: =item B<h264> yading@10: yading@10: yading@10: yading@10: =item B<vp3> yading@10: yading@10: yading@10: yading@10: =item B<ipp> yading@10: yading@10: yading@10: yading@10: =item B<xvidmmx> yading@10: yading@10: yading@10: yading@10: =item B<faani> yading@10: yading@10: floating point AAN IDCT yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<slice_count> I<integer> yading@10: yading@10: yading@10: yading@10: =item B<ec> I<flags> B<(>I<decoding,video>B<)> yading@10: yading@10: Set error concealment strategy. yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<guess_mvs> yading@10: yading@10: iterative motion vector (MV) search (slow) yading@10: yading@10: =item B<deblock> yading@10: yading@10: use strong deblock filter for damaged MBs yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<bits_per_coded_sample> I<integer> yading@10: yading@10: yading@10: yading@10: =item B<pred> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set prediction method. yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<left> yading@10: yading@10: yading@10: yading@10: =item B<plane> yading@10: yading@10: yading@10: yading@10: =item B<median> yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<aspect> I<rational number> B<(>I<encoding,video>B<)> yading@10: yading@10: Set sample aspect ratio. yading@10: yading@10: yading@10: =item B<debug> I<flags> B<(>I<decoding/encoding,audio,video,subtitles>B<)> yading@10: yading@10: Print specific debug info. yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<pict> yading@10: yading@10: picture info yading@10: yading@10: =item B<rc> yading@10: yading@10: rate control yading@10: yading@10: =item B<bitstream> yading@10: yading@10: yading@10: yading@10: =item B<mb_type> yading@10: yading@10: macroblock (MB) type yading@10: yading@10: =item B<qp> yading@10: yading@10: per-block quantization parameter (QP) yading@10: yading@10: =item B<mv> yading@10: yading@10: motion vector yading@10: yading@10: =item B<dct_coeff> yading@10: yading@10: yading@10: yading@10: =item B<skip> yading@10: yading@10: yading@10: yading@10: =item B<startcode> yading@10: yading@10: yading@10: yading@10: =item B<pts> yading@10: yading@10: yading@10: yading@10: =item B<er> yading@10: yading@10: error recognition yading@10: yading@10: =item B<mmco> yading@10: yading@10: memory management control operations (H.264) yading@10: yading@10: =item B<bugs> yading@10: yading@10: yading@10: yading@10: =item B<vis_qp> yading@10: yading@10: visualize quantization parameter (QP), lower QP are tinted greener yading@10: yading@10: =item B<vis_mb_type> yading@10: yading@10: visualize block types yading@10: yading@10: =item B<buffers> yading@10: yading@10: picture buffer allocations yading@10: yading@10: =item B<thread_ops> yading@10: yading@10: threading operations yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<vismv> I<integer> B<(>I<decoding,video>B<)> yading@10: yading@10: Visualize motion vectors (MVs). yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<pf> yading@10: yading@10: forward predicted MVs of P-frames yading@10: yading@10: =item B<bf> yading@10: yading@10: forward predicted MVs of B-frames yading@10: yading@10: =item B<bb> yading@10: yading@10: backward predicted MVs of B-frames yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<cmp> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set full pel me compare function. yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<sad> yading@10: yading@10: sum of absolute differences, fast (default) yading@10: yading@10: =item B<sse> yading@10: yading@10: sum of squared errors yading@10: yading@10: =item B<satd> yading@10: yading@10: sum of absolute Hadamard transformed differences yading@10: yading@10: =item B<dct> yading@10: yading@10: sum of absolute DCT transformed differences yading@10: yading@10: =item B<psnr> yading@10: yading@10: sum of squared quantization errors (avoid, low quality) yading@10: yading@10: =item B<bit> yading@10: yading@10: number of bits needed for the block yading@10: yading@10: =item B<rd> yading@10: yading@10: rate distortion optimal, slow yading@10: yading@10: =item B<zero> yading@10: yading@10: 0 yading@10: yading@10: =item B<vsad> yading@10: yading@10: sum of absolute vertical differences yading@10: yading@10: =item B<vsse> yading@10: yading@10: sum of squared vertical differences yading@10: yading@10: =item B<nsse> yading@10: yading@10: noise preserving sum of squared differences yading@10: yading@10: =item B<w53> yading@10: yading@10: 5/3 wavelet, only used in snow yading@10: yading@10: =item B<w97> yading@10: yading@10: 9/7 wavelet, only used in snow yading@10: yading@10: =item B<dctmax> yading@10: yading@10: yading@10: yading@10: =item B<chroma> yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<subcmp> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set sub pel me compare function. yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<sad> yading@10: yading@10: sum of absolute differences, fast (default) yading@10: yading@10: =item B<sse> yading@10: yading@10: sum of squared errors yading@10: yading@10: =item B<satd> yading@10: yading@10: sum of absolute Hadamard transformed differences yading@10: yading@10: =item B<dct> yading@10: yading@10: sum of absolute DCT transformed differences yading@10: yading@10: =item B<psnr> yading@10: yading@10: sum of squared quantization errors (avoid, low quality) yading@10: yading@10: =item B<bit> yading@10: yading@10: number of bits needed for the block yading@10: yading@10: =item B<rd> yading@10: yading@10: rate distortion optimal, slow yading@10: yading@10: =item B<zero> yading@10: yading@10: 0 yading@10: yading@10: =item B<vsad> yading@10: yading@10: sum of absolute vertical differences yading@10: yading@10: =item B<vsse> yading@10: yading@10: sum of squared vertical differences yading@10: yading@10: =item B<nsse> yading@10: yading@10: noise preserving sum of squared differences yading@10: yading@10: =item B<w53> yading@10: yading@10: 5/3 wavelet, only used in snow yading@10: yading@10: =item B<w97> yading@10: yading@10: 9/7 wavelet, only used in snow yading@10: yading@10: =item B<dctmax> yading@10: yading@10: yading@10: yading@10: =item B<chroma> yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<mbcmp> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set macroblock compare function. yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<sad> yading@10: yading@10: sum of absolute differences, fast (default) yading@10: yading@10: =item B<sse> yading@10: yading@10: sum of squared errors yading@10: yading@10: =item B<satd> yading@10: yading@10: sum of absolute Hadamard transformed differences yading@10: yading@10: =item B<dct> yading@10: yading@10: sum of absolute DCT transformed differences yading@10: yading@10: =item B<psnr> yading@10: yading@10: sum of squared quantization errors (avoid, low quality) yading@10: yading@10: =item B<bit> yading@10: yading@10: number of bits needed for the block yading@10: yading@10: =item B<rd> yading@10: yading@10: rate distortion optimal, slow yading@10: yading@10: =item B<zero> yading@10: yading@10: 0 yading@10: yading@10: =item B<vsad> yading@10: yading@10: sum of absolute vertical differences yading@10: yading@10: =item B<vsse> yading@10: yading@10: sum of squared vertical differences yading@10: yading@10: =item B<nsse> yading@10: yading@10: noise preserving sum of squared differences yading@10: yading@10: =item B<w53> yading@10: yading@10: 5/3 wavelet, only used in snow yading@10: yading@10: =item B<w97> yading@10: yading@10: 9/7 wavelet, only used in snow yading@10: yading@10: =item B<dctmax> yading@10: yading@10: yading@10: yading@10: =item B<chroma> yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<ildctcmp> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set interlaced dct compare function. yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<sad> yading@10: yading@10: sum of absolute differences, fast (default) yading@10: yading@10: =item B<sse> yading@10: yading@10: sum of squared errors yading@10: yading@10: =item B<satd> yading@10: yading@10: sum of absolute Hadamard transformed differences yading@10: yading@10: =item B<dct> yading@10: yading@10: sum of absolute DCT transformed differences yading@10: yading@10: =item B<psnr> yading@10: yading@10: sum of squared quantization errors (avoid, low quality) yading@10: yading@10: =item B<bit> yading@10: yading@10: number of bits needed for the block yading@10: yading@10: =item B<rd> yading@10: yading@10: rate distortion optimal, slow yading@10: yading@10: =item B<zero> yading@10: yading@10: 0 yading@10: yading@10: =item B<vsad> yading@10: yading@10: sum of absolute vertical differences yading@10: yading@10: =item B<vsse> yading@10: yading@10: sum of squared vertical differences yading@10: yading@10: =item B<nsse> yading@10: yading@10: noise preserving sum of squared differences yading@10: yading@10: =item B<w53> yading@10: yading@10: 5/3 wavelet, only used in snow yading@10: yading@10: =item B<w97> yading@10: yading@10: 9/7 wavelet, only used in snow yading@10: yading@10: =item B<dctmax> yading@10: yading@10: yading@10: yading@10: =item B<chroma> yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<dia_size> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set diamond type & size for motion estimation. yading@10: yading@10: yading@10: =item B<last_pred> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set amount of motion predictors from the previous frame. yading@10: yading@10: yading@10: =item B<preme> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set pre motion estimation. yading@10: yading@10: yading@10: =item B<precmp> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set pre motion estimation compare function. yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<sad> yading@10: yading@10: sum of absolute differences, fast (default) yading@10: yading@10: =item B<sse> yading@10: yading@10: sum of squared errors yading@10: yading@10: =item B<satd> yading@10: yading@10: sum of absolute Hadamard transformed differences yading@10: yading@10: =item B<dct> yading@10: yading@10: sum of absolute DCT transformed differences yading@10: yading@10: =item B<psnr> yading@10: yading@10: sum of squared quantization errors (avoid, low quality) yading@10: yading@10: =item B<bit> yading@10: yading@10: number of bits needed for the block yading@10: yading@10: =item B<rd> yading@10: yading@10: rate distortion optimal, slow yading@10: yading@10: =item B<zero> yading@10: yading@10: 0 yading@10: yading@10: =item B<vsad> yading@10: yading@10: sum of absolute vertical differences yading@10: yading@10: =item B<vsse> yading@10: yading@10: sum of squared vertical differences yading@10: yading@10: =item B<nsse> yading@10: yading@10: noise preserving sum of squared differences yading@10: yading@10: =item B<w53> yading@10: yading@10: 5/3 wavelet, only used in snow yading@10: yading@10: =item B<w97> yading@10: yading@10: 9/7 wavelet, only used in snow yading@10: yading@10: =item B<dctmax> yading@10: yading@10: yading@10: yading@10: =item B<chroma> yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<pre_dia_size> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set diamond type & size for motion estimation pre-pass. yading@10: yading@10: yading@10: =item B<subq> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set sub pel motion estimation quality. yading@10: yading@10: yading@10: =item B<dtg_active_format> I<integer> yading@10: yading@10: yading@10: yading@10: =item B<me_range> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set limit motion vectors range (1023 for DivX player). yading@10: yading@10: yading@10: =item B<ibias> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set intra quant bias. yading@10: yading@10: yading@10: =item B<pbias> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set inter quant bias. yading@10: yading@10: yading@10: =item B<color_table_id> I<integer> yading@10: yading@10: yading@10: yading@10: =item B<global_quality> I<integer> B<(>I<encoding,audio,video>B<)> yading@10: yading@10: yading@10: yading@10: =item B<coder> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<vlc> yading@10: yading@10: variable length coder / huffman coder yading@10: yading@10: =item B<ac> yading@10: yading@10: arithmetic coder yading@10: yading@10: =item B<raw> yading@10: yading@10: raw (no encoding) yading@10: yading@10: =item B<rle> yading@10: yading@10: run-length coder yading@10: yading@10: =item B<deflate> yading@10: yading@10: deflate-based coder yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<context> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set context model. yading@10: yading@10: yading@10: =item B<slice_flags> I<integer> yading@10: yading@10: yading@10: yading@10: =item B<xvmc_acceleration> I<integer> yading@10: yading@10: yading@10: yading@10: =item B<mbd> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set macroblock decision algorithm (high quality mode). yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<simple> yading@10: yading@10: use mbcmp (default) yading@10: yading@10: =item B<bits> yading@10: yading@10: use fewest bits yading@10: yading@10: =item B<rd> yading@10: yading@10: use best rate distortion yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<stream_codec_tag> I<integer> yading@10: yading@10: yading@10: yading@10: =item B<sc_threshold> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set scene change threshold. yading@10: yading@10: yading@10: =item B<lmin> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set min lagrange factor (VBR). yading@10: yading@10: yading@10: =item B<lmax> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set max lagrange factor (VBR). yading@10: yading@10: yading@10: =item B<nr> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set noise reduction. yading@10: yading@10: yading@10: =item B<rc_init_occupancy> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set number of bits which should be loaded into the rc buffer before yading@10: decoding starts. yading@10: yading@10: yading@10: =item B<inter_threshold> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: yading@10: yading@10: =item B<flags2> I<flags> B<(>I<decoding/encoding,audio,video>B<)> yading@10: yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<fast> yading@10: yading@10: allow non spec compliant speedup tricks yading@10: yading@10: =item B<sgop> yading@10: yading@10: Deprecated, use mpegvideo private options instead yading@10: yading@10: =item B<noout> yading@10: yading@10: skip bitstream encoding yading@10: yading@10: =item B<local_header> yading@10: yading@10: place global headers at every keyframe instead of in extradata yading@10: yading@10: =item B<chunks> yading@10: yading@10: Frame data might be split into multiple chunks yading@10: yading@10: =item B<showall> yading@10: yading@10: Show all frames before the first keyframe yading@10: yading@10: =item B<skiprd> yading@10: yading@10: Deprecated, use mpegvideo private options instead yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<error> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: yading@10: yading@10: =item B<qns> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Deprecated, use mpegvideo private options instead. yading@10: yading@10: yading@10: =item B<threads> I<integer> B<(>I<decoding/encoding,video>B<)> yading@10: yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<auto> yading@10: yading@10: detect a good number of threads yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<me_threshold> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set motion estimation threshold. yading@10: yading@10: yading@10: =item B<mb_threshold> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set macroblock threshold. yading@10: yading@10: yading@10: =item B<dc> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set intra_dc_precision. yading@10: yading@10: yading@10: =item B<nssew> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set nsse weight. yading@10: yading@10: yading@10: =item B<skip_top> I<integer> B<(>I<decoding,video>B<)> yading@10: yading@10: Set number of macroblock rows at the top which are skipped. yading@10: yading@10: yading@10: =item B<skip_bottom> I<integer> B<(>I<decoding,video>B<)> yading@10: yading@10: Set number of macroblock rows at the bottom which are skipped. yading@10: yading@10: yading@10: =item B<profile> I<integer> B<(>I<encoding,audio,video>B<)> yading@10: yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<unknown> yading@10: yading@10: yading@10: yading@10: =item B<aac_main> yading@10: yading@10: yading@10: yading@10: =item B<aac_low> yading@10: yading@10: yading@10: yading@10: =item B<aac_ssr> yading@10: yading@10: yading@10: yading@10: =item B<aac_ltp> yading@10: yading@10: yading@10: yading@10: =item B<aac_he> yading@10: yading@10: yading@10: yading@10: =item B<aac_he_v2> yading@10: yading@10: yading@10: yading@10: =item B<aac_ld> yading@10: yading@10: yading@10: yading@10: =item B<aac_eld> yading@10: yading@10: yading@10: yading@10: =item B<dts> yading@10: yading@10: yading@10: yading@10: =item B<dts_es> yading@10: yading@10: yading@10: yading@10: =item B<dts_96_24> yading@10: yading@10: yading@10: yading@10: =item B<dts_hd_hra> yading@10: yading@10: yading@10: yading@10: =item B<dts_hd_ma> yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<level> I<integer> B<(>I<encoding,audio,video>B<)> yading@10: yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<unknown> yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<lowres> I<integer> B<(>I<decoding,audio,video>B<)> yading@10: yading@10: Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions. yading@10: yading@10: yading@10: =item B<skip_threshold> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set frame skip threshold. yading@10: yading@10: yading@10: =item B<skip_factor> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set frame skip factor. yading@10: yading@10: yading@10: =item B<skip_exp> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set frame skip exponent. yading@10: yading@10: yading@10: =item B<skipcmp> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set frame skip compare function. yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<sad> yading@10: yading@10: sum of absolute differences, fast (default) yading@10: yading@10: =item B<sse> yading@10: yading@10: sum of squared errors yading@10: yading@10: =item B<satd> yading@10: yading@10: sum of absolute Hadamard transformed differences yading@10: yading@10: =item B<dct> yading@10: yading@10: sum of absolute DCT transformed differences yading@10: yading@10: =item B<psnr> yading@10: yading@10: sum of squared quantization errors (avoid, low quality) yading@10: yading@10: =item B<bit> yading@10: yading@10: number of bits needed for the block yading@10: yading@10: =item B<rd> yading@10: yading@10: rate distortion optimal, slow yading@10: yading@10: =item B<zero> yading@10: yading@10: 0 yading@10: yading@10: =item B<vsad> yading@10: yading@10: sum of absolute vertical differences yading@10: yading@10: =item B<vsse> yading@10: yading@10: sum of squared vertical differences yading@10: yading@10: =item B<nsse> yading@10: yading@10: noise preserving sum of squared differences yading@10: yading@10: =item B<w53> yading@10: yading@10: 5/3 wavelet, only used in snow yading@10: yading@10: =item B<w97> yading@10: yading@10: 9/7 wavelet, only used in snow yading@10: yading@10: =item B<dctmax> yading@10: yading@10: yading@10: yading@10: =item B<chroma> yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<border_mask> I<float> B<(>I<encoding,video>B<)> yading@10: yading@10: Increase the quantizer for macroblocks close to borders. yading@10: yading@10: yading@10: =item B<mblmin> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set min macroblock lagrange factor (VBR). yading@10: yading@10: yading@10: =item B<mblmax> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set max macroblock lagrange factor (VBR). yading@10: yading@10: yading@10: =item B<mepc> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set motion estimation bitrate penalty compensation (1.0 = 256). yading@10: yading@10: yading@10: =item B<skip_loop_filter> I<integer> B<(>I<decoding,video>B<)> yading@10: yading@10: yading@10: =item B<skip_idct> I<integer> B<(>I<decoding,video>B<)> yading@10: yading@10: yading@10: =item B<skip_frame> I<integer> B<(>I<decoding,video>B<)> yading@10: yading@10: yading@10: Make decoder discard processing depending on the frame type selected yading@10: by the option value. yading@10: yading@10: B<skip_loop_filter> skips frame loop filtering, B<skip_idct> yading@10: skips frame IDCT/dequantization, B<skip_frame> skips decoding. yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<none> yading@10: yading@10: Discard no frame. yading@10: yading@10: yading@10: =item B<default> yading@10: yading@10: Discard useless frames like 0-sized frames. yading@10: yading@10: yading@10: =item B<noref> yading@10: yading@10: Discard all non-reference frames. yading@10: yading@10: yading@10: =item B<bidir> yading@10: yading@10: Discard all bidirectional frames. yading@10: yading@10: yading@10: =item B<nokey> yading@10: yading@10: Discard all frames excepts keyframes. yading@10: yading@10: yading@10: =item B<all> yading@10: yading@10: Discard all frames. yading@10: yading@10: =back yading@10: yading@10: yading@10: Default value is B<default>. yading@10: yading@10: yading@10: =item B<bidir_refine> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Refine the two motion vectors used in bidirectional macroblocks. yading@10: yading@10: yading@10: =item B<brd_scale> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Downscale frames for dynamic B-frame decision. yading@10: yading@10: yading@10: =item B<keyint_min> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set minimum interval between IDR-frames. yading@10: yading@10: yading@10: =item B<refs> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set reference frames to consider for motion compensation. yading@10: yading@10: yading@10: =item B<chromaoffset> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set chroma qp offset from luma. yading@10: yading@10: yading@10: =item B<trellis> I<integer> B<(>I<encoding,audio,video>B<)> yading@10: yading@10: Set rate-distortion optimal quantization. yading@10: yading@10: yading@10: =item B<sc_factor> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set value multiplied by qscale for each frame and added to yading@10: scene_change_score. yading@10: yading@10: yading@10: =item B<mv0_threshold> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: yading@10: =item B<b_sensitivity> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Adjust sensitivity of b_frame_strategy 1. yading@10: yading@10: yading@10: =item B<compression_level> I<integer> B<(>I<encoding,audio,video>B<)> yading@10: yading@10: yading@10: =item B<min_prediction_order> I<integer> B<(>I<encoding,audio>B<)> yading@10: yading@10: yading@10: =item B<max_prediction_order> I<integer> B<(>I<encoding,audio>B<)> yading@10: yading@10: yading@10: =item B<timecode_frame_start> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Set GOP timecode frame start number, in non drop frame format. yading@10: yading@10: yading@10: =item B<request_channels> I<integer> B<(>I<decoding,audio>B<)> yading@10: yading@10: Set desired number of audio channels. yading@10: yading@10: yading@10: =item B<bits_per_raw_sample> I<integer> yading@10: yading@10: yading@10: =item B<channel_layout> I<integer> B<(>I<decoding/encoding,audio>B<)> yading@10: yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: =item B<request_channel_layout> I<integer> B<(>I<decoding,audio>B<)> yading@10: yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: =item B<rc_max_vbv_use> I<float> B<(>I<encoding,video>B<)> yading@10: yading@10: yading@10: =item B<rc_min_vbv_use> I<float> B<(>I<encoding,video>B<)> yading@10: yading@10: yading@10: =item B<ticks_per_frame> I<integer> B<(>I<decoding/encoding,audio,video>B<)> yading@10: yading@10: yading@10: =item B<color_primaries> I<integer> B<(>I<decoding/encoding,video>B<)> yading@10: yading@10: yading@10: =item B<color_trc> I<integer> B<(>I<decoding/encoding,video>B<)> yading@10: yading@10: yading@10: =item B<colorspace> I<integer> B<(>I<decoding/encoding,video>B<)> yading@10: yading@10: yading@10: =item B<color_range> I<integer> B<(>I<decoding/encoding,video>B<)> yading@10: yading@10: yading@10: =item B<chroma_sample_location> I<integer> B<(>I<decoding/encoding,video>B<)> yading@10: yading@10: yading@10: yading@10: =item B<log_level_offset> I<integer> yading@10: yading@10: Set the log level offset. yading@10: yading@10: yading@10: =item B<slices> I<integer> B<(>I<encoding,video>B<)> yading@10: yading@10: Number of slices, used in parallelized encoding. yading@10: yading@10: yading@10: =item B<thread_type> I<flags> B<(>I<decoding/encoding,video>B<)> yading@10: yading@10: Select multithreading type. yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<slice> yading@10: yading@10: yading@10: yading@10: =item B<frame> yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: =item B<audio_service_type> I<integer> B<(>I<encoding,audio>B<)> yading@10: yading@10: Set audio service type. yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<ma> yading@10: yading@10: Main Audio Service yading@10: yading@10: =item B<ef> yading@10: yading@10: Effects yading@10: yading@10: =item B<vi> yading@10: yading@10: Visually Impaired yading@10: yading@10: =item B<hi> yading@10: yading@10: Hearing Impaired yading@10: yading@10: =item B<di> yading@10: yading@10: Dialogue yading@10: yading@10: =item B<co> yading@10: yading@10: Commentary yading@10: yading@10: =item B<em> yading@10: yading@10: Emergency yading@10: yading@10: =item B<vo> yading@10: yading@10: Voice Over yading@10: yading@10: =item B<ka> yading@10: yading@10: Karaoke yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<request_sample_fmt> I<sample_fmt> B<(>I<decoding,audio>B<)> yading@10: yading@10: Set sample format audio decoders should prefer. Default value is yading@10: C<none>. yading@10: yading@10: yading@10: =item B<pkt_timebase> I<rational number> yading@10: yading@10: yading@10: yading@10: =item B<sub_charenc> I<encoding> B<(>I<decoding,subtitles>B<)> yading@10: yading@10: Set the input subtitles character encoding. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: yading@10: =head1 DECODERS yading@10: yading@10: yading@10: Decoders are configured elements in FFmpeg which allow the decoding of yading@10: multimedia streams. yading@10: yading@10: When you configure your FFmpeg build, all the supported native decoders yading@10: are enabled by default. Decoders requiring an external library must be enabled yading@10: manually via the corresponding C<--enable-lib> option. You can list all yading@10: available decoders using the configure option C<--list-decoders>. yading@10: yading@10: You can disable all the decoders with the configure option yading@10: C<--disable-decoders> and selectively enable / disable single decoders yading@10: with the options C<--enable-decoder=I<DECODER>> / yading@10: C<--disable-decoder=I<DECODER>>. yading@10: yading@10: The option C<-codecs> of the ff* tools will display the list of yading@10: enabled decoders. yading@10: yading@10: yading@10: yading@10: =head1 VIDEO DECODERS yading@10: yading@10: yading@10: A description of some of the currently available video decoders yading@10: follows. yading@10: yading@10: yading@10: =head2 rawvideo yading@10: yading@10: yading@10: Raw video decoder. yading@10: yading@10: This decoder decodes rawvideo streams. yading@10: yading@10: yading@10: =head3 Options yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<top> I<top_field_first> yading@10: yading@10: Specify the assumed field type of the input video. yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<-1> yading@10: yading@10: the video is assumed to be progressive (default) yading@10: yading@10: =item B<0> yading@10: yading@10: bottom-field-first is assumed yading@10: yading@10: =item B<1> yading@10: yading@10: top-field-first is assumed yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: yading@10: =head1 AUDIO DECODERS yading@10: yading@10: yading@10: yading@10: =head2 ffwavesynth yading@10: yading@10: yading@10: Internal wave synthetizer. yading@10: yading@10: This decoder generates wave patterns according to predefined sequences. Its yading@10: use is purely internal and the format of the data it accepts is not publicly yading@10: documented. yading@10: yading@10: yading@10: yading@10: =head1 SUBTITLES DECODERS yading@10: yading@10: yading@10: yading@10: =head2 dvdsub yading@10: yading@10: yading@10: This codec decodes the bitmap subtitles used in DVDs; the same subtitles can yading@10: also be found in VobSub file pairs and in some Matroska files. yading@10: yading@10: yading@10: =head3 Options yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<palette> yading@10: yading@10: Specify the global palette used by the bitmaps. When stored in VobSub, the yading@10: palette is normally specified in the index file; in Matroska, the palette is yading@10: stored in the codec extra-data in the same format as in VobSub. In DVDs, the yading@10: palette is stored in the IFO file, and therefore not available when reading yading@10: from dumped VOB files. yading@10: yading@10: The format for this option is a string containing 16 24-bits hexadecimal yading@10: numbers (without 0x prefix) separated by comas, for example C<0d00ee, yading@10: ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1, yading@10: 7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b>. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head1 ENCODERS yading@10: yading@10: yading@10: Encoders are configured elements in FFmpeg which allow the encoding of yading@10: multimedia streams. yading@10: yading@10: When you configure your FFmpeg build, all the supported native encoders yading@10: are enabled by default. Encoders requiring an external library must be enabled yading@10: manually via the corresponding C<--enable-lib> option. You can list all yading@10: available encoders using the configure option C<--list-encoders>. yading@10: yading@10: You can disable all the encoders with the configure option yading@10: C<--disable-encoders> and selectively enable / disable single encoders yading@10: with the options C<--enable-encoder=I<ENCODER>> / yading@10: C<--disable-encoder=I<ENCODER>>. yading@10: yading@10: The option C<-codecs> of the ff* tools will display the list of yading@10: enabled encoders. yading@10: yading@10: yading@10: yading@10: =head1 AUDIO ENCODERS yading@10: yading@10: yading@10: A description of some of the currently available audio encoders yading@10: follows. yading@10: yading@10: yading@10: =head2 ac3 and ac3_fixed yading@10: yading@10: yading@10: AC-3 audio encoders. yading@10: yading@10: These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as yading@10: the undocumented RealAudio 3 (a.k.a. dnet). yading@10: yading@10: The I<ac3> encoder uses floating-point math, while the I<ac3_fixed> yading@10: encoder only uses fixed-point integer math. This does not mean that one is yading@10: always faster, just that one or the other may be better suited to a yading@10: particular system. The floating-point encoder will generally produce better yading@10: quality audio for a given bitrate. The I<ac3_fixed> encoder is not the yading@10: default codec for any of the output formats, so it must be specified explicitly yading@10: using the option C<-acodec ac3_fixed> in order to use it. yading@10: yading@10: yading@10: =head3 AC-3 Metadata yading@10: yading@10: yading@10: The AC-3 metadata options are used to set parameters that describe the audio, yading@10: but in most cases do not affect the audio encoding itself. Some of the options yading@10: do directly affect or influence the decoding and playback of the resulting yading@10: bitstream, while others are just for informational purposes. A few of the yading@10: options will add bits to the output stream that could otherwise be used for yading@10: audio data, and will thus affect the quality of the output. Those will be yading@10: indicated accordingly with a note in the option list below. yading@10: yading@10: These parameters are described in detail in several publicly-available yading@10: documents. yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item *<E<lt>B<http://www.atsc.org/cms/standards/a_52-2010.pdf>E<gt>> yading@10: yading@10: yading@10: =item *<E<lt>B<http://www.atsc.org/cms/standards/a_54a_with_corr_1.pdf>E<gt>> yading@10: yading@10: yading@10: =item *<E<lt>B<http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/18_Metadata.Guide.pdf>E<gt>> yading@10: yading@10: yading@10: =item *<E<lt>B<http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/46_DDEncodingGuidelines.pdf>E<gt>> yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head4 Metadata Control Options yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<-per_frame_metadata> I<boolean> yading@10: yading@10: Allow Per-Frame Metadata. Specifies if the encoder should check for changing yading@10: metadata for each frame. yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<0> yading@10: yading@10: The metadata values set at initialization will be used for every frame in the yading@10: stream. (default) yading@10: yading@10: =item B<1> yading@10: yading@10: Metadata values can be changed before encoding each frame. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head4 Downmix Levels yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<-center_mixlev> I<level> yading@10: yading@10: Center Mix Level. The amount of gain the decoder should apply to the center yading@10: channel when downmixing to stereo. This field will only be written to the yading@10: bitstream if a center channel is present. The value is specified as a scale yading@10: factor. There are 3 valid values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<0.707> yading@10: yading@10: Apply -3dB gain yading@10: yading@10: =item B<0.595> yading@10: yading@10: Apply -4.5dB gain (default) yading@10: yading@10: =item B<0.500> yading@10: yading@10: Apply -6dB gain yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<-surround_mixlev> I<level> yading@10: yading@10: Surround Mix Level. The amount of gain the decoder should apply to the surround yading@10: channel(s) when downmixing to stereo. This field will only be written to the yading@10: bitstream if one or more surround channels are present. The value is specified yading@10: as a scale factor. There are 3 valid values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<0.707> yading@10: yading@10: Apply -3dB gain yading@10: yading@10: =item B<0.500> yading@10: yading@10: Apply -6dB gain (default) yading@10: yading@10: =item B<0.000> yading@10: yading@10: Silence Surround Channel(s) yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head4 Audio Production Information yading@10: yading@10: Audio Production Information is optional information describing the mixing yading@10: environment. Either none or both of the fields are written to the bitstream. yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<-mixing_level> I<number> yading@10: yading@10: Mixing Level. Specifies peak sound pressure level (SPL) in the production yading@10: environment when the mix was mastered. Valid values are 80 to 111, or -1 for yading@10: unknown or not indicated. The default value is -1, but that value cannot be yading@10: used if the Audio Production Information is written to the bitstream. Therefore, yading@10: if the C<room_type> option is not the default value, the C<mixing_level> yading@10: option must not be -1. yading@10: yading@10: yading@10: =item B<-room_type> I<type> yading@10: yading@10: Room Type. Describes the equalization used during the final mixing session at yading@10: the studio or on the dubbing stage. A large room is a dubbing stage with the yading@10: industry standard X-curve equalization; a small room has flat equalization. yading@10: This field will not be written to the bitstream if both the C<mixing_level> yading@10: option and the C<room_type> option have the default values. yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<0> yading@10: yading@10: yading@10: =item B<notindicated> yading@10: yading@10: Not Indicated (default) yading@10: yading@10: =item B<1> yading@10: yading@10: yading@10: =item B<large> yading@10: yading@10: Large Room yading@10: yading@10: =item B<2> yading@10: yading@10: yading@10: =item B<small> yading@10: yading@10: Small Room yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head4 Other Metadata Options yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<-copyright> I<boolean> yading@10: yading@10: Copyright Indicator. Specifies whether a copyright exists for this audio. yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<0> yading@10: yading@10: yading@10: =item B<off> yading@10: yading@10: No Copyright Exists (default) yading@10: yading@10: =item B<1> yading@10: yading@10: yading@10: =item B<on> yading@10: yading@10: Copyright Exists yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<-dialnorm> I<value> yading@10: yading@10: Dialogue Normalization. Indicates how far the average dialogue level of the yading@10: program is below digital 100% full scale (0 dBFS). This parameter determines a yading@10: level shift during audio reproduction that sets the average volume of the yading@10: dialogue to a preset level. The goal is to match volume level between program yading@10: sources. A value of -31dB will result in no volume level change, relative to yading@10: the source volume, during audio reproduction. Valid values are whole numbers in yading@10: the range -31 to -1, with -31 being the default. yading@10: yading@10: yading@10: =item B<-dsur_mode> I<mode> yading@10: yading@10: Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround yading@10: (Pro Logic). This field will only be written to the bitstream if the audio yading@10: stream is stereo. Using this option does B<NOT> mean the encoder will actually yading@10: apply Dolby Surround processing. yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<0> yading@10: yading@10: yading@10: =item B<notindicated> yading@10: yading@10: Not Indicated (default) yading@10: yading@10: =item B<1> yading@10: yading@10: yading@10: =item B<off> yading@10: yading@10: Not Dolby Surround Encoded yading@10: yading@10: =item B<2> yading@10: yading@10: yading@10: =item B<on> yading@10: yading@10: Dolby Surround Encoded yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<-original> I<boolean> yading@10: yading@10: Original Bit Stream Indicator. Specifies whether this audio is from the yading@10: original source and not a copy. yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<0> yading@10: yading@10: yading@10: =item B<off> yading@10: yading@10: Not Original Source yading@10: yading@10: =item B<1> yading@10: yading@10: yading@10: =item B<on> yading@10: yading@10: Original Source (default) yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Extended Bitstream Information yading@10: yading@10: The extended bitstream options are part of the Alternate Bit Stream Syntax as yading@10: specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts. yading@10: If any one parameter in a group is specified, all values in that group will be yading@10: written to the bitstream. Default values are used for those that are written yading@10: but have not been specified. If the mixing levels are written, the decoder yading@10: will use these values instead of the ones specified in the C<center_mixlev> yading@10: and C<surround_mixlev> options if it supports the Alternate Bit Stream yading@10: Syntax. yading@10: yading@10: yading@10: =head4 Extended Bitstream Information - Part 1 yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<-dmix_mode> I<mode> yading@10: yading@10: Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt yading@10: (Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode. yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<0> yading@10: yading@10: yading@10: =item B<notindicated> yading@10: yading@10: Not Indicated (default) yading@10: yading@10: =item B<1> yading@10: yading@10: yading@10: =item B<ltrt> yading@10: yading@10: Lt/Rt Downmix Preferred yading@10: yading@10: =item B<2> yading@10: yading@10: yading@10: =item B<loro> yading@10: yading@10: Lo/Ro Downmix Preferred yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<-ltrt_cmixlev> I<level> yading@10: yading@10: Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the yading@10: center channel when downmixing to stereo in Lt/Rt mode. yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<1.414> yading@10: yading@10: Apply +3dB gain yading@10: yading@10: =item B<1.189> yading@10: yading@10: Apply +1.5dB gain yading@10: yading@10: =item B<1.000> yading@10: yading@10: Apply 0dB gain yading@10: yading@10: =item B<0.841> yading@10: yading@10: Apply -1.5dB gain yading@10: yading@10: =item B<0.707> yading@10: yading@10: Apply -3.0dB gain yading@10: yading@10: =item B<0.595> yading@10: yading@10: Apply -4.5dB gain (default) yading@10: yading@10: =item B<0.500> yading@10: yading@10: Apply -6.0dB gain yading@10: yading@10: =item B<0.000> yading@10: yading@10: Silence Center Channel yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<-ltrt_surmixlev> I<level> yading@10: yading@10: Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the yading@10: surround channel(s) when downmixing to stereo in Lt/Rt mode. yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<0.841> yading@10: yading@10: Apply -1.5dB gain yading@10: yading@10: =item B<0.707> yading@10: yading@10: Apply -3.0dB gain yading@10: yading@10: =item B<0.595> yading@10: yading@10: Apply -4.5dB gain yading@10: yading@10: =item B<0.500> yading@10: yading@10: Apply -6.0dB gain (default) yading@10: yading@10: =item B<0.000> yading@10: yading@10: Silence Surround Channel(s) yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<-loro_cmixlev> I<level> yading@10: yading@10: Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the yading@10: center channel when downmixing to stereo in Lo/Ro mode. yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<1.414> yading@10: yading@10: Apply +3dB gain yading@10: yading@10: =item B<1.189> yading@10: yading@10: Apply +1.5dB gain yading@10: yading@10: =item B<1.000> yading@10: yading@10: Apply 0dB gain yading@10: yading@10: =item B<0.841> yading@10: yading@10: Apply -1.5dB gain yading@10: yading@10: =item B<0.707> yading@10: yading@10: Apply -3.0dB gain yading@10: yading@10: =item B<0.595> yading@10: yading@10: Apply -4.5dB gain (default) yading@10: yading@10: =item B<0.500> yading@10: yading@10: Apply -6.0dB gain yading@10: yading@10: =item B<0.000> yading@10: yading@10: Silence Center Channel yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<-loro_surmixlev> I<level> yading@10: yading@10: Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the yading@10: surround channel(s) when downmixing to stereo in Lo/Ro mode. yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<0.841> yading@10: yading@10: Apply -1.5dB gain yading@10: yading@10: =item B<0.707> yading@10: yading@10: Apply -3.0dB gain yading@10: yading@10: =item B<0.595> yading@10: yading@10: Apply -4.5dB gain yading@10: yading@10: =item B<0.500> yading@10: yading@10: Apply -6.0dB gain (default) yading@10: yading@10: =item B<0.000> yading@10: yading@10: Silence Surround Channel(s) yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head4 Extended Bitstream Information - Part 2 yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<-dsurex_mode> I<mode> yading@10: yading@10: Dolby Surround EX Mode. Indicates whether the stream uses Dolby Surround EX yading@10: (7.1 matrixed to 5.1). Using this option does B<NOT> mean the encoder will actually yading@10: apply Dolby Surround EX processing. yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<0> yading@10: yading@10: yading@10: =item B<notindicated> yading@10: yading@10: Not Indicated (default) yading@10: yading@10: =item B<1> yading@10: yading@10: yading@10: =item B<on> yading@10: yading@10: Dolby Surround EX Off yading@10: yading@10: =item B<2> yading@10: yading@10: yading@10: =item B<off> yading@10: yading@10: Dolby Surround EX On yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<-dheadphone_mode> I<mode> yading@10: yading@10: Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone yading@10: encoding (multi-channel matrixed to 2.0 for use with headphones). Using this yading@10: option does B<NOT> mean the encoder will actually apply Dolby Headphone yading@10: processing. yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<0> yading@10: yading@10: yading@10: =item B<notindicated> yading@10: yading@10: Not Indicated (default) yading@10: yading@10: =item B<1> yading@10: yading@10: yading@10: =item B<on> yading@10: yading@10: Dolby Headphone Off yading@10: yading@10: =item B<2> yading@10: yading@10: yading@10: =item B<off> yading@10: yading@10: Dolby Headphone On yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<-ad_conv_type> I<type> yading@10: yading@10: A/D Converter Type. Indicates whether the audio has passed through HDCD A/D yading@10: conversion. yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<0> yading@10: yading@10: yading@10: =item B<standard> yading@10: yading@10: Standard A/D Converter (default) yading@10: yading@10: =item B<1> yading@10: yading@10: yading@10: =item B<hdcd> yading@10: yading@10: HDCD A/D Converter yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Other AC-3 Encoding Options yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<-stereo_rematrixing> I<boolean> yading@10: yading@10: Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This yading@10: is an optional AC-3 feature that increases quality by selectively encoding yading@10: the left/right channels as mid/side. This option is enabled by default, and it yading@10: is highly recommended that it be left as enabled except for testing purposes. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Floating-Point-Only AC-3 Encoding Options yading@10: yading@10: yading@10: These options are only valid for the floating-point encoder and do not exist yading@10: for the fixed-point encoder due to the corresponding features not being yading@10: implemented in fixed-point. yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<-channel_coupling> I<boolean> yading@10: yading@10: Enables/Disables use of channel coupling, which is an optional AC-3 feature yading@10: that increases quality by combining high frequency information from multiple yading@10: channels into a single channel. The per-channel high frequency information is yading@10: sent with less accuracy in both the frequency and time domains. This allows yading@10: more bits to be used for lower frequencies while preserving enough information yading@10: to reconstruct the high frequencies. This option is enabled by default for the yading@10: floating-point encoder and should generally be left as enabled except for yading@10: testing purposes or to increase encoding speed. yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<-1> yading@10: yading@10: yading@10: =item B<auto> yading@10: yading@10: Selected by Encoder (default) yading@10: yading@10: =item B<0> yading@10: yading@10: yading@10: =item B<off> yading@10: yading@10: Disable Channel Coupling yading@10: yading@10: =item B<1> yading@10: yading@10: yading@10: =item B<on> yading@10: yading@10: Enable Channel Coupling yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<-cpl_start_band> I<number> yading@10: yading@10: Coupling Start Band. Sets the channel coupling start band, from 1 to 15. If a yading@10: value higher than the bandwidth is used, it will be reduced to 1 less than the yading@10: coupling end band. If I<auto> is used, the start band will be determined by yading@10: the encoder based on the bit rate, sample rate, and channel layout. This option yading@10: has no effect if channel coupling is disabled. yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<-1> yading@10: yading@10: yading@10: =item B<auto> yading@10: yading@10: Selected by Encoder (default) yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: yading@10: =head1 VIDEO ENCODERS yading@10: yading@10: yading@10: A description of some of the currently available video encoders yading@10: follows. yading@10: yading@10: yading@10: =head2 libtheora yading@10: yading@10: yading@10: Theora format supported through libtheora. yading@10: yading@10: Requires the presence of the libtheora headers and library during yading@10: configuration. You need to explicitly configure the build with yading@10: C<--enable-libtheora>. yading@10: yading@10: yading@10: =head3 Options yading@10: yading@10: yading@10: The following global options are mapped to internal libtheora options yading@10: which affect the quality and the bitrate of the encoded stream. yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<b> yading@10: yading@10: Set the video bitrate, only works if the C<qscale> flag in yading@10: B<flags> is not enabled. yading@10: yading@10: yading@10: =item B<flags> yading@10: yading@10: Used to enable constant quality mode encoding through the yading@10: B<qscale> flag, and to enable the C<pass1> and C<pass2> yading@10: modes. yading@10: yading@10: yading@10: =item B<g> yading@10: yading@10: Set the GOP size. yading@10: yading@10: yading@10: =item B<global_quality> yading@10: yading@10: Set the global quality in lambda units, only works if the yading@10: C<qscale> flag in B<flags> is enabled. The value is clipped yading@10: in the [0 - 10*C<FF_QP2LAMBDA>] range, and then multiplied for 6.3 yading@10: to get a value in the native libtheora range [0-63]. A higher value yading@10: corresponds to a higher quality. yading@10: yading@10: For example, to set maximum constant quality encoding with yading@10: B<ffmpeg>: yading@10: yading@10: ffmpeg -i INPUT -flags:v qscale -global_quality:v "10*QP2LAMBDA" -codec:v libtheora OUTPUT.ogg yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 libvpx yading@10: yading@10: yading@10: VP8 format supported through libvpx. yading@10: yading@10: Requires the presence of the libvpx headers and library during configuration. yading@10: You need to explicitly configure the build with C<--enable-libvpx>. yading@10: yading@10: yading@10: =head3 Options yading@10: yading@10: yading@10: Mapping from FFmpeg to libvpx options with conversion notes in parentheses. yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<threads> yading@10: yading@10: g_threads yading@10: yading@10: yading@10: =item B<profile> yading@10: yading@10: g_profile yading@10: yading@10: yading@10: =item B<vb> yading@10: yading@10: rc_target_bitrate yading@10: yading@10: yading@10: =item B<g> yading@10: yading@10: kf_max_dist yading@10: yading@10: yading@10: =item B<keyint_min> yading@10: yading@10: kf_min_dist yading@10: yading@10: yading@10: =item B<qmin> yading@10: yading@10: rc_min_quantizer yading@10: yading@10: yading@10: =item B<qmax> yading@10: yading@10: rc_max_quantizer yading@10: yading@10: yading@10: =item B<bufsize, vb> yading@10: yading@10: rc_buf_sz yading@10: C<(bufsize * 1000 / vb)> yading@10: yading@10: rc_buf_optimal_sz yading@10: C<(bufsize * 1000 / vb * 5 / 6)> yading@10: yading@10: yading@10: =item B<rc_init_occupancy, vb> yading@10: yading@10: rc_buf_initial_sz yading@10: C<(rc_init_occupancy * 1000 / vb)> yading@10: yading@10: yading@10: =item B<rc_buffer_aggressivity> yading@10: yading@10: rc_undershoot_pct yading@10: yading@10: yading@10: =item B<skip_threshold> yading@10: yading@10: rc_dropframe_thresh yading@10: yading@10: yading@10: =item B<qcomp> yading@10: yading@10: rc_2pass_vbr_bias_pct yading@10: yading@10: yading@10: =item B<maxrate, vb> yading@10: yading@10: rc_2pass_vbr_maxsection_pct yading@10: C<(maxrate * 100 / vb)> yading@10: yading@10: yading@10: =item B<minrate, vb> yading@10: yading@10: rc_2pass_vbr_minsection_pct yading@10: C<(minrate * 100 / vb)> yading@10: yading@10: yading@10: =item B<minrate, maxrate, vb> yading@10: yading@10: C<VPX_CBR> yading@10: C<(minrate == maxrate == vb)> yading@10: yading@10: yading@10: =item B<crf> yading@10: yading@10: C<VPX_CQ>, C<VP8E_SET_CQ_LEVEL> yading@10: yading@10: yading@10: =item B<quality> yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item I<best> yading@10: yading@10: C<VPX_DL_BEST_QUALITY> yading@10: yading@10: =item I<good> yading@10: yading@10: C<VPX_DL_GOOD_QUALITY> yading@10: yading@10: =item I<realtime> yading@10: yading@10: C<VPX_DL_REALTIME> yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<speed> yading@10: yading@10: C<VP8E_SET_CPUUSED> yading@10: yading@10: yading@10: =item B<nr> yading@10: yading@10: C<VP8E_SET_NOISE_SENSITIVITY> yading@10: yading@10: yading@10: =item B<mb_threshold> yading@10: yading@10: C<VP8E_SET_STATIC_THRESHOLD> yading@10: yading@10: yading@10: =item B<slices> yading@10: yading@10: C<VP8E_SET_TOKEN_PARTITIONS> yading@10: yading@10: yading@10: =item B<max-intra-rate> yading@10: yading@10: C<VP8E_SET_MAX_INTRA_BITRATE_PCT> yading@10: yading@10: yading@10: =item B<force_key_frames> yading@10: yading@10: C<VPX_EFLAG_FORCE_KF> yading@10: yading@10: yading@10: =item B<Alternate reference frame related> yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<vp8flags altref> yading@10: yading@10: C<VP8E_SET_ENABLEAUTOALTREF> yading@10: yading@10: =item I<arnr_max_frames> yading@10: yading@10: C<VP8E_SET_ARNR_MAXFRAMES> yading@10: yading@10: =item I<arnr_type> yading@10: yading@10: C<VP8E_SET_ARNR_TYPE> yading@10: yading@10: =item I<arnr_strength> yading@10: yading@10: C<VP8E_SET_ARNR_STRENGTH> yading@10: yading@10: =item I<rc_lookahead> yading@10: yading@10: g_lag_in_frames yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<vp8flags error_resilient> yading@10: yading@10: g_error_resilient yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: For more information about libvpx see: yading@10: E<lt>B<http://www.webmproject.org/>E<gt> yading@10: yading@10: yading@10: =head2 libx264 yading@10: yading@10: yading@10: x264 H.264/MPEG-4 AVC encoder wrapper yading@10: yading@10: Requires the presence of the libx264 headers and library during yading@10: configuration. You need to explicitly configure the build with yading@10: C<--enable-libx264>. yading@10: yading@10: x264 supports an impressive number of features, including 8x8 and 4x4 adaptive yading@10: spatial transform, adaptive B-frame placement, CAVLC/CABAC entropy coding, yading@10: interlacing (MBAFF), lossless mode, psy optimizations for detail retention yading@10: (adaptive quantization, psy-RD, psy-trellis). yading@10: yading@10: The FFmpeg wrapper provides a mapping for most of them using global options yading@10: that match those of the encoders and provides private options for the unique yading@10: encoder options. Additionally an expert override is provided to directly pass yading@10: a list of key=value tuples as accepted by x264_param_parse. yading@10: yading@10: yading@10: =head3 Option Mapping yading@10: yading@10: yading@10: The following options are supported by the x264 wrapper, the x264-equivalent yading@10: options follow the FFmpeg ones. yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<b : bitrate> yading@10: yading@10: FFmpeg C<b> option is expressed in bits/s, x264 C<bitrate> in kilobits/s. yading@10: yading@10: =item B<bf : bframes> yading@10: yading@10: Maximum number of B-frames. yading@10: yading@10: =item B<g : keyint> yading@10: yading@10: Maximum GOP size. yading@10: yading@10: =item B<qmin : qpmin> yading@10: yading@10: yading@10: =item B<qmax : qpmax> yading@10: yading@10: yading@10: =item B<qdiff : qpstep> yading@10: yading@10: yading@10: =item B<qblur : qblur> yading@10: yading@10: yading@10: =item B<qcomp : qcomp> yading@10: yading@10: yading@10: =item B<refs : ref> yading@10: yading@10: yading@10: =item B<sc_threshold : scenecut> yading@10: yading@10: yading@10: =item B<trellis : trellis> yading@10: yading@10: yading@10: =item B<nr : nr> yading@10: yading@10: Noise reduction. yading@10: yading@10: =item B<me_range : merange> yading@10: yading@10: yading@10: =item B<me_method : me> yading@10: yading@10: yading@10: =item B<subq : subme> yading@10: yading@10: yading@10: =item B<b_strategy : b-adapt> yading@10: yading@10: yading@10: =item B<keyint_min : keyint-min> yading@10: yading@10: yading@10: =item B<coder : cabac> yading@10: yading@10: Set coder to C<ac> to use CABAC. yading@10: yading@10: =item B<cmp : chroma-me> yading@10: yading@10: Set to C<chroma> to use chroma motion estimation. yading@10: yading@10: =item B<threads : threads> yading@10: yading@10: yading@10: =item B<thread_type : sliced_threads> yading@10: yading@10: Set to C<slice> to use sliced threading instead of frame threading. yading@10: yading@10: =item B<flags -cgop : open-gop> yading@10: yading@10: Set C<-cgop> to use recovery points to close GOPs. yading@10: yading@10: =item B<rc_init_occupancy : vbv-init> yading@10: yading@10: Initial buffer occupancy. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Private Options yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<-preset> I<string> yading@10: yading@10: Set the encoding preset (cf. x264 --fullhelp). yading@10: yading@10: =item B<-tune> I<string> yading@10: yading@10: Tune the encoding params (cf. x264 --fullhelp). yading@10: yading@10: =item B<-profile> I<string> yading@10: yading@10: Set profile restrictions (cf. x264 --fullhelp). yading@10: yading@10: =item B<-fastfirstpass> I<integer> yading@10: yading@10: Use fast settings when encoding first pass. yading@10: yading@10: =item B<-crf> I<float> yading@10: yading@10: Select the quality for constant quality mode. yading@10: yading@10: =item B<-crf_max> I<float> yading@10: yading@10: In CRF mode, prevents VBV from lowering quality beyond this point. yading@10: yading@10: =item B<-qp> I<integer> yading@10: yading@10: Constant quantization parameter rate control method. yading@10: yading@10: =item B<-aq-mode> I<integer> yading@10: yading@10: AQ method yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<none> yading@10: yading@10: yading@10: yading@10: =item B<variance> yading@10: yading@10: Variance AQ (complexity mask). yading@10: yading@10: =item B<autovariance> yading@10: yading@10: Auto-variance AQ (experimental). yading@10: yading@10: =back yading@10: yading@10: yading@10: =item B<-aq-strength> I<float> yading@10: yading@10: AQ strength, reduces blocking and blurring in flat and textured areas. yading@10: yading@10: =item B<-psy> I<integer> yading@10: yading@10: Use psychovisual optimizations. yading@10: yading@10: =item B<-psy-rd> I<string> yading@10: yading@10: Strength of psychovisual optimization, in E<lt>psy-rdE<gt>:E<lt>psy-trellisE<gt> format. yading@10: yading@10: =item B<-rc-lookahead> I<integer> yading@10: yading@10: Number of frames to look ahead for frametype and ratecontrol. yading@10: yading@10: =item B<-weightb> I<integer> yading@10: yading@10: Weighted prediction for B-frames. yading@10: yading@10: =item B<-weightp> I<integer> yading@10: yading@10: Weighted prediction analysis method. yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<none> yading@10: yading@10: yading@10: yading@10: =item B<simple> yading@10: yading@10: yading@10: yading@10: =item B<smart> yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: =item B<-ssim> I<integer> yading@10: yading@10: Calculate and print SSIM stats. yading@10: yading@10: =item B<-intra-refresh> I<integer> yading@10: yading@10: Use Periodic Intra Refresh instead of IDR frames. yading@10: yading@10: =item B<-b-bias> I<integer> yading@10: yading@10: Influences how often B-frames are used. yading@10: yading@10: =item B<-b-pyramid> I<integer> yading@10: yading@10: Keep some B-frames as references. yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<none> yading@10: yading@10: yading@10: yading@10: =item B<strict> yading@10: yading@10: Strictly hierarchical pyramid. yading@10: yading@10: =item B<normal> yading@10: yading@10: Non-strict (not Blu-ray compatible). yading@10: yading@10: =back yading@10: yading@10: yading@10: =item B<-mixed-refs> I<integer> yading@10: yading@10: One reference per partition, as opposed to one reference per macroblock. yading@10: yading@10: =item B<-8x8dct> I<integer> yading@10: yading@10: High profile 8x8 transform. yading@10: yading@10: =item B<-fast-pskip> I<integer> yading@10: yading@10: yading@10: =item B<-aud> I<integer> yading@10: yading@10: Use access unit delimiters. yading@10: yading@10: =item B<-mbtree> I<integer> yading@10: yading@10: Use macroblock tree ratecontrol. yading@10: yading@10: =item B<-deblock> I<string> yading@10: yading@10: Loop filter parameters, in E<lt>alpha:betaE<gt> form. yading@10: yading@10: =item B<-cplxblur> I<float> yading@10: yading@10: Reduce fluctuations in QP (before curve compression). yading@10: yading@10: =item B<-partitions> I<string> yading@10: yading@10: A comma-separated list of partitions to consider, possible values: p8x8, p4x4, b8x8, i8x8, i4x4, none, all. yading@10: yading@10: =item B<-direct-pred> I<integer> yading@10: yading@10: Direct MV prediction mode yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<none> yading@10: yading@10: yading@10: yading@10: =item B<spatial> yading@10: yading@10: yading@10: yading@10: =item B<temporal> yading@10: yading@10: yading@10: yading@10: =item B<auto> yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: =item B<-slice-max-size> I<integer> yading@10: yading@10: Limit the size of each slice in bytes. yading@10: yading@10: =item B<-stats> I<string> yading@10: yading@10: Filename for 2 pass stats. yading@10: yading@10: =item B<-nal-hrd> I<integer> yading@10: yading@10: Signal HRD information (requires vbv-bufsize; cbr not allowed in .mp4). yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<none> yading@10: yading@10: yading@10: yading@10: =item B<vbr> yading@10: yading@10: yading@10: yading@10: =item B<cbr> yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<x264opts> I<options> yading@10: yading@10: Allow to set any x264 option, see C<x264 --fullhelp> for a list. yading@10: yading@10: I<options> is a list of I<key>=I<value> couples separated by yading@10: ":". In I<filter> and I<psy-rd> options that use ":" as a separator yading@10: themselves, use "," instead. They accept it as well since long ago but this yading@10: is kept undocumented for some reason. yading@10: yading@10: For example to specify libx264 encoding options with B<ffmpeg>: yading@10: yading@10: ffmpeg -i foo.mpg -vcodec libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv yading@10: yading@10: yading@10: For more information about libx264 and the supported options see: yading@10: E<lt>B<http://www.videolan.org/developers/x264.html>E<gt> yading@10: yading@10: yading@10: =item B<-x264-params> I<string> yading@10: yading@10: Override the x264 configuration using a :-separated list of key=value parameters. yading@10: yading@10: -x264-params level=30:bframes=0:weightp=0:cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:no-fast-pskip=1:subq=6:8x8dct=0:trellis=0 yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: Encoding avpresets for common usages are provided so they can be used with the yading@10: general presets system (e.g. passing the C<-pre> option). yading@10: yading@10: yading@10: =head2 ProRes yading@10: yading@10: yading@10: Apple ProRes encoder. yading@10: yading@10: FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder. yading@10: The used encoder can be choosen with the C<-vcodec> option. yading@10: yading@10: yading@10: =head3 Private Options for prores-ks yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<profile> I<integer> yading@10: yading@10: Select the ProRes profile to encode yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<proxy> yading@10: yading@10: yading@10: =item B<lt> yading@10: yading@10: yading@10: =item B<standard> yading@10: yading@10: yading@10: =item B<hq> yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<quant_mat> I<integer> yading@10: yading@10: Select quantization matrix. yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<auto> yading@10: yading@10: yading@10: =item B<default> yading@10: yading@10: yading@10: =item B<proxy> yading@10: yading@10: yading@10: =item B<lt> yading@10: yading@10: yading@10: =item B<standard> yading@10: yading@10: yading@10: =item B<hq> yading@10: yading@10: yading@10: =back yading@10: yading@10: If set to I<auto>, the matrix matching the profile will be picked. yading@10: If not set, the matrix providing the highest quality, I<default>, will be yading@10: picked. yading@10: yading@10: yading@10: =item B<bits_per_mb> I<integer> yading@10: yading@10: How many bits to allot for coding one macroblock. Different profiles use yading@10: between 200 and 2400 bits per macroblock, the maximum is 8000. yading@10: yading@10: yading@10: =item B<mbs_per_slice> I<integer> yading@10: yading@10: Number of macroblocks in each slice (1-8); the default value (8) yading@10: should be good in almost all situations. yading@10: yading@10: yading@10: =item B<vendor> I<string> yading@10: yading@10: Override the 4-byte vendor ID. yading@10: A custom vendor ID like I<apl0> would claim the stream was produced by yading@10: the Apple encoder. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Speed considerations yading@10: yading@10: yading@10: In the default mode of operation the encoder has to honor frame constraints yading@10: (i.e. not produc frames with size bigger than requested) while still making yading@10: output picture as good as possible. yading@10: A frame containing a lot of small details is harder to compress and the encoder yading@10: would spend more time searching for appropriate quantizers for each slice. yading@10: yading@10: Setting a higher B<bits_per_mb> limit will improve the speed. yading@10: yading@10: For the fastest encoding speed set the B<qscale> parameter (4 is the yading@10: recommended value) and do not set a size constraint. yading@10: yading@10: yading@10: =head1 BITSTREAM FILTERS yading@10: yading@10: yading@10: When you configure your FFmpeg build, all the supported bitstream yading@10: filters are enabled by default. You can list all available ones using yading@10: the configure option C<--list-bsfs>. yading@10: yading@10: You can disable all the bitstream filters using the configure option yading@10: C<--disable-bsfs>, and selectively enable any bitstream filter using yading@10: the option C<--enable-bsf=BSF>, or you can disable a particular yading@10: bitstream filter using the option C<--disable-bsf=BSF>. yading@10: yading@10: The option C<-bsfs> of the ff* tools will display the list of yading@10: all the supported bitstream filters included in your build. yading@10: yading@10: Below is a description of the currently available bitstream filters. yading@10: yading@10: yading@10: =head2 aac_adtstoasc yading@10: yading@10: yading@10: yading@10: =head2 chomp yading@10: yading@10: yading@10: yading@10: =head2 dump_extradata yading@10: yading@10: yading@10: yading@10: =head2 h264_mp4toannexb yading@10: yading@10: yading@10: Convert an H.264 bitstream from length prefixed mode to start code yading@10: prefixed mode (as defined in the Annex B of the ITU-T H.264 yading@10: specification). yading@10: yading@10: This is required by some streaming formats, typically the MPEG-2 yading@10: transport stream format ("mpegts"). yading@10: yading@10: For example to remux an MP4 file containing an H.264 stream to mpegts yading@10: format with B<ffmpeg>, you can use the command: yading@10: yading@10: yading@10: ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts yading@10: yading@10: yading@10: yading@10: =head2 imx_dump_header yading@10: yading@10: yading@10: yading@10: =head2 mjpeg2jpeg yading@10: yading@10: yading@10: Convert MJPEG/AVI1 packets to full JPEG/JFIF packets. yading@10: yading@10: MJPEG is a video codec wherein each video frame is essentially a yading@10: JPEG image. The individual frames can be extracted without loss, yading@10: e.g. by yading@10: yading@10: yading@10: ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg yading@10: yading@10: yading@10: Unfortunately, these chunks are incomplete JPEG images, because yading@10: they lack the DHT segment required for decoding. Quoting from yading@10: E<lt>B<http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml>E<gt>: yading@10: yading@10: Avery Lee, writing in the rec.video.desktop newsgroup in 2001, yading@10: commented that "MJPEG, or at least the MJPEG in AVIs having the yading@10: MJPG fourcc, is restricted JPEG with a fixed -- and *omitted* -- yading@10: Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2, yading@10: and it must use basic Huffman encoding, not arithmetic or yading@10: progressive. . . . You can indeed extract the MJPEG frames and yading@10: decode them with a regular JPEG decoder, but you have to prepend yading@10: the DHT segment to them, or else the decoder won't have any idea yading@10: how to decompress the data. The exact table necessary is given in yading@10: the OpenDML spec." yading@10: yading@10: This bitstream filter patches the header of frames extracted from an MJPEG yading@10: stream (carrying the AVI1 header ID and lacking a DHT segment) to yading@10: produce fully qualified JPEG images. yading@10: yading@10: yading@10: ffmpeg -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpg yading@10: exiftran -i -9 frame*.jpg yading@10: ffmpeg -i frame_%d.jpg -c:v copy rotated.avi yading@10: yading@10: yading@10: yading@10: =head2 mjpega_dump_header yading@10: yading@10: yading@10: yading@10: =head2 movsub yading@10: yading@10: yading@10: yading@10: =head2 mp3_header_compress yading@10: yading@10: yading@10: yading@10: =head2 mp3_header_decompress yading@10: yading@10: yading@10: yading@10: =head2 noise yading@10: yading@10: yading@10: yading@10: =head2 remove_extradata yading@10: yading@10: yading@10: yading@10: yading@10: =head1 FORMAT OPTIONS yading@10: yading@10: yading@10: The libavformat library provides some generic global options, which yading@10: can be set on all the muxers and demuxers. In addition each muxer or yading@10: demuxer may support so-called private options, which are specific for yading@10: that component. yading@10: yading@10: Options may be set by specifying -I<option> I<value> in the yading@10: FFmpeg tools, or by setting the value explicitly in the yading@10: C<AVFormatContext> options or using the F<libavutil/opt.h> API yading@10: for programmatic use. yading@10: yading@10: The list of supported options follows: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<avioflags> I<flags> B<(>I<input/output>B<)> yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<direct> yading@10: yading@10: Reduce buffering. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<probesize> I<integer> B<(>I<input>B<)> yading@10: yading@10: Set probing size in bytes, i.e. the size of the data to analyze to get yading@10: stream information. A higher value will allow to detect more yading@10: information in case it is dispersed into the stream, but will increase yading@10: latency. Must be an integer not lesser than 32. It is 5000000 by default. yading@10: yading@10: yading@10: =item B<packetsize> I<integer> B<(>I<output>B<)> yading@10: yading@10: Set packet size. yading@10: yading@10: yading@10: =item B<fflags> I<flags> B<(>I<input/output>B<)> yading@10: yading@10: Set format flags. yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<ignidx> yading@10: yading@10: Ignore index. yading@10: yading@10: =item B<genpts> yading@10: yading@10: Generate PTS. yading@10: yading@10: =item B<nofillin> yading@10: yading@10: Do not fill in missing values that can be exactly calculated. yading@10: yading@10: =item B<noparse> yading@10: yading@10: Disable AVParsers, this needs C<+nofillin> too. yading@10: yading@10: =item B<igndts> yading@10: yading@10: Ignore DTS. yading@10: yading@10: =item B<discardcorrupt> yading@10: yading@10: Discard corrupted frames. yading@10: yading@10: =item B<sortdts> yading@10: yading@10: Try to interleave output packets by DTS. yading@10: yading@10: =item B<keepside> yading@10: yading@10: Do not merge side data. yading@10: yading@10: =item B<latm> yading@10: yading@10: Enable RTP MP4A-LATM payload. yading@10: yading@10: =item B<nobuffer> yading@10: yading@10: Reduce the latency introduced by optional buffering yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<analyzeduration> I<integer> B<(>I<input>B<)> yading@10: yading@10: Specify how many microseconds are analyzed to probe the input. A yading@10: higher value will allow to detect more accurate information, but will yading@10: increase latency. It defaults to 5,000,000 microseconds = 5 seconds. yading@10: yading@10: yading@10: =item B<cryptokey> I<hexadecimal string> B<(>I<input>B<)> yading@10: yading@10: Set decryption key. yading@10: yading@10: yading@10: =item B<indexmem> I<integer> B<(>I<input>B<)> yading@10: yading@10: Set max memory used for timestamp index (per stream). yading@10: yading@10: yading@10: =item B<rtbufsize> I<integer> B<(>I<input>B<)> yading@10: yading@10: Set max memory used for buffering real-time frames. yading@10: yading@10: yading@10: =item B<fdebug> I<flags> B<(>I<input/output>B<)> yading@10: yading@10: Print specific debug info. yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<ts> yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<max_delay> I<integer> B<(>I<input/output>B<)> yading@10: yading@10: Set maximum muxing or demuxing delay in microseconds. yading@10: yading@10: yading@10: =item B<fpsprobesize> I<integer> B<(>I<input>B<)> yading@10: yading@10: Set number of frames used to probe fps. yading@10: yading@10: yading@10: =item B<audio_preload> I<integer> B<(>I<output>B<)> yading@10: yading@10: Set microseconds by which audio packets should be interleaved earlier. yading@10: yading@10: yading@10: =item B<chunk_duration> I<integer> B<(>I<output>B<)> yading@10: yading@10: Set microseconds for each chunk. yading@10: yading@10: yading@10: =item B<chunk_size> I<integer> B<(>I<output>B<)> yading@10: yading@10: Set size in bytes for each chunk. yading@10: yading@10: yading@10: =item B<err_detect, f_err_detect> I<flags> B<(>I<input>B<)> yading@10: yading@10: Set error detection flags. C<f_err_detect> is deprecated and yading@10: should be used only via the B<ffmpeg> tool. yading@10: yading@10: Possible values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<crccheck> yading@10: yading@10: Verify embedded CRCs. yading@10: yading@10: =item B<bitstream> yading@10: yading@10: Detect bitstream specification deviations. yading@10: yading@10: =item B<buffer> yading@10: yading@10: Detect improper bitstream length. yading@10: yading@10: =item B<explode> yading@10: yading@10: Abort decoding on minor error detection. yading@10: yading@10: =item B<careful> yading@10: yading@10: Consider things that violate the spec and have not been seen in the yading@10: wild as errors. yading@10: yading@10: =item B<compliant> yading@10: yading@10: Consider all spec non compliancies as errors. yading@10: yading@10: =item B<aggressive> yading@10: yading@10: Consider things that a sane encoder should not do as an error. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<use_wallclock_as_timestamps> I<integer> B<(>I<input>B<)> yading@10: yading@10: Use wallclock as timestamps. yading@10: yading@10: yading@10: =item B<avoid_negative_ts> I<integer> B<(>I<output>B<)> yading@10: yading@10: Shift timestamps to make them positive. A value of 1 enables shifting, yading@10: a value of 0 disables it, the default value of -1 enables shifting yading@10: when required by the target format. yading@10: yading@10: When shifting is enabled, all output timestamps are shifted by the yading@10: same amount. Audio, video, and subtitles desynching and relative yading@10: timestamp differences are preserved compared to how they would have yading@10: been without shifting. yading@10: yading@10: Also note that this affects only leading negative timestamps, and not yading@10: non-monotonic negative timestamps. yading@10: yading@10: yading@10: =item B<flush_packets> I<integer> B<(>I<output>B<)> yading@10: yading@10: Flush the underlying I/O stream after each packet. Default 1 enables it, and yading@10: has the effect of reducing the latency; 0 disables it and may slightly yading@10: increase performance in some cases. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: yading@10: =head1 DEMUXERS yading@10: yading@10: yading@10: Demuxers are configured elements in FFmpeg which allow to read the yading@10: multimedia streams from a particular type of file. yading@10: yading@10: When you configure your FFmpeg build, all the supported demuxers yading@10: are enabled by default. You can list all available ones using the yading@10: configure option C<--list-demuxers>. yading@10: yading@10: You can disable all the demuxers using the configure option yading@10: C<--disable-demuxers>, and selectively enable a single demuxer with yading@10: the option C<--enable-demuxer=I<DEMUXER>>, or disable it yading@10: with the option C<--disable-demuxer=I<DEMUXER>>. yading@10: yading@10: The option C<-formats> of the ff* tools will display the list of yading@10: enabled demuxers. yading@10: yading@10: The description of some of the currently available demuxers follows. yading@10: yading@10: yading@10: =head2 applehttp yading@10: yading@10: yading@10: Apple HTTP Live Streaming demuxer. yading@10: yading@10: This demuxer presents all AVStreams from all variant streams. yading@10: The id field is set to the bitrate variant index number. By setting yading@10: the discard flags on AVStreams (by pressing 'a' or 'v' in ffplay), yading@10: the caller can decide which variant streams to actually receive. yading@10: The total bitrate of the variant that the stream belongs to is yading@10: available in a metadata key named "variant_bitrate". yading@10: yading@10: yading@10: yading@10: =head2 concat yading@10: yading@10: yading@10: Virtual concatenation script demuxer. yading@10: yading@10: This demuxer reads a list of files and other directives from a text file and yading@10: demuxes them one after the other, as if all their packet had been muxed yading@10: together. yading@10: yading@10: The timestamps in the files are adjusted so that the first file starts at 0 yading@10: and each next file starts where the previous one finishes. Note that it is yading@10: done globally and may cause gaps if all streams do not have exactly the same yading@10: length. yading@10: yading@10: All files must have the same streams (same codecs, same time base, etc.). yading@10: yading@10: The duration of each file is used to adjust the timestamps of the next file: yading@10: if the duration is incorrect (because it was computed using the bit-rate or yading@10: because the file is truncated, for example), it can cause artifacts. The yading@10: C<duration> directive can be used to override the duration stored in yading@10: each file. yading@10: yading@10: yading@10: =head3 Syntax yading@10: yading@10: yading@10: The script is a text file in extended-ASCII, with one directive per line. yading@10: Empty lines, leading spaces and lines starting with '#' are ignored. The yading@10: following directive is recognized: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<C<file I<path>>> yading@10: yading@10: Path to a file to read; special characters and spaces must be escaped with yading@10: backslash or single quotes. yading@10: yading@10: All subsequent directives apply to that file. yading@10: yading@10: yading@10: =item B<C<ffconcat version 1.0>> yading@10: yading@10: Identify the script type and version. It also sets the B<safe> option yading@10: to 1 if it was to its default -1. yading@10: yading@10: To make FFmpeg recognize the format automatically, this directive must yading@10: appears exactly as is (no extra space or byte-order-mark) on the very first yading@10: line of the script. yading@10: yading@10: yading@10: =item B<C<duration I<dur>>> yading@10: yading@10: Duration of the file. This information can be specified from the file; yading@10: specifying it here may be more efficient or help if the information from the yading@10: file is not available or accurate. yading@10: yading@10: If the duration is set for all files, then it is possible to seek in the yading@10: whole concatenated video. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Options yading@10: yading@10: yading@10: This demuxer accepts the following option: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<safe> yading@10: yading@10: If set to 1, reject unsafe file paths. A file path is considered safe if it yading@10: does not contain a protocol specification and is relative and all components yading@10: only contain characters from the portable character set (letters, digits, yading@10: period, underscore and hyphen) and have no period at the beginning of a yading@10: component. yading@10: yading@10: If set to 0, any file name is accepted. yading@10: yading@10: The default is -1, it is equivalent to 1 if the format was automatically yading@10: probed and 0 otherwise. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 libquvi yading@10: yading@10: yading@10: Play media from Internet services using the quvi project. yading@10: yading@10: The demuxer accepts a B<format> option to request a specific quality. It yading@10: is by default set to I<best>. yading@10: yading@10: See E<lt>B<http://quvi.sourceforge.net/>E<gt> for more information. yading@10: yading@10: FFmpeg needs to be built with C<--enable-libquvi> for this demuxer to be yading@10: enabled. yading@10: yading@10: yading@10: =head2 image2 yading@10: yading@10: yading@10: Image file demuxer. yading@10: yading@10: This demuxer reads from a list of image files specified by a pattern. yading@10: The syntax and meaning of the pattern is specified by the yading@10: option I<pattern_type>. yading@10: yading@10: The pattern may contain a suffix which is used to automatically yading@10: determine the format of the images contained in the files. yading@10: yading@10: The size, the pixel format, and the format of each image must be the yading@10: same for all the files in the sequence. yading@10: yading@10: This demuxer accepts the following options: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<framerate> yading@10: yading@10: Set the frame rate for the video stream. It defaults to 25. yading@10: yading@10: =item B<loop> yading@10: yading@10: If set to 1, loop over the input. Default value is 0. yading@10: yading@10: =item B<pattern_type> yading@10: yading@10: Select the pattern type used to interpret the provided filename. yading@10: yading@10: I<pattern_type> accepts one of the following values. yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<sequence> yading@10: yading@10: Select a sequence pattern type, used to specify a sequence of files yading@10: indexed by sequential numbers. yading@10: yading@10: A sequence pattern may contain the string "%d" or "%0I<N>d", which yading@10: specifies the position of the characters representing a sequential yading@10: number in each filename matched by the pattern. If the form yading@10: "%d0I<N>d" is used, the string representing the number in each yading@10: filename is 0-padded and I<N> is the total number of 0-padded yading@10: digits representing the number. The literal character '%' can be yading@10: specified in the pattern with the string "%%". yading@10: yading@10: If the sequence pattern contains "%d" or "%0I<N>d", the first filename of yading@10: the file list specified by the pattern must contain a number yading@10: inclusively contained between I<start_number> and yading@10: I<start_number>+I<start_number_range>-1, and all the following yading@10: numbers must be sequential. yading@10: yading@10: For example the pattern "img-%03d.bmp" will match a sequence of yading@10: filenames of the form F<img-001.bmp>, F<img-002.bmp>, ..., yading@10: F<img-010.bmp>, etc.; the pattern "i%%m%%g-%d.jpg" will match a yading@10: sequence of filenames of the form F<i%m%g-1.jpg>, yading@10: F<i%m%g-2.jpg>, ..., F<i%m%g-10.jpg>, etc. yading@10: yading@10: Note that the pattern must not necessarily contain "%d" or yading@10: "%0I<N>d", for example to convert a single image file yading@10: F<img.jpeg> you can employ the command: yading@10: yading@10: ffmpeg -i img.jpeg img.png yading@10: yading@10: yading@10: yading@10: =item B<glob> yading@10: yading@10: Select a glob wildcard pattern type. yading@10: yading@10: The pattern is interpreted like a C<glob()> pattern. This is only yading@10: selectable if libavformat was compiled with globbing support. yading@10: yading@10: yading@10: =item B<glob_sequence> I<(deprecated, will be removed)> yading@10: yading@10: Select a mixed glob wildcard/sequence pattern. yading@10: yading@10: If your version of libavformat was compiled with globbing support, and yading@10: the provided pattern contains at least one glob meta character among yading@10: C<%*?[]{}> that is preceded by an unescaped "%", the pattern is yading@10: interpreted like a C<glob()> pattern, otherwise it is interpreted yading@10: like a sequence pattern. yading@10: yading@10: All glob special characters C<%*?[]{}> must be prefixed yading@10: with "%". To escape a literal "%" you shall use "%%". yading@10: yading@10: For example the pattern C<foo-%*.jpeg> will match all the yading@10: filenames prefixed by "foo-" and terminating with ".jpeg", and yading@10: C<foo-%?%?%?.jpeg> will match all the filenames prefixed with yading@10: "foo-", followed by a sequence of three characters, and terminating yading@10: with ".jpeg". yading@10: yading@10: This pattern type is deprecated in favor of I<glob> and yading@10: I<sequence>. yading@10: yading@10: =back yading@10: yading@10: yading@10: Default value is I<glob_sequence>. yading@10: yading@10: =item B<pixel_format> yading@10: yading@10: Set the pixel format of the images to read. If not specified the pixel yading@10: format is guessed from the first image file in the sequence. yading@10: yading@10: =item B<start_number> yading@10: yading@10: Set the index of the file matched by the image file pattern to start yading@10: to read from. Default value is 0. yading@10: yading@10: =item B<start_number_range> yading@10: yading@10: Set the index interval range to check when looking for the first image yading@10: file in the sequence, starting from I<start_number>. Default value yading@10: is 5. yading@10: yading@10: =item B<video_size> yading@10: yading@10: Set the video size of the images to read. If not specified the video yading@10: size is guessed from the first image file in the sequence. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Use B<ffmpeg> for creating a video from the images in the file yading@10: sequence F<img-001.jpeg>, F<img-002.jpeg>, ..., assuming an yading@10: input frame rate of 10 frames per second: yading@10: yading@10: ffmpeg -i 'img-%03d.jpeg' -r 10 out.mkv yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: As above, but start by reading from a file with index 100 in the sequence: yading@10: yading@10: ffmpeg -start_number 100 -i 'img-%03d.jpeg' -r 10 out.mkv yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Read images matching the "*.png" glob pattern , that is all the files yading@10: terminating with the ".png" suffix: yading@10: yading@10: ffmpeg -pattern_type glob -i "*.png" -r 10 out.mkv yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 rawvideo yading@10: yading@10: yading@10: Raw video demuxer. yading@10: yading@10: This demuxer allows to read raw video data. Since there is no header yading@10: specifying the assumed video parameters, the user must specify them yading@10: in order to be able to decode the data correctly. yading@10: yading@10: This demuxer accepts the following options: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<framerate> yading@10: yading@10: Set input video frame rate. Default value is 25. yading@10: yading@10: yading@10: =item B<pixel_format> yading@10: yading@10: Set the input video pixel format. Default value is C<yuv420p>. yading@10: yading@10: yading@10: =item B<video_size> yading@10: yading@10: Set the input video size. This value must be specified explicitly. yading@10: yading@10: =back yading@10: yading@10: yading@10: For example to read a rawvideo file F<input.raw> with yading@10: B<ffplay>, assuming a pixel format of C<rgb24>, a video yading@10: size of C<320x240>, and a frame rate of 10 images per second, use yading@10: the command: yading@10: yading@10: ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw yading@10: yading@10: yading@10: yading@10: =head2 sbg yading@10: yading@10: yading@10: SBaGen script demuxer. yading@10: yading@10: This demuxer reads the script language used by SBaGen yading@10: E<lt>B<http://uazu.net/sbagen/>E<gt> to generate binaural beats sessions. A SBG yading@10: script looks like that: yading@10: yading@10: -SE yading@10: a: 300-2.5/3 440+4.5/0 yading@10: b: 300-2.5/0 440+4.5/3 yading@10: off: - yading@10: NOW == a yading@10: +0:07:00 == b yading@10: +0:14:00 == a yading@10: +0:21:00 == b yading@10: +0:30:00 off yading@10: yading@10: yading@10: A SBG script can mix absolute and relative timestamps. If the script uses yading@10: either only absolute timestamps (including the script start time) or only yading@10: relative ones, then its layout is fixed, and the conversion is yading@10: straightforward. On the other hand, if the script mixes both kind of yading@10: timestamps, then the I<NOW> reference for relative timestamps will be yading@10: taken from the current time of day at the time the script is read, and the yading@10: script layout will be frozen according to that reference. That means that if yading@10: the script is directly played, the actual times will match the absolute yading@10: timestamps up to the sound controller's clock accuracy, but if the user yading@10: somehow pauses the playback or seeks, all times will be shifted accordingly. yading@10: yading@10: yading@10: =head2 tedcaptions yading@10: yading@10: yading@10: JSON captions used for E<lt>B<http://www.ted.com/>E<gt>. yading@10: yading@10: TED does not provide links to the captions, but they can be guessed from the yading@10: page. The file F<tools/bookmarklets.html> from the FFmpeg source tree yading@10: contains a bookmarklet to expose them. yading@10: yading@10: This demuxer accepts the following option: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<start_time> yading@10: yading@10: Set the start time of the TED talk, in milliseconds. The default is 15000 yading@10: (15s). It is used to sync the captions with the downloadable videos, because yading@10: they include a 15s intro. yading@10: yading@10: =back yading@10: yading@10: yading@10: Example: convert the captions to a format most players understand: yading@10: yading@10: ffmpeg -i http://www.ted.com/talks/subtitles/id/1/lang/en talk1-en.srt yading@10: yading@10: yading@10: yading@10: =head1 MUXERS yading@10: yading@10: yading@10: Muxers are configured elements in FFmpeg which allow writing yading@10: multimedia streams to a particular type of file. yading@10: yading@10: When you configure your FFmpeg build, all the supported muxers yading@10: are enabled by default. You can list all available muxers using the yading@10: configure option C<--list-muxers>. yading@10: yading@10: You can disable all the muxers with the configure option yading@10: C<--disable-muxers> and selectively enable / disable single muxers yading@10: with the options C<--enable-muxer=I<MUXER>> / yading@10: C<--disable-muxer=I<MUXER>>. yading@10: yading@10: The option C<-formats> of the ff* tools will display the list of yading@10: enabled muxers. yading@10: yading@10: A description of some of the currently available muxers follows. yading@10: yading@10: yading@10: yading@10: =head2 crc yading@10: yading@10: yading@10: CRC (Cyclic Redundancy Check) testing format. yading@10: yading@10: This muxer computes and prints the Adler-32 CRC of all the input audio yading@10: and video frames. By default audio frames are converted to signed yading@10: 16-bit raw audio and video frames to raw video before computing the yading@10: CRC. yading@10: yading@10: The output of the muxer consists of a single line of the form: yading@10: CRC=0xI<CRC>, where I<CRC> is a hexadecimal number 0-padded to yading@10: 8 digits containing the CRC for all the decoded input frames. yading@10: yading@10: For example to compute the CRC of the input, and store it in the file yading@10: F<out.crc>: yading@10: yading@10: ffmpeg -i INPUT -f crc out.crc yading@10: yading@10: yading@10: You can print the CRC to stdout with the command: yading@10: yading@10: ffmpeg -i INPUT -f crc - yading@10: yading@10: yading@10: You can select the output format of each frame with B<ffmpeg> by yading@10: specifying the audio and video codec and format. For example to yading@10: compute the CRC of the input audio converted to PCM unsigned 8-bit yading@10: and the input video converted to MPEG-2 video, use the command: yading@10: yading@10: ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f crc - yading@10: yading@10: yading@10: See also the framecrc muxer. yading@10: yading@10: yading@10: yading@10: =head2 framecrc yading@10: yading@10: yading@10: Per-packet CRC (Cyclic Redundancy Check) testing format. yading@10: yading@10: This muxer computes and prints the Adler-32 CRC for each audio yading@10: and video packet. By default audio frames are converted to signed yading@10: 16-bit raw audio and video frames to raw video before computing the yading@10: CRC. yading@10: yading@10: The output of the muxer consists of a line for each audio and video yading@10: packet of the form: yading@10: yading@10: <stream_index>, <packet_dts>, <packet_pts>, <packet_duration>, <packet_size>, 0x<CRC> yading@10: yading@10: yading@10: I<CRC> is a hexadecimal number 0-padded to 8 digits containing the yading@10: CRC of the packet. yading@10: yading@10: For example to compute the CRC of the audio and video frames in yading@10: F<INPUT>, converted to raw audio and video packets, and store it yading@10: in the file F<out.crc>: yading@10: yading@10: ffmpeg -i INPUT -f framecrc out.crc yading@10: yading@10: yading@10: To print the information to stdout, use the command: yading@10: yading@10: ffmpeg -i INPUT -f framecrc - yading@10: yading@10: yading@10: With B<ffmpeg>, you can select the output format to which the yading@10: audio and video frames are encoded before computing the CRC for each yading@10: packet by specifying the audio and video codec. For example, to yading@10: compute the CRC of each decoded input audio frame converted to PCM yading@10: unsigned 8-bit and of each decoded input video frame converted to yading@10: MPEG-2 video, use the command: yading@10: yading@10: ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f framecrc - yading@10: yading@10: yading@10: See also the crc muxer. yading@10: yading@10: yading@10: yading@10: =head2 framemd5 yading@10: yading@10: yading@10: Per-packet MD5 testing format. yading@10: yading@10: This muxer computes and prints the MD5 hash for each audio yading@10: and video packet. By default audio frames are converted to signed yading@10: 16-bit raw audio and video frames to raw video before computing the yading@10: hash. yading@10: yading@10: The output of the muxer consists of a line for each audio and video yading@10: packet of the form: yading@10: yading@10: <stream_index>, <packet_dts>, <packet_pts>, <packet_duration>, <packet_size>, <MD5> yading@10: yading@10: yading@10: I<MD5> is a hexadecimal number representing the computed MD5 hash yading@10: for the packet. yading@10: yading@10: For example to compute the MD5 of the audio and video frames in yading@10: F<INPUT>, converted to raw audio and video packets, and store it yading@10: in the file F<out.md5>: yading@10: yading@10: ffmpeg -i INPUT -f framemd5 out.md5 yading@10: yading@10: yading@10: To print the information to stdout, use the command: yading@10: yading@10: ffmpeg -i INPUT -f framemd5 - yading@10: yading@10: yading@10: See also the md5 muxer. yading@10: yading@10: yading@10: yading@10: =head2 hls yading@10: yading@10: yading@10: Apple HTTP Live Streaming muxer that segments MPEG-TS according to yading@10: the HTTP Live Streaming specification. yading@10: yading@10: It creates a playlist file and numbered segment files. The output yading@10: filename specifies the playlist filename; the segment filenames yading@10: receive the same basename as the playlist, a sequential number and yading@10: a .ts extension. yading@10: yading@10: yading@10: ffmpeg -i in.nut out.m3u8 yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<-hls_time> I<seconds> yading@10: yading@10: Set the segment length in seconds. yading@10: yading@10: =item B<-hls_list_size> I<size> yading@10: yading@10: Set the maximum number of playlist entries. yading@10: yading@10: =item B<-hls_wrap> I<wrap> yading@10: yading@10: Set the number after which index wraps. yading@10: yading@10: =item B<-start_number> I<number> yading@10: yading@10: Start the sequence from I<number>. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: yading@10: =head2 ico yading@10: yading@10: yading@10: ICO file muxer. yading@10: yading@10: Microsoft's icon file format (ICO) has some strict limitations that should be noted: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Size cannot exceed 256 pixels in any dimension yading@10: yading@10: yading@10: =item * yading@10: yading@10: Only BMP and PNG images can be stored yading@10: yading@10: yading@10: =item * yading@10: yading@10: If a BMP image is used, it must be one of the following pixel formats: yading@10: yading@10: BMP Bit Depth FFmpeg Pixel Format yading@10: 1bit pal8 yading@10: 4bit pal8 yading@10: 8bit pal8 yading@10: 16bit rgb555le yading@10: 24bit bgr24 yading@10: 32bit bgra yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: If a BMP image is used, it must use the BITMAPINFOHEADER DIB header yading@10: yading@10: yading@10: =item * yading@10: yading@10: If a PNG image is used, it must use the rgba pixel format yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: yading@10: =head2 image2 yading@10: yading@10: yading@10: Image file muxer. yading@10: yading@10: The image file muxer writes video frames to image files. yading@10: yading@10: The output filenames are specified by a pattern, which can be used to yading@10: produce sequentially numbered series of files. yading@10: The pattern may contain the string "%d" or "%0I<N>d", this string yading@10: specifies the position of the characters representing a numbering in yading@10: the filenames. If the form "%0I<N>d" is used, the string yading@10: representing the number in each filename is 0-padded to I<N> yading@10: digits. The literal character '%' can be specified in the pattern with yading@10: the string "%%". yading@10: yading@10: If the pattern contains "%d" or "%0I<N>d", the first filename of yading@10: the file list specified will contain the number 1, all the following yading@10: numbers will be sequential. yading@10: yading@10: The pattern may contain a suffix which is used to automatically yading@10: determine the format of the image files to write. yading@10: yading@10: For example the pattern "img-%03d.bmp" will specify a sequence of yading@10: filenames of the form F<img-001.bmp>, F<img-002.bmp>, ..., yading@10: F<img-010.bmp>, etc. yading@10: The pattern "img%%-%d.jpg" will specify a sequence of filenames of the yading@10: form F<img%-1.jpg>, F<img%-2.jpg>, ..., F<img%-10.jpg>, yading@10: etc. yading@10: yading@10: The following example shows how to use B<ffmpeg> for creating a yading@10: sequence of files F<img-001.jpeg>, F<img-002.jpeg>, ..., yading@10: taking one image every second from the input video: yading@10: yading@10: ffmpeg -i in.avi -vsync 1 -r 1 -f image2 'img-%03d.jpeg' yading@10: yading@10: yading@10: Note that with B<ffmpeg>, if the format is not specified with the yading@10: C<-f> option and the output filename specifies an image file yading@10: format, the image2 muxer is automatically selected, so the previous yading@10: command can be written as: yading@10: yading@10: ffmpeg -i in.avi -vsync 1 -r 1 'img-%03d.jpeg' yading@10: yading@10: yading@10: Note also that the pattern must not necessarily contain "%d" or yading@10: "%0I<N>d", for example to create a single image file yading@10: F<img.jpeg> from the input video you can employ the command: yading@10: yading@10: ffmpeg -i in.avi -f image2 -frames:v 1 img.jpeg yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<start_number> I<number> yading@10: yading@10: Start the sequence from I<number>. Default value is 1. Must be a yading@10: positive number. yading@10: yading@10: yading@10: =item B<-update> I<number> yading@10: yading@10: If I<number> is nonzero, the filename will always be interpreted as just a yading@10: filename, not a pattern, and this file will be continuously overwritten with new yading@10: images. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: The image muxer supports the .Y.U.V image file format. This format is yading@10: special in that that each image frame consists of three files, for yading@10: each of the YUV420P components. To read or write this image file format, yading@10: specify the name of the '.Y' file. The muxer will automatically open the yading@10: '.U' and '.V' files as required. yading@10: yading@10: yading@10: yading@10: =head2 md5 yading@10: yading@10: yading@10: MD5 testing format. yading@10: yading@10: This muxer computes and prints the MD5 hash of all the input audio yading@10: and video frames. By default audio frames are converted to signed yading@10: 16-bit raw audio and video frames to raw video before computing the yading@10: hash. yading@10: yading@10: The output of the muxer consists of a single line of the form: yading@10: MD5=I<MD5>, where I<MD5> is a hexadecimal number representing yading@10: the computed MD5 hash. yading@10: yading@10: For example to compute the MD5 hash of the input converted to raw yading@10: audio and video, and store it in the file F<out.md5>: yading@10: yading@10: ffmpeg -i INPUT -f md5 out.md5 yading@10: yading@10: yading@10: You can print the MD5 to stdout with the command: yading@10: yading@10: ffmpeg -i INPUT -f md5 - yading@10: yading@10: yading@10: See also the framemd5 muxer. yading@10: yading@10: yading@10: =head2 MOV/MP4/ISMV yading@10: yading@10: yading@10: The mov/mp4/ismv muxer supports fragmentation. Normally, a MOV/MP4 yading@10: file has all the metadata about all packets stored in one location yading@10: (written at the end of the file, it can be moved to the start for yading@10: better playback by adding I<faststart> to the I<movflags>, or yading@10: using the B<qt-faststart> tool). A fragmented yading@10: file consists of a number of fragments, where packets and metadata yading@10: about these packets are stored together. Writing a fragmented yading@10: file has the advantage that the file is decodable even if the yading@10: writing is interrupted (while a normal MOV/MP4 is undecodable if yading@10: it is not properly finished), and it requires less memory when writing yading@10: very long files (since writing normal MOV/MP4 files stores info about yading@10: every single packet in memory until the file is closed). The downside yading@10: is that it is less compatible with other applications. yading@10: yading@10: Fragmentation is enabled by setting one of the AVOptions that define yading@10: how to cut the file into fragments: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<-moov_size> I<bytes> yading@10: yading@10: Reserves space for the moov atom at the beginning of the file instead of placing the yading@10: moov atom at the end. If the space reserved is insufficient, muxing will fail. yading@10: yading@10: =item B<-movflags frag_keyframe> yading@10: yading@10: Start a new fragment at each video keyframe. yading@10: yading@10: =item B<-frag_duration> I<duration> yading@10: yading@10: Create fragments that are I<duration> microseconds long. yading@10: yading@10: =item B<-frag_size> I<size> yading@10: yading@10: Create fragments that contain up to I<size> bytes of payload data. yading@10: yading@10: =item B<-movflags frag_custom> yading@10: yading@10: Allow the caller to manually choose when to cut fragments, by yading@10: calling C<av_write_frame(ctx, NULL)> to write a fragment with yading@10: the packets written so far. (This is only useful with other yading@10: applications integrating libavformat, not from B<ffmpeg>.) yading@10: yading@10: =item B<-min_frag_duration> I<duration> yading@10: yading@10: Don't create fragments that are shorter than I<duration> microseconds long. yading@10: yading@10: =back yading@10: yading@10: yading@10: If more than one condition is specified, fragments are cut when yading@10: one of the specified conditions is fulfilled. The exception to this is yading@10: C<-min_frag_duration>, which has to be fulfilled for any of the other yading@10: conditions to apply. yading@10: yading@10: Additionally, the way the output file is written can be adjusted yading@10: through a few other options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<-movflags empty_moov> yading@10: yading@10: Write an initial moov atom directly at the start of the file, without yading@10: describing any samples in it. Generally, an mdat/moov pair is written yading@10: at the start of the file, as a normal MOV/MP4 file, containing only yading@10: a short portion of the file. With this option set, there is no initial yading@10: mdat atom, and the moov atom only describes the tracks but has yading@10: a zero duration. yading@10: yading@10: Files written with this option set do not work in QuickTime. yading@10: This option is implicitly set when writing ismv (Smooth Streaming) files. yading@10: yading@10: =item B<-movflags separate_moof> yading@10: yading@10: Write a separate moof (movie fragment) atom for each track. Normally, yading@10: packets for all tracks are written in a moof atom (which is slightly yading@10: more efficient), but with this option set, the muxer writes one moof/mdat yading@10: pair for each track, making it easier to separate tracks. yading@10: yading@10: This option is implicitly set when writing ismv (Smooth Streaming) files. yading@10: yading@10: =item B<-movflags faststart> yading@10: yading@10: Run a second pass moving the moov atom on top of the file. This yading@10: operation can take a while, and will not work in various situations such yading@10: as fragmented output, thus it is not enabled by default. yading@10: yading@10: =item B<-movflags rtphint> yading@10: yading@10: Add RTP hinting tracks to the output file. yading@10: yading@10: =back yading@10: yading@10: yading@10: Smooth Streaming content can be pushed in real time to a publishing yading@10: point on IIS with this muxer. Example: yading@10: yading@10: ffmpeg -re <<normal input/transcoding options>> -movflags isml+frag_keyframe -f ismv http://server/publishingpoint.isml/Streams(Encoder1) yading@10: yading@10: yading@10: yading@10: =head2 mpegts yading@10: yading@10: yading@10: MPEG transport stream muxer. yading@10: yading@10: This muxer implements ISO 13818-1 and part of ETSI EN 300 468. yading@10: yading@10: The muxer options are: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<-mpegts_original_network_id> I<number> yading@10: yading@10: Set the original_network_id (default 0x0001). This is unique identifier yading@10: of a network in DVB. Its main use is in the unique identification of a yading@10: service through the path Original_Network_ID, Transport_Stream_ID. yading@10: yading@10: =item B<-mpegts_transport_stream_id> I<number> yading@10: yading@10: Set the transport_stream_id (default 0x0001). This identifies a yading@10: transponder in DVB. yading@10: yading@10: =item B<-mpegts_service_id> I<number> yading@10: yading@10: Set the service_id (default 0x0001) also known as program in DVB. yading@10: yading@10: =item B<-mpegts_pmt_start_pid> I<number> yading@10: yading@10: Set the first PID for PMT (default 0x1000, max 0x1f00). yading@10: yading@10: =item B<-mpegts_start_pid> I<number> yading@10: yading@10: Set the first PID for data packets (default 0x0100, max 0x0f00). yading@10: yading@10: =back yading@10: yading@10: yading@10: The recognized metadata settings in mpegts muxer are C<service_provider> yading@10: and C<service_name>. If they are not set the default for yading@10: C<service_provider> is "FFmpeg" and the default for yading@10: C<service_name> is "Service01". yading@10: yading@10: yading@10: ffmpeg -i file.mpg -c copy \ yading@10: -mpegts_original_network_id 0x1122 \ yading@10: -mpegts_transport_stream_id 0x3344 \ yading@10: -mpegts_service_id 0x5566 \ yading@10: -mpegts_pmt_start_pid 0x1500 \ yading@10: -mpegts_start_pid 0x150 \ yading@10: -metadata service_provider="Some provider" \ yading@10: -metadata service_name="Some Channel" \ yading@10: -y out.ts yading@10: yading@10: yading@10: yading@10: =head2 null yading@10: yading@10: yading@10: Null muxer. yading@10: yading@10: This muxer does not generate any output file, it is mainly useful for yading@10: testing or benchmarking purposes. yading@10: yading@10: For example to benchmark decoding with B<ffmpeg> you can use the yading@10: command: yading@10: yading@10: ffmpeg -benchmark -i INPUT -f null out.null yading@10: yading@10: yading@10: Note that the above command does not read or write the F<out.null> yading@10: file, but specifying the output file is required by the B<ffmpeg> yading@10: syntax. yading@10: yading@10: Alternatively you can write the command as: yading@10: yading@10: ffmpeg -benchmark -i INPUT -f null - yading@10: yading@10: yading@10: yading@10: =head2 matroska yading@10: yading@10: yading@10: Matroska container muxer. yading@10: yading@10: This muxer implements the matroska and webm container specs. yading@10: yading@10: The recognized metadata settings in this muxer are: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<title=>I<title name> yading@10: yading@10: Name provided to a single track yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<language=>I<language name> yading@10: yading@10: Specifies the language of the track in the Matroska languages form yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<stereo_mode=>I<mode> yading@10: yading@10: Stereo 3D video layout of two views in a single video track yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<mono> yading@10: yading@10: video is not stereo yading@10: yading@10: =item B<left_right> yading@10: yading@10: Both views are arranged side by side, Left-eye view is on the left yading@10: yading@10: =item B<bottom_top> yading@10: yading@10: Both views are arranged in top-bottom orientation, Left-eye view is at bottom yading@10: yading@10: =item B<top_bottom> yading@10: yading@10: Both views are arranged in top-bottom orientation, Left-eye view is on top yading@10: yading@10: =item B<checkerboard_rl> yading@10: yading@10: Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first yading@10: yading@10: =item B<checkerboard_lr> yading@10: yading@10: Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first yading@10: yading@10: =item B<row_interleaved_rl> yading@10: yading@10: Each view is constituted by a row based interleaving, Right-eye view is first row yading@10: yading@10: =item B<row_interleaved_lr> yading@10: yading@10: Each view is constituted by a row based interleaving, Left-eye view is first row yading@10: yading@10: =item B<col_interleaved_rl> yading@10: yading@10: Both views are arranged in a column based interleaving manner, Right-eye view is first column yading@10: yading@10: =item B<col_interleaved_lr> yading@10: yading@10: Both views are arranged in a column based interleaving manner, Left-eye view is first column yading@10: yading@10: =item B<anaglyph_cyan_red> yading@10: yading@10: All frames are in anaglyph format viewable through red-cyan filters yading@10: yading@10: =item B<right_left> yading@10: yading@10: Both views are arranged side by side, Right-eye view is on the left yading@10: yading@10: =item B<anaglyph_green_magenta> yading@10: yading@10: All frames are in anaglyph format viewable through green-magenta filters yading@10: yading@10: =item B<block_lr> yading@10: yading@10: Both eyes laced in one Block, Left-eye view is first yading@10: yading@10: =item B<block_rl> yading@10: yading@10: Both eyes laced in one Block, Right-eye view is first yading@10: yading@10: =back yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: For example a 3D WebM clip can be created using the following command line: yading@10: yading@10: ffmpeg -i sample_left_right_clip.mpg -an -c:v libvpx -metadata stereo_mode=left_right -y stereo_clip.webm yading@10: yading@10: yading@10: yading@10: =head2 segment, stream_segment, ssegment yading@10: yading@10: yading@10: Basic stream segmenter. yading@10: yading@10: The segmenter muxer outputs streams to a number of separate files of nearly yading@10: fixed duration. Output filename pattern can be set in a fashion similar to yading@10: image2. yading@10: yading@10: C<stream_segment> is a variant of the muxer used to write to yading@10: streaming output formats, i.e. which do not require global headers, yading@10: and is recommended for outputting e.g. to MPEG transport stream segments. yading@10: C<ssegment> is a shorter alias for C<stream_segment>. yading@10: yading@10: Every segment starts with a keyframe of the selected reference stream, yading@10: which is set through the B<reference_stream> option. yading@10: yading@10: Note that if you want accurate splitting for a video file, you need to yading@10: make the input key frames correspond to the exact splitting times yading@10: expected by the segmenter, or the segment muxer will start the new yading@10: segment with the key frame found next after the specified start yading@10: time. yading@10: yading@10: The segment muxer works best with a single constant frame rate video. yading@10: yading@10: Optionally it can generate a list of the created segments, by setting yading@10: the option I<segment_list>. The list type is specified by the yading@10: I<segment_list_type> option. yading@10: yading@10: The segment muxer supports the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<reference_stream> I<specifier> yading@10: yading@10: Set the reference stream, as specified by the string I<specifier>. yading@10: If I<specifier> is set to C<auto>, the reference is choosen yading@10: automatically. Otherwise it must be a stream specifier (see the ``Stream yading@10: specifiers'' chapter in the ffmpeg manual) which specifies the yading@10: reference stream. The default value is ``auto''. yading@10: yading@10: yading@10: =item B<segment_format> I<format> yading@10: yading@10: Override the inner container format, by default it is guessed by the filename yading@10: extension. yading@10: yading@10: yading@10: =item B<segment_list> I<name> yading@10: yading@10: Generate also a listfile named I<name>. If not specified no yading@10: listfile is generated. yading@10: yading@10: yading@10: =item B<segment_list_flags> I<flags> yading@10: yading@10: Set flags affecting the segment list generation. yading@10: yading@10: It currently supports the following flags: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item I<cache> yading@10: yading@10: Allow caching (only affects M3U8 list files). yading@10: yading@10: yading@10: =item I<live> yading@10: yading@10: Allow live-friendly file generation. yading@10: yading@10: =back yading@10: yading@10: yading@10: Default value is C<cache>. yading@10: yading@10: yading@10: =item B<segment_list_size> I<size> yading@10: yading@10: Update the list file so that it contains at most the last I<size> yading@10: segments. If 0 the list file will contain all the segments. Default yading@10: value is 0. yading@10: yading@10: yading@10: =item B<segment_list type> I<type> yading@10: yading@10: Specify the format for the segment list file. yading@10: yading@10: The following values are recognized: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<flat> yading@10: yading@10: Generate a flat list for the created segments, one segment per line. yading@10: yading@10: yading@10: =item B<csv, ext> yading@10: yading@10: Generate a list for the created segments, one segment per line, yading@10: each line matching the format (comma-separated values): yading@10: yading@10: <segment_filename>,<segment_start_time>,<segment_end_time> yading@10: yading@10: yading@10: I<segment_filename> is the name of the output file generated by the yading@10: muxer according to the provided pattern. CSV escaping (according to yading@10: RFC4180) is applied if required. yading@10: yading@10: I<segment_start_time> and I<segment_end_time> specify yading@10: the segment start and end time expressed in seconds. yading@10: yading@10: A list file with the suffix C<".csv"> or C<".ext"> will yading@10: auto-select this format. yading@10: yading@10: C<ext> is deprecated in favor or C<csv>. yading@10: yading@10: yading@10: =item B<ffconcat> yading@10: yading@10: Generate an ffconcat file for the created segments. The resulting file yading@10: can be read using the FFmpeg concat demuxer. yading@10: yading@10: A list file with the suffix C<".ffcat"> or C<".ffconcat"> will yading@10: auto-select this format. yading@10: yading@10: yading@10: =item B<m3u8> yading@10: yading@10: Generate an extended M3U8 file, version 3, compliant with yading@10: E<lt>B<http://tools.ietf.org/id/draft-pantos-http-live-streaming>E<gt>. yading@10: yading@10: A list file with the suffix C<".m3u8"> will auto-select this format. yading@10: yading@10: =back yading@10: yading@10: yading@10: If not specified the type is guessed from the list file name suffix. yading@10: yading@10: yading@10: =item B<segment_time> I<time> yading@10: yading@10: Set segment duration to I<time>, the value must be a duration yading@10: specification. Default value is "2". See also the yading@10: B<segment_times> option. yading@10: yading@10: Note that splitting may not be accurate, unless you force the yading@10: reference stream key-frames at the given time. See the introductory yading@10: notice and the examples below. yading@10: yading@10: yading@10: =item B<segment_time_delta> I<delta> yading@10: yading@10: Specify the accuracy time when selecting the start time for a yading@10: segment, expressed as a duration specification. Default value is "0". yading@10: yading@10: When delta is specified a key-frame will start a new segment if its yading@10: PTS satisfies the relation: yading@10: yading@10: PTS >= start_time - time_delta yading@10: yading@10: yading@10: This option is useful when splitting video content, which is always yading@10: split at GOP boundaries, in case a key frame is found just before the yading@10: specified split time. yading@10: yading@10: In particular may be used in combination with the F<ffmpeg> option yading@10: I<force_key_frames>. The key frame times specified by yading@10: I<force_key_frames> may not be set accurately because of rounding yading@10: issues, with the consequence that a key frame time may result set just yading@10: before the specified time. For constant frame rate videos a value of yading@10: 1/2*I<frame_rate> should address the worst case mismatch between yading@10: the specified time and the time set by I<force_key_frames>. yading@10: yading@10: yading@10: =item B<segment_times> I<times> yading@10: yading@10: Specify a list of split points. I<times> contains a list of comma yading@10: separated duration specifications, in increasing order. See also yading@10: the B<segment_time> option. yading@10: yading@10: yading@10: =item B<segment_frames> I<frames> yading@10: yading@10: Specify a list of split video frame numbers. I<frames> contains a yading@10: list of comma separated integer numbers, in increasing order. yading@10: yading@10: This option specifies to start a new segment whenever a reference yading@10: stream key frame is found and the sequential number (starting from 0) yading@10: of the frame is greater or equal to the next value in the list. yading@10: yading@10: yading@10: =item B<segment_wrap> I<limit> yading@10: yading@10: Wrap around segment index once it reaches I<limit>. yading@10: yading@10: yading@10: =item B<segment_start_number> I<number> yading@10: yading@10: Set the sequence number of the first segment. Defaults to C<0>. yading@10: yading@10: yading@10: =item B<reset_timestamps> I<1|0> yading@10: yading@10: Reset timestamps at the begin of each segment, so that each segment yading@10: will start with near-zero timestamps. It is meant to ease the playback yading@10: of the generated segments. May not work with some combinations of yading@10: muxers/codecs. It is set to C<0> by default. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: To remux the content of file F<in.mkv> to a list of segments yading@10: F<out-000.nut>, F<out-001.nut>, etc., and write the list of yading@10: generated segments to F<out.list>: yading@10: yading@10: ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.list out%03d.nut yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: As the example above, but segment the input file according to the split yading@10: points specified by the I<segment_times> option: yading@10: yading@10: ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.csv -segment_times 1,2,3,5,8,13,21 out%03d.nut yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: As the example above, but use the C<ffmpeg> I<force_key_frames> yading@10: option to force key frames in the input at the specified location, together yading@10: with the segment option I<segment_time_delta> to account for yading@10: possible roundings operated when setting key frame times. yading@10: yading@10: ffmpeg -i in.mkv -force_key_frames 1,2,3,5,8,13,21 -codec:v mpeg4 -codec:a pcm_s16le -map 0 \ yading@10: -f segment -segment_list out.csv -segment_times 1,2,3,5,8,13,21 -segment_time_delta 0.05 out%03d.nut yading@10: yading@10: In order to force key frames on the input file, transcoding is yading@10: required. yading@10: yading@10: yading@10: =item * yading@10: yading@10: Segment the input file by splitting the input file according to the yading@10: frame numbers sequence specified with the I<segment_frames> option: yading@10: yading@10: ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.csv -segment_frames 100,200,300,500,800 out%03d.nut yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: To convert the F<in.mkv> to TS segments using the C<libx264> yading@10: and C<libfaac> encoders: yading@10: yading@10: ffmpeg -i in.mkv -map 0 -codec:v libx264 -codec:a libfaac -f ssegment -segment_list out.list out%03d.ts yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Segment the input file, and create an M3U8 live playlist (can be used yading@10: as live HLS source): yading@10: yading@10: ffmpeg -re -i in.mkv -codec copy -map 0 -f segment -segment_list playlist.m3u8 \ yading@10: -segment_list_flags +live -segment_time 10 out%03d.mkv yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 mp3 yading@10: yading@10: yading@10: The MP3 muxer writes a raw MP3 stream with an ID3v2 header at the beginning and yading@10: optionally an ID3v1 tag at the end. ID3v2.3 and ID3v2.4 are supported, the yading@10: C<id3v2_version> option controls which one is used. The legacy ID3v1 tag is yading@10: not written by default, but may be enabled with the C<write_id3v1> option. yading@10: yading@10: For seekable output the muxer also writes a Xing frame at the beginning, which yading@10: contains the number of frames in the file. It is useful for computing duration yading@10: of VBR files. yading@10: yading@10: The muxer supports writing ID3v2 attached pictures (APIC frames). The pictures yading@10: are supplied to the muxer in form of a video stream with a single packet. There yading@10: can be any number of those streams, each will correspond to a single APIC frame. yading@10: The stream metadata tags I<title> and I<comment> map to APIC yading@10: I<description> and I<picture type> respectively. See yading@10: E<lt>B<http://id3.org/id3v2.4.0-frames>E<gt> for allowed picture types. yading@10: yading@10: Note that the APIC frames must be written at the beginning, so the muxer will yading@10: buffer the audio frames until it gets all the pictures. It is therefore advised yading@10: to provide the pictures as soon as possible to avoid excessive buffering. yading@10: yading@10: Examples: yading@10: yading@10: Write an mp3 with an ID3v2.3 header and an ID3v1 footer: yading@10: yading@10: ffmpeg -i INPUT -id3v2_version 3 -write_id3v1 1 out.mp3 yading@10: yading@10: yading@10: To attach a picture to an mp3 file select both the audio and the picture stream yading@10: with C<map>: yading@10: yading@10: ffmpeg -i input.mp3 -i cover.png -c copy -map 0 -map 1 yading@10: -metadata:s:v title="Album cover" -metadata:s:v comment="Cover (Front)" out.mp3 yading@10: yading@10: yading@10: yading@10: =head2 ogg yading@10: yading@10: yading@10: Ogg container muxer. yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<-page_duration> I<duration> yading@10: yading@10: Preferred page duration, in microseconds. The muxer will attempt to create yading@10: pages that are approximately I<duration> microseconds long. This allows the yading@10: user to compromise between seek granularity and container overhead. The default yading@10: is 1 second. A value of 0 will fill all segments, making pages as large as yading@10: possible. A value of 1 will effectively use 1 packet-per-page in most yading@10: situations, giving a small seek granularity at the cost of additional container yading@10: overhead. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 tee yading@10: yading@10: yading@10: The tee muxer can be used to write the same data to several files or any yading@10: other kind of muxer. It can be used, for example, to both stream a video to yading@10: the network and save it to disk at the same time. yading@10: yading@10: It is different from specifying several outputs to the B<ffmpeg> yading@10: command-line tool because the audio and video data will be encoded only once yading@10: with the tee muxer; encoding can be a very expensive process. It is not yading@10: useful when using the libavformat API directly because it is then possible yading@10: to feed the same packets to several muxers directly. yading@10: yading@10: The slave outputs are specified in the file name given to the muxer, yading@10: separated by '|'. If any of the slave name contains the '|' separator, yading@10: leading or trailing spaces or any special character, it must be yading@10: escaped (see the ``Quoting and escaping'' section in the ffmpeg-utils yading@10: manual). yading@10: yading@10: Options can be specified for each slave by prepending them as a list of yading@10: I<key>=I<value> pairs separated by ':', between square brackets. If yading@10: the options values contain a special character or the ':' separator, they yading@10: must be escaped; note that this is a second level escaping. yading@10: yading@10: Example: encode something and both archive it in a WebM file and stream it yading@10: as MPEG-TS over UDP (the streams need to be explicitly mapped): yading@10: yading@10: yading@10: ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a yading@10: "archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/" yading@10: yading@10: yading@10: Note: some codecs may need different options depending on the output format; yading@10: the auto-detection of this can not work with the tee muxer. The main example yading@10: is the B<global_header> flag. yading@10: yading@10: yading@10: =head1 METADATA yading@10: yading@10: yading@10: FFmpeg is able to dump metadata from media files into a simple UTF-8-encoded yading@10: INI-like text file and then load it back using the metadata muxer/demuxer. yading@10: yading@10: The file format is as follows: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item 1. yading@10: yading@10: A file consists of a header and a number of metadata tags divided into sections, yading@10: each on its own line. yading@10: yading@10: yading@10: =item 2. yading@10: yading@10: The header is a ';FFMETADATA' string, followed by a version number (now 1). yading@10: yading@10: yading@10: =item 3. yading@10: yading@10: Metadata tags are of the form 'key=value' yading@10: yading@10: yading@10: =item 4. yading@10: yading@10: Immediately after header follows global metadata yading@10: yading@10: yading@10: =item 5. yading@10: yading@10: After global metadata there may be sections with per-stream/per-chapter yading@10: metadata. yading@10: yading@10: yading@10: =item 6. yading@10: yading@10: A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in yading@10: brackets ('[', ']') and ends with next section or end of file. yading@10: yading@10: yading@10: =item 7. yading@10: yading@10: At the beginning of a chapter section there may be an optional timebase to be yading@10: used for start/end values. It must be in form 'TIMEBASE=num/den', where num and yading@10: den are integers. If the timebase is missing then start/end times are assumed to yading@10: be in milliseconds. yading@10: Next a chapter section must contain chapter start and end times in form yading@10: 'START=num', 'END=num', where num is a positive integer. yading@10: yading@10: yading@10: =item 8. yading@10: yading@10: Empty lines and lines starting with ';' or '#' are ignored. yading@10: yading@10: yading@10: =item 9. yading@10: yading@10: Metadata keys or values containing special characters ('=', ';', '#', '\' and a yading@10: newline) must be escaped with a backslash '\'. yading@10: yading@10: yading@10: =item 10. yading@10: yading@10: Note that whitespace in metadata (e.g. foo = bar) is considered to be a part of yading@10: the tag (in the example above key is 'foo ', value is ' bar'). yading@10: yading@10: =back yading@10: yading@10: yading@10: A ffmetadata file might look like this: yading@10: yading@10: ;FFMETADATA1 yading@10: title=bike\\shed yading@10: ;this is a comment yading@10: artist=FFmpeg troll team yading@10: yading@10: [CHAPTER] yading@10: TIMEBASE=1/1000 yading@10: START=0 yading@10: #chapter ends at 0:01:00 yading@10: END=60000 yading@10: title=chapter \#1 yading@10: [STREAM] yading@10: title=multi\ yading@10: line yading@10: yading@10: yading@10: =head1 PROTOCOLS yading@10: yading@10: yading@10: Protocols are configured elements in FFmpeg which allow to access yading@10: resources which require the use of a particular protocol. yading@10: yading@10: When you configure your FFmpeg build, all the supported protocols are yading@10: enabled by default. You can list all available ones using the yading@10: configure option "--list-protocols". yading@10: yading@10: You can disable all the protocols using the configure option yading@10: "--disable-protocols", and selectively enable a protocol using the yading@10: option "--enable-protocol=I<PROTOCOL>", or you can disable a yading@10: particular protocol using the option yading@10: "--disable-protocol=I<PROTOCOL>". yading@10: yading@10: The option "-protocols" of the ff* tools will display the list of yading@10: supported protocols. yading@10: yading@10: A description of the currently available protocols follows. yading@10: yading@10: yading@10: =head2 bluray yading@10: yading@10: yading@10: Read BluRay playlist. yading@10: yading@10: The accepted options are: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<angle> yading@10: yading@10: BluRay angle yading@10: yading@10: yading@10: =item B<chapter> yading@10: yading@10: Start chapter (1...N) yading@10: yading@10: yading@10: =item B<playlist> yading@10: yading@10: Playlist to read (BDMV/PLAYLIST/?????.mpls) yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: Examples: yading@10: yading@10: Read longest playlist from BluRay mounted to /mnt/bluray: yading@10: yading@10: bluray:/mnt/bluray yading@10: yading@10: yading@10: Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2: yading@10: yading@10: -playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray yading@10: yading@10: yading@10: yading@10: =head2 concat yading@10: yading@10: yading@10: Physical concatenation protocol. yading@10: yading@10: Allow to read and seek from many resource in sequence as if they were yading@10: a unique resource. yading@10: yading@10: A URL accepted by this protocol has the syntax: yading@10: yading@10: concat:<URL1>|<URL2>|...|<URLN> yading@10: yading@10: yading@10: where I<URL1>, I<URL2>, ..., I<URLN> are the urls of the yading@10: resource to be concatenated, each one possibly specifying a distinct yading@10: protocol. yading@10: yading@10: For example to read a sequence of files F<split1.mpeg>, yading@10: F<split2.mpeg>, F<split3.mpeg> with B<ffplay> use the yading@10: command: yading@10: yading@10: ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg yading@10: yading@10: yading@10: Note that you may need to escape the character "|" which is special for yading@10: many shells. yading@10: yading@10: yading@10: =head2 data yading@10: yading@10: yading@10: Data in-line in the URI. See E<lt>B<http://en.wikipedia.org/wiki/Data_URI_scheme>E<gt>. yading@10: yading@10: For example, to convert a GIF file given inline with B<ffmpeg>: yading@10: yading@10: ffmpeg -i "data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=" smiley.png yading@10: yading@10: yading@10: yading@10: =head2 file yading@10: yading@10: yading@10: File access protocol. yading@10: yading@10: Allow to read from or read to a file. yading@10: yading@10: For example to read from a file F<input.mpeg> with B<ffmpeg> yading@10: use the command: yading@10: yading@10: ffmpeg -i file:input.mpeg output.mpeg yading@10: yading@10: yading@10: The ff* tools default to the file protocol, that is a resource yading@10: specified with the name "FILE.mpeg" is interpreted as the URL yading@10: "file:FILE.mpeg". yading@10: yading@10: yading@10: =head2 gopher yading@10: yading@10: yading@10: Gopher protocol. yading@10: yading@10: yading@10: =head2 hls yading@10: yading@10: yading@10: Read Apple HTTP Live Streaming compliant segmented stream as yading@10: a uniform one. The M3U8 playlists describing the segments can be yading@10: remote HTTP resources or local files, accessed using the standard yading@10: file protocol. yading@10: The nested protocol is declared by specifying yading@10: "+I<proto>" after the hls URI scheme name, where I<proto> yading@10: is either "file" or "http". yading@10: yading@10: yading@10: hls+http://host/path/to/remote/resource.m3u8 yading@10: hls+file://path/to/local/resource.m3u8 yading@10: yading@10: yading@10: Using this protocol is discouraged - the hls demuxer should work yading@10: just as well (if not, please report the issues) and is more complete. yading@10: To use the hls demuxer instead, simply use the direct URLs to the yading@10: m3u8 files. yading@10: yading@10: yading@10: =head2 http yading@10: yading@10: yading@10: HTTP (Hyper Text Transfer Protocol). yading@10: yading@10: This protocol accepts the following options. yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<seekable> yading@10: yading@10: Control seekability of connection. If set to 1 the resource is yading@10: supposed to be seekable, if set to 0 it is assumed not to be seekable, yading@10: if set to -1 it will try to autodetect if it is seekable. Default yading@10: value is -1. yading@10: yading@10: yading@10: =item B<chunked_post> yading@10: yading@10: If set to 1 use chunked transfer-encoding for posts, default is 1. yading@10: yading@10: yading@10: =item B<headers> yading@10: yading@10: Set custom HTTP headers, can override built in default headers. The yading@10: value must be a string encoding the headers. yading@10: yading@10: yading@10: =item B<content_type> yading@10: yading@10: Force a content type. yading@10: yading@10: yading@10: =item B<user-agent> yading@10: yading@10: Override User-Agent header. If not specified the protocol will use a yading@10: string describing the libavformat build. yading@10: yading@10: yading@10: =item B<multiple_requests> yading@10: yading@10: Use persistent connections if set to 1. By default it is 0. yading@10: yading@10: yading@10: =item B<post_data> yading@10: yading@10: Set custom HTTP post data. yading@10: yading@10: yading@10: =item B<timeout> yading@10: yading@10: Set timeout of socket I/O operations used by the underlying low level yading@10: operation. By default it is set to -1, which means that the timeout is yading@10: not specified. yading@10: yading@10: yading@10: =item B<mime_type> yading@10: yading@10: Set MIME type. yading@10: yading@10: yading@10: =item B<cookies> yading@10: yading@10: Set the cookies to be sent in future requests. The format of each cookie is the yading@10: same as the value of a Set-Cookie HTTP response field. Multiple cookies can be yading@10: delimited by a newline character. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 HTTP Cookies yading@10: yading@10: yading@10: Some HTTP requests will be denied unless cookie values are passed in with the yading@10: request. The B<cookies> option allows these cookies to be specified. At yading@10: the very least, each cookie must specify a value along with a path and domain. yading@10: HTTP requests that match both the domain and path will automatically include the yading@10: cookie value in the HTTP Cookie header field. Multiple cookies can be delimited yading@10: by a newline. yading@10: yading@10: The required syntax to play a stream specifying a cookie is: yading@10: yading@10: ffplay -cookies "nlqptid=nltid=tsn; path=/; domain=somedomain.com;" http://somedomain.com/somestream.m3u8 yading@10: yading@10: yading@10: yading@10: =head2 mmst yading@10: yading@10: yading@10: MMS (Microsoft Media Server) protocol over TCP. yading@10: yading@10: yading@10: =head2 mmsh yading@10: yading@10: yading@10: MMS (Microsoft Media Server) protocol over HTTP. yading@10: yading@10: The required syntax is: yading@10: yading@10: mmsh://<server>[:<port>][/<app>][/<playpath>] yading@10: yading@10: yading@10: yading@10: =head2 md5 yading@10: yading@10: yading@10: MD5 output protocol. yading@10: yading@10: Computes the MD5 hash of the data to be written, and on close writes yading@10: this to the designated output or stdout if none is specified. It can yading@10: be used to test muxers without writing an actual file. yading@10: yading@10: Some examples follow. yading@10: yading@10: # Write the MD5 hash of the encoded AVI file to the file output.avi.md5. yading@10: ffmpeg -i input.flv -f avi -y md5:output.avi.md5 yading@10: yading@10: # Write the MD5 hash of the encoded AVI file to stdout. yading@10: ffmpeg -i input.flv -f avi -y md5: yading@10: yading@10: yading@10: Note that some formats (typically MOV) require the output protocol to yading@10: be seekable, so they will fail with the MD5 output protocol. yading@10: yading@10: yading@10: =head2 pipe yading@10: yading@10: yading@10: UNIX pipe access protocol. yading@10: yading@10: Allow to read and write from UNIX pipes. yading@10: yading@10: The accepted syntax is: yading@10: yading@10: pipe:[<number>] yading@10: yading@10: yading@10: I<number> is the number corresponding to the file descriptor of the yading@10: pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If I<number> yading@10: is not specified, by default the stdout file descriptor will be used yading@10: for writing, stdin for reading. yading@10: yading@10: For example to read from stdin with B<ffmpeg>: yading@10: yading@10: cat test.wav | ffmpeg -i pipe:0 yading@10: # ...this is the same as... yading@10: cat test.wav | ffmpeg -i pipe: yading@10: yading@10: yading@10: For writing to stdout with B<ffmpeg>: yading@10: yading@10: ffmpeg -i test.wav -f avi pipe:1 | cat > test.avi yading@10: # ...this is the same as... yading@10: ffmpeg -i test.wav -f avi pipe: | cat > test.avi yading@10: yading@10: yading@10: Note that some formats (typically MOV), require the output protocol to yading@10: be seekable, so they will fail with the pipe output protocol. yading@10: yading@10: yading@10: =head2 rtmp yading@10: yading@10: yading@10: Real-Time Messaging Protocol. yading@10: yading@10: The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia yading@10: content across a TCP/IP network. yading@10: yading@10: The required syntax is: yading@10: yading@10: rtmp://<server>[:<port>][/<app>][/<instance>][/<playpath>] yading@10: yading@10: yading@10: The accepted parameters are: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<server> yading@10: yading@10: The address of the RTMP server. yading@10: yading@10: yading@10: =item B<port> yading@10: yading@10: The number of the TCP port to use (by default is 1935). yading@10: yading@10: yading@10: =item B<app> yading@10: yading@10: It is the name of the application to access. It usually corresponds to yading@10: the path where the application is installed on the RTMP server yading@10: (e.g. F</ondemand/>, F</flash/live/>, etc.). You can override yading@10: the value parsed from the URI through the C<rtmp_app> option, too. yading@10: yading@10: yading@10: =item B<playpath> yading@10: yading@10: It is the path or name of the resource to play with reference to the yading@10: application specified in I<app>, may be prefixed by "mp4:". You yading@10: can override the value parsed from the URI through the C<rtmp_playpath> yading@10: option, too. yading@10: yading@10: yading@10: =item B<listen> yading@10: yading@10: Act as a server, listening for an incoming connection. yading@10: yading@10: yading@10: =item B<timeout> yading@10: yading@10: Maximum time to wait for the incoming connection. Implies listen. yading@10: yading@10: =back yading@10: yading@10: yading@10: Additionally, the following parameters can be set via command line options yading@10: (or in code via C<AVOption>s): yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<rtmp_app> yading@10: yading@10: Name of application to connect on the RTMP server. This option yading@10: overrides the parameter specified in the URI. yading@10: yading@10: yading@10: =item B<rtmp_buffer> yading@10: yading@10: Set the client buffer time in milliseconds. The default is 3000. yading@10: yading@10: yading@10: =item B<rtmp_conn> yading@10: yading@10: Extra arbitrary AMF connection parameters, parsed from a string, yading@10: e.g. like C<B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0>. yading@10: Each value is prefixed by a single character denoting the type, yading@10: B for Boolean, N for number, S for string, O for object, or Z for null, yading@10: followed by a colon. For Booleans the data must be either 0 or 1 for yading@10: FALSE or TRUE, respectively. Likewise for Objects the data must be 0 or yading@10: 1 to end or begin an object, respectively. Data items in subobjects may yading@10: be named, by prefixing the type with 'N' and specifying the name before yading@10: the value (i.e. C<NB:myFlag:1>). This option may be used multiple yading@10: times to construct arbitrary AMF sequences. yading@10: yading@10: yading@10: =item B<rtmp_flashver> yading@10: yading@10: Version of the Flash plugin used to run the SWF player. The default yading@10: is LNX 9,0,124,2. yading@10: yading@10: yading@10: =item B<rtmp_flush_interval> yading@10: yading@10: Number of packets flushed in the same request (RTMPT only). The default yading@10: is 10. yading@10: yading@10: yading@10: =item B<rtmp_live> yading@10: yading@10: Specify that the media is a live stream. No resuming or seeking in yading@10: live streams is possible. The default value is C<any>, which means the yading@10: subscriber first tries to play the live stream specified in the yading@10: playpath. If a live stream of that name is not found, it plays the yading@10: recorded stream. The other possible values are C<live> and yading@10: C<recorded>. yading@10: yading@10: yading@10: =item B<rtmp_pageurl> yading@10: yading@10: URL of the web page in which the media was embedded. By default no yading@10: value will be sent. yading@10: yading@10: yading@10: =item B<rtmp_playpath> yading@10: yading@10: Stream identifier to play or to publish. This option overrides the yading@10: parameter specified in the URI. yading@10: yading@10: yading@10: =item B<rtmp_subscribe> yading@10: yading@10: Name of live stream to subscribe to. By default no value will be sent. yading@10: It is only sent if the option is specified or if rtmp_live yading@10: is set to live. yading@10: yading@10: yading@10: =item B<rtmp_swfhash> yading@10: yading@10: SHA256 hash of the decompressed SWF file (32 bytes). yading@10: yading@10: yading@10: =item B<rtmp_swfsize> yading@10: yading@10: Size of the decompressed SWF file, required for SWFVerification. yading@10: yading@10: yading@10: =item B<rtmp_swfurl> yading@10: yading@10: URL of the SWF player for the media. By default no value will be sent. yading@10: yading@10: yading@10: =item B<rtmp_swfverify> yading@10: yading@10: URL to player swf file, compute hash/size automatically. yading@10: yading@10: yading@10: =item B<rtmp_tcurl> yading@10: yading@10: URL of the target stream. Defaults to proto://host[:port]/app. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: For example to read with B<ffplay> a multimedia resource named yading@10: "sample" from the application "vod" from an RTMP server "myserver": yading@10: yading@10: ffplay rtmp://myserver/vod/sample yading@10: yading@10: yading@10: yading@10: =head2 rtmpe yading@10: yading@10: yading@10: Encrypted Real-Time Messaging Protocol. yading@10: yading@10: The Encrypted Real-Time Messaging Protocol (RTMPE) is used for yading@10: streaming multimedia content within standard cryptographic primitives, yading@10: consisting of Diffie-Hellman key exchange and HMACSHA256, generating yading@10: a pair of RC4 keys. yading@10: yading@10: yading@10: =head2 rtmps yading@10: yading@10: yading@10: Real-Time Messaging Protocol over a secure SSL connection. yading@10: yading@10: The Real-Time Messaging Protocol (RTMPS) is used for streaming yading@10: multimedia content across an encrypted connection. yading@10: yading@10: yading@10: =head2 rtmpt yading@10: yading@10: yading@10: Real-Time Messaging Protocol tunneled through HTTP. yading@10: yading@10: The Real-Time Messaging Protocol tunneled through HTTP (RTMPT) is used yading@10: for streaming multimedia content within HTTP requests to traverse yading@10: firewalls. yading@10: yading@10: yading@10: =head2 rtmpte yading@10: yading@10: yading@10: Encrypted Real-Time Messaging Protocol tunneled through HTTP. yading@10: yading@10: The Encrypted Real-Time Messaging Protocol tunneled through HTTP (RTMPTE) yading@10: is used for streaming multimedia content within HTTP requests to traverse yading@10: firewalls. yading@10: yading@10: yading@10: =head2 rtmpts yading@10: yading@10: yading@10: Real-Time Messaging Protocol tunneled through HTTPS. yading@10: yading@10: The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used yading@10: for streaming multimedia content within HTTPS requests to traverse yading@10: firewalls. yading@10: yading@10: yading@10: =head2 rtmp, rtmpe, rtmps, rtmpt, rtmpte yading@10: yading@10: yading@10: Real-Time Messaging Protocol and its variants supported through yading@10: librtmp. yading@10: yading@10: Requires the presence of the librtmp headers and library during yading@10: configuration. You need to explicitly configure the build with yading@10: "--enable-librtmp". If enabled this will replace the native RTMP yading@10: protocol. yading@10: yading@10: This protocol provides most client functions and a few server yading@10: functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT), yading@10: encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled yading@10: variants of these encrypted types (RTMPTE, RTMPTS). yading@10: yading@10: The required syntax is: yading@10: yading@10: <rtmp_proto>://<server>[:<port>][/<app>][/<playpath>] <options> yading@10: yading@10: yading@10: where I<rtmp_proto> is one of the strings "rtmp", "rtmpt", "rtmpe", yading@10: "rtmps", "rtmpte", "rtmpts" corresponding to each RTMP variant, and yading@10: I<server>, I<port>, I<app> and I<playpath> have the same yading@10: meaning as specified for the RTMP native protocol. yading@10: I<options> contains a list of space-separated options of the form yading@10: I<key>=I<val>. yading@10: yading@10: See the librtmp manual page (man 3 librtmp) for more information. yading@10: yading@10: For example, to stream a file in real-time to an RTMP server using yading@10: B<ffmpeg>: yading@10: yading@10: ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream yading@10: yading@10: yading@10: To play the same stream using B<ffplay>: yading@10: yading@10: ffplay "rtmp://myserver/live/mystream live=1" yading@10: yading@10: yading@10: yading@10: =head2 rtp yading@10: yading@10: yading@10: Real-Time Protocol. yading@10: yading@10: yading@10: =head2 rtsp yading@10: yading@10: yading@10: RTSP is not technically a protocol handler in libavformat, it is a demuxer yading@10: and muxer. The demuxer supports both normal RTSP (with data transferred yading@10: over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with yading@10: data transferred over RDT). yading@10: yading@10: The muxer can be used to send a stream using RTSP ANNOUNCE to a server yading@10: supporting it (currently Darwin Streaming Server and Mischa Spiegelmock's yading@10: E<lt>B<http://github.com/revmischa/rtsp-server>E<gt>). yading@10: yading@10: The required syntax for a RTSP url is: yading@10: yading@10: rtsp://<hostname>[:<port>]/<path> yading@10: yading@10: yading@10: The following options (set on the B<ffmpeg>/B<ffplay> command yading@10: line, or set in code via C<AVOption>s or in C<avformat_open_input>), yading@10: are supported: yading@10: yading@10: Flags for C<rtsp_transport>: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<udp> yading@10: yading@10: Use UDP as lower transport protocol. yading@10: yading@10: yading@10: =item B<tcp> yading@10: yading@10: Use TCP (interleaving within the RTSP control channel) as lower yading@10: transport protocol. yading@10: yading@10: yading@10: =item B<udp_multicast> yading@10: yading@10: Use UDP multicast as lower transport protocol. yading@10: yading@10: yading@10: =item B<http> yading@10: yading@10: Use HTTP tunneling as lower transport protocol, which is useful for yading@10: passing proxies. yading@10: yading@10: =back yading@10: yading@10: yading@10: Multiple lower transport protocols may be specified, in that case they are yading@10: tried one at a time (if the setup of one fails, the next one is tried). yading@10: For the muxer, only the C<tcp> and C<udp> options are supported. yading@10: yading@10: Flags for C<rtsp_flags>: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<filter_src> yading@10: yading@10: Accept packets only from negotiated peer address and port. yading@10: yading@10: =item B<listen> yading@10: yading@10: Act as a server, listening for an incoming connection. yading@10: yading@10: =back yading@10: yading@10: yading@10: When receiving data over UDP, the demuxer tries to reorder received packets yading@10: (since they may arrive out of order, or packets may get lost totally). This yading@10: can be disabled by setting the maximum demuxing delay to zero (via yading@10: the C<max_delay> field of AVFormatContext). yading@10: yading@10: When watching multi-bitrate Real-RTSP streams with B<ffplay>, the yading@10: streams to display can be chosen with C<-vst> I<n> and yading@10: C<-ast> I<n> for video and audio respectively, and can be switched yading@10: on the fly by pressing C<v> and C<a>. yading@10: yading@10: Example command lines: yading@10: yading@10: To watch a stream over UDP, with a max reordering delay of 0.5 seconds: yading@10: yading@10: yading@10: ffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4 yading@10: yading@10: yading@10: To watch a stream tunneled over HTTP: yading@10: yading@10: yading@10: ffplay -rtsp_transport http rtsp://server/video.mp4 yading@10: yading@10: yading@10: To send a stream in realtime to a RTSP server, for others to watch: yading@10: yading@10: yading@10: ffmpeg -re -i <input> -f rtsp -muxdelay 0.1 rtsp://server/live.sdp yading@10: yading@10: yading@10: To receive a stream in realtime: yading@10: yading@10: yading@10: ffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp <output> yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<stimeout> yading@10: yading@10: Socket IO timeout in micro seconds. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 sap yading@10: yading@10: yading@10: Session Announcement Protocol (RFC 2974). This is not technically a yading@10: protocol handler in libavformat, it is a muxer and demuxer. yading@10: It is used for signalling of RTP streams, by announcing the SDP for the yading@10: streams regularly on a separate port. yading@10: yading@10: yading@10: =head3 Muxer yading@10: yading@10: yading@10: The syntax for a SAP url given to the muxer is: yading@10: yading@10: sap://<destination>[:<port>][?<options>] yading@10: yading@10: yading@10: The RTP packets are sent to I<destination> on port I<port>, yading@10: or to port 5004 if no port is specified. yading@10: I<options> is a C<&>-separated list. The following options yading@10: are supported: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<announce_addr=>I<address> yading@10: yading@10: Specify the destination IP address for sending the announcements to. yading@10: If omitted, the announcements are sent to the commonly used SAP yading@10: announcement multicast address 224.2.127.254 (sap.mcast.net), or yading@10: ff0e::2:7ffe if I<destination> is an IPv6 address. yading@10: yading@10: yading@10: =item B<announce_port=>I<port> yading@10: yading@10: Specify the port to send the announcements on, defaults to yading@10: 9875 if not specified. yading@10: yading@10: yading@10: =item B<ttl=>I<ttl> yading@10: yading@10: Specify the time to live value for the announcements and RTP packets, yading@10: defaults to 255. yading@10: yading@10: yading@10: =item B<same_port=>I<0|1> yading@10: yading@10: If set to 1, send all RTP streams on the same port pair. If zero (the yading@10: default), all streams are sent on unique ports, with each stream on a yading@10: port 2 numbers higher than the previous. yading@10: VLC/Live555 requires this to be set to 1, to be able to receive the stream. yading@10: The RTP stack in libavformat for receiving requires all streams to be sent yading@10: on unique ports. yading@10: yading@10: =back yading@10: yading@10: yading@10: Example command lines follow. yading@10: yading@10: To broadcast a stream on the local subnet, for watching in VLC: yading@10: yading@10: yading@10: ffmpeg -re -i <input> -f sap sap://224.0.0.255?same_port=1 yading@10: yading@10: yading@10: Similarly, for watching in B<ffplay>: yading@10: yading@10: yading@10: ffmpeg -re -i <input> -f sap sap://224.0.0.255 yading@10: yading@10: yading@10: And for watching in B<ffplay>, over IPv6: yading@10: yading@10: yading@10: ffmpeg -re -i <input> -f sap sap://[ff0e::1:2:3:4] yading@10: yading@10: yading@10: yading@10: =head3 Demuxer yading@10: yading@10: yading@10: The syntax for a SAP url given to the demuxer is: yading@10: yading@10: sap://[<address>][:<port>] yading@10: yading@10: yading@10: I<address> is the multicast address to listen for announcements on, yading@10: if omitted, the default 224.2.127.254 (sap.mcast.net) is used. I<port> yading@10: is the port that is listened on, 9875 if omitted. yading@10: yading@10: The demuxers listens for announcements on the given address and port. yading@10: Once an announcement is received, it tries to receive that particular stream. yading@10: yading@10: Example command lines follow. yading@10: yading@10: To play back the first stream announced on the normal SAP multicast address: yading@10: yading@10: yading@10: ffplay sap:// yading@10: yading@10: yading@10: To play back the first stream announced on one the default IPv6 SAP multicast address: yading@10: yading@10: yading@10: ffplay sap://[ff0e::2:7ffe] yading@10: yading@10: yading@10: yading@10: =head2 tcp yading@10: yading@10: yading@10: Trasmission Control Protocol. yading@10: yading@10: The required syntax for a TCP url is: yading@10: yading@10: tcp://<hostname>:<port>[?<options>] yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<listen> yading@10: yading@10: Listen for an incoming connection yading@10: yading@10: yading@10: =item B<timeout=>I<microseconds> yading@10: yading@10: In read mode: if no data arrived in more than this time interval, raise error. yading@10: In write mode: if socket cannot be written in more than this time interval, raise error. yading@10: This also sets timeout on TCP connection establishing. yading@10: yading@10: yading@10: ffmpeg -i <input> -f <format> tcp://<hostname>:<port>?listen yading@10: ffplay tcp://<hostname>:<port> yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 tls yading@10: yading@10: yading@10: Transport Layer Security/Secure Sockets Layer yading@10: yading@10: The required syntax for a TLS/SSL url is: yading@10: yading@10: tls://<hostname>:<port>[?<options>] yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<listen> yading@10: yading@10: Act as a server, listening for an incoming connection. yading@10: yading@10: yading@10: =item B<cafile=>I<filename> yading@10: yading@10: Certificate authority file. The file must be in OpenSSL PEM format. yading@10: yading@10: yading@10: =item B<cert=>I<filename> yading@10: yading@10: Certificate file. The file must be in OpenSSL PEM format. yading@10: yading@10: yading@10: =item B<key=>I<filename> yading@10: yading@10: Private key file. yading@10: yading@10: yading@10: =item B<verify=>I<0|1> yading@10: yading@10: Verify the peer's certificate. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: Example command lines: yading@10: yading@10: To create a TLS/SSL server that serves an input stream. yading@10: yading@10: yading@10: ffmpeg -i <input> -f <format> tls://<hostname>:<port>?listen&cert=<server.crt>&key=<server.key> yading@10: yading@10: yading@10: To play back a stream from the TLS/SSL server using B<ffplay>: yading@10: yading@10: yading@10: ffplay tls://<hostname>:<port> yading@10: yading@10: yading@10: yading@10: =head2 udp yading@10: yading@10: yading@10: User Datagram Protocol. yading@10: yading@10: The required syntax for a UDP url is: yading@10: yading@10: udp://<hostname>:<port>[?<options>] yading@10: yading@10: yading@10: I<options> contains a list of &-separated options of the form I<key>=I<val>. yading@10: yading@10: In case threading is enabled on the system, a circular buffer is used yading@10: to store the incoming data, which allows to reduce loss of data due to yading@10: UDP socket buffer overruns. The I<fifo_size> and yading@10: I<overrun_nonfatal> options are related to this buffer. yading@10: yading@10: The list of supported options follows. yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<buffer_size=>I<size> yading@10: yading@10: Set the UDP socket buffer size in bytes. This is used both for the yading@10: receiving and the sending buffer size. yading@10: yading@10: yading@10: =item B<localport=>I<port> yading@10: yading@10: Override the local UDP port to bind with. yading@10: yading@10: yading@10: =item B<localaddr=>I<addr> yading@10: yading@10: Choose the local IP address. This is useful e.g. if sending multicast yading@10: and the host has multiple interfaces, where the user can choose yading@10: which interface to send on by specifying the IP address of that interface. yading@10: yading@10: yading@10: =item B<pkt_size=>I<size> yading@10: yading@10: Set the size in bytes of UDP packets. yading@10: yading@10: yading@10: =item B<reuse=>I<1|0> yading@10: yading@10: Explicitly allow or disallow reusing UDP sockets. yading@10: yading@10: yading@10: =item B<ttl=>I<ttl> yading@10: yading@10: Set the time to live value (for multicast only). yading@10: yading@10: yading@10: =item B<connect=>I<1|0> yading@10: yading@10: Initialize the UDP socket with C<connect()>. In this case, the yading@10: destination address can't be changed with ff_udp_set_remote_url later. yading@10: If the destination address isn't known at the start, this option can yading@10: be specified in ff_udp_set_remote_url, too. yading@10: This allows finding out the source address for the packets with getsockname, yading@10: and makes writes return with AVERROR(ECONNREFUSED) if "destination yading@10: unreachable" is received. yading@10: For receiving, this gives the benefit of only receiving packets from yading@10: the specified peer address/port. yading@10: yading@10: yading@10: =item B<sources=>I<address>B<[,>I<address>B<]> yading@10: yading@10: Only receive packets sent to the multicast group from one of the yading@10: specified sender IP addresses. yading@10: yading@10: yading@10: =item B<block=>I<address>B<[,>I<address>B<]> yading@10: yading@10: Ignore packets sent to the multicast group from the specified yading@10: sender IP addresses. yading@10: yading@10: yading@10: =item B<fifo_size=>I<units> yading@10: yading@10: Set the UDP receiving circular buffer size, expressed as a number of yading@10: packets with size of 188 bytes. If not specified defaults to 7*4096. yading@10: yading@10: yading@10: =item B<overrun_nonfatal=>I<1|0> yading@10: yading@10: Survive in case of UDP receiving circular buffer overrun. Default yading@10: value is 0. yading@10: yading@10: yading@10: =item B<timeout=>I<microseconds> yading@10: yading@10: In read mode: if no data arrived in more than this time interval, raise error. yading@10: yading@10: =back yading@10: yading@10: yading@10: Some usage examples of the UDP protocol with B<ffmpeg> follow. yading@10: yading@10: To stream over UDP to a remote endpoint: yading@10: yading@10: ffmpeg -i <input> -f <format> udp://<hostname>:<port> yading@10: yading@10: yading@10: To stream in mpegts format over UDP using 188 sized UDP packets, using a large input buffer: yading@10: yading@10: ffmpeg -i <input> -f mpegts udp://<hostname>:<port>?pkt_size=188&buffer_size=65535 yading@10: yading@10: yading@10: To receive over UDP from a remote endpoint: yading@10: yading@10: ffmpeg -i udp://[<multicast-address>]:<port> yading@10: yading@10: yading@10: yading@10: yading@10: =head1 DEVICE OPTIONS yading@10: yading@10: yading@10: The libavdevice library provides the same interface as yading@10: libavformat. Namely, an input device is considered like a demuxer, and yading@10: an output device like a muxer, and the interface and generic device yading@10: options are the same provided by libavformat (see the ffmpeg-formats yading@10: manual). yading@10: yading@10: In addition each input or output device may support so-called private yading@10: options, which are specific for that component. yading@10: yading@10: Options may be set by specifying -I<option> I<value> in the yading@10: FFmpeg tools, or by setting the value explicitly in the device yading@10: C<AVFormatContext> options or using the F<libavutil/opt.h> API yading@10: for programmatic use. yading@10: yading@10: yading@10: yading@10: =head1 INPUT DEVICES yading@10: yading@10: yading@10: Input devices are configured elements in FFmpeg which allow to access yading@10: the data coming from a multimedia device attached to your system. yading@10: yading@10: When you configure your FFmpeg build, all the supported input devices yading@10: are enabled by default. You can list all available ones using the yading@10: configure option "--list-indevs". yading@10: yading@10: You can disable all the input devices using the configure option yading@10: "--disable-indevs", and selectively enable an input device using the yading@10: option "--enable-indev=I<INDEV>", or you can disable a particular yading@10: input device using the option "--disable-indev=I<INDEV>". yading@10: yading@10: The option "-formats" of the ff* tools will display the list of yading@10: supported input devices (amongst the demuxers). yading@10: yading@10: A description of the currently available input devices follows. yading@10: yading@10: yading@10: =head2 alsa yading@10: yading@10: yading@10: ALSA (Advanced Linux Sound Architecture) input device. yading@10: yading@10: To enable this input device during configuration you need libasound yading@10: installed on your system. yading@10: yading@10: This device allows capturing from an ALSA device. The name of the yading@10: device to capture has to be an ALSA card identifier. yading@10: yading@10: An ALSA identifier has the syntax: yading@10: yading@10: hw:<CARD>[,<DEV>[,<SUBDEV>]] yading@10: yading@10: yading@10: where the I<DEV> and I<SUBDEV> components are optional. yading@10: yading@10: The three arguments (in order: I<CARD>,I<DEV>,I<SUBDEV>) yading@10: specify card number or identifier, device number and subdevice number yading@10: (-1 means any). yading@10: yading@10: To see the list of cards currently recognized by your system check the yading@10: files F</proc/asound/cards> and F</proc/asound/devices>. yading@10: yading@10: For example to capture with B<ffmpeg> from an ALSA device with yading@10: card id 0, you may run the command: yading@10: yading@10: ffmpeg -f alsa -i hw:0 alsaout.wav yading@10: yading@10: yading@10: For more information see: yading@10: E<lt>B<http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html>E<gt> yading@10: yading@10: yading@10: =head2 bktr yading@10: yading@10: yading@10: BSD video input device. yading@10: yading@10: yading@10: =head2 dshow yading@10: yading@10: yading@10: Windows DirectShow input device. yading@10: yading@10: DirectShow support is enabled when FFmpeg is built with the mingw-w64 project. yading@10: Currently only audio and video devices are supported. yading@10: yading@10: Multiple devices may be opened as separate inputs, but they may also be yading@10: opened on the same input, which should improve synchronism between them. yading@10: yading@10: The input name should be in the format: yading@10: yading@10: yading@10: <TYPE>=<NAME>[:<TYPE>=<NAME>] yading@10: yading@10: yading@10: where I<TYPE> can be either I<audio> or I<video>, yading@10: and I<NAME> is the device's name. yading@10: yading@10: yading@10: =head3 Options yading@10: yading@10: yading@10: If no options are specified, the device's defaults are used. yading@10: If the device does not support the requested options, it will yading@10: fail to open. yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<video_size> yading@10: yading@10: Set the video size in the captured video. yading@10: yading@10: yading@10: =item B<framerate> yading@10: yading@10: Set the frame rate in the captured video. yading@10: yading@10: yading@10: =item B<sample_rate> yading@10: yading@10: Set the sample rate (in Hz) of the captured audio. yading@10: yading@10: yading@10: =item B<sample_size> yading@10: yading@10: Set the sample size (in bits) of the captured audio. yading@10: yading@10: yading@10: =item B<channels> yading@10: yading@10: Set the number of channels in the captured audio. yading@10: yading@10: yading@10: =item B<list_devices> yading@10: yading@10: If set to B<true>, print a list of devices and exit. yading@10: yading@10: yading@10: =item B<list_options> yading@10: yading@10: If set to B<true>, print a list of selected device's options yading@10: and exit. yading@10: yading@10: yading@10: =item B<video_device_number> yading@10: yading@10: Set video device number for devices with same name (starts at 0, yading@10: defaults to 0). yading@10: yading@10: yading@10: =item B<audio_device_number> yading@10: yading@10: Set audio device number for devices with same name (starts at 0, yading@10: defaults to 0). yading@10: yading@10: yading@10: =item B<pixel_format> yading@10: yading@10: Select pixel format to be used by DirectShow. This may only be set when yading@10: the video codec is not set or set to rawvideo. yading@10: yading@10: yading@10: =item B<audio_buffer_size> yading@10: yading@10: Set audio device buffer size in milliseconds (which can directly yading@10: impact latency, depending on the device). yading@10: Defaults to using the audio device's yading@10: default buffer size (typically some multiple of 500ms). yading@10: Setting this value too low can degrade performance. yading@10: See also yading@10: E<lt>B<http://msdn.microsoft.com/en-us/library/windows/desktop/dd377582(v=vs.85).aspx>E<gt> yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Print the list of DirectShow supported devices and exit: yading@10: yading@10: $ ffmpeg -list_devices true -f dshow -i dummy yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Open video device I<Camera>: yading@10: yading@10: $ ffmpeg -f dshow -i video="Camera" yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Open second video device with name I<Camera>: yading@10: yading@10: $ ffmpeg -f dshow -video_device_number 1 -i video="Camera" yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Open video device I<Camera> and audio device I<Microphone>: yading@10: yading@10: $ ffmpeg -f dshow -i video="Camera":audio="Microphone" yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Print the list of supported options in selected device and exit: yading@10: yading@10: $ ffmpeg -list_options true -f dshow -i video="Camera" yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 dv1394 yading@10: yading@10: yading@10: Linux DV 1394 input device. yading@10: yading@10: yading@10: =head2 fbdev yading@10: yading@10: yading@10: Linux framebuffer input device. yading@10: yading@10: The Linux framebuffer is a graphic hardware-independent abstraction yading@10: layer to show graphics on a computer monitor, typically on the yading@10: console. It is accessed through a file device node, usually yading@10: F</dev/fb0>. yading@10: yading@10: For more detailed information read the file yading@10: Documentation/fb/framebuffer.txt included in the Linux source tree. yading@10: yading@10: To record from the framebuffer device F</dev/fb0> with yading@10: B<ffmpeg>: yading@10: yading@10: ffmpeg -f fbdev -r 10 -i /dev/fb0 out.avi yading@10: yading@10: yading@10: You can take a single screenshot image with the command: yading@10: yading@10: ffmpeg -f fbdev -frames:v 1 -r 1 -i /dev/fb0 screenshot.jpeg yading@10: yading@10: yading@10: See also E<lt>B<http://linux-fbdev.sourceforge.net/>E<gt>, and fbset(1). yading@10: yading@10: yading@10: =head2 iec61883 yading@10: yading@10: yading@10: FireWire DV/HDV input device using libiec61883. yading@10: yading@10: To enable this input device, you need libiec61883, libraw1394 and yading@10: libavc1394 installed on your system. Use the configure option yading@10: C<--enable-libiec61883> to compile with the device enabled. yading@10: yading@10: The iec61883 capture device supports capturing from a video device yading@10: connected via IEEE1394 (FireWire), using libiec61883 and the new Linux yading@10: FireWire stack (juju). This is the default DV/HDV input method in Linux yading@10: Kernel 2.6.37 and later, since the old FireWire stack was removed. yading@10: yading@10: Specify the FireWire port to be used as input file, or "auto" yading@10: to choose the first port connected. yading@10: yading@10: yading@10: =head3 Options yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<dvtype> yading@10: yading@10: Override autodetection of DV/HDV. This should only be used if auto yading@10: detection does not work, or if usage of a different device type yading@10: should be prohibited. Treating a DV device as HDV (or vice versa) will yading@10: not work and result in undefined behavior. yading@10: The values B<auto>, B<dv> and B<hdv> are supported. yading@10: yading@10: yading@10: =item B<dvbuffer> yading@10: yading@10: Set maxiumum size of buffer for incoming data, in frames. For DV, this yading@10: is an exact value. For HDV, it is not frame exact, since HDV does yading@10: not have a fixed frame size. yading@10: yading@10: yading@10: =item B<dvguid> yading@10: yading@10: Select the capture device by specifying it's GUID. Capturing will only yading@10: be performed from the specified device and fails if no device with the yading@10: given GUID is found. This is useful to select the input if multiple yading@10: devices are connected at the same time. yading@10: Look at /sys/bus/firewire/devices to find out the GUIDs. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Grab and show the input of a FireWire DV/HDV device. yading@10: yading@10: ffplay -f iec61883 -i auto yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Grab and record the input of a FireWire DV/HDV device, yading@10: using a packet buffer of 100000 packets if the source is HDV. yading@10: yading@10: ffmpeg -f iec61883 -i auto -hdvbuffer 100000 out.mpg yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 jack yading@10: yading@10: yading@10: JACK input device. yading@10: yading@10: To enable this input device during configuration you need libjack yading@10: installed on your system. yading@10: yading@10: A JACK input device creates one or more JACK writable clients, one for yading@10: each audio channel, with name I<client_name>:input_I<N>, where yading@10: I<client_name> is the name provided by the application, and I<N> yading@10: is a number which identifies the channel. yading@10: Each writable client will send the acquired data to the FFmpeg input yading@10: device. yading@10: yading@10: Once you have created one or more JACK readable clients, you need to yading@10: connect them to one or more JACK writable clients. yading@10: yading@10: To connect or disconnect JACK clients you can use the B<jack_connect> yading@10: and B<jack_disconnect> programs, or do it through a graphical interface, yading@10: for example with B<qjackctl>. yading@10: yading@10: To list the JACK clients and their properties you can invoke the command yading@10: B<jack_lsp>. yading@10: yading@10: Follows an example which shows how to capture a JACK readable client yading@10: with B<ffmpeg>. yading@10: yading@10: # Create a JACK writable client with name "ffmpeg". yading@10: $ ffmpeg -f jack -i ffmpeg -y out.wav yading@10: yading@10: # Start the sample jack_metro readable client. yading@10: $ jack_metro -b 120 -d 0.2 -f 4000 yading@10: yading@10: # List the current JACK clients. yading@10: $ jack_lsp -c yading@10: system:capture_1 yading@10: system:capture_2 yading@10: system:playback_1 yading@10: system:playback_2 yading@10: ffmpeg:input_1 yading@10: metro:120_bpm yading@10: yading@10: # Connect metro to the ffmpeg writable client. yading@10: $ jack_connect metro:120_bpm ffmpeg:input_1 yading@10: yading@10: yading@10: For more information read: yading@10: E<lt>B<http://jackaudio.org/>E<gt> yading@10: yading@10: yading@10: =head2 lavfi yading@10: yading@10: yading@10: Libavfilter input virtual device. yading@10: yading@10: This input device reads data from the open output pads of a libavfilter yading@10: filtergraph. yading@10: yading@10: For each filtergraph open output, the input device will create a yading@10: corresponding stream which is mapped to the generated output. Currently yading@10: only video data is supported. The filtergraph is specified through the yading@10: option B<graph>. yading@10: yading@10: yading@10: =head3 Options yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<graph> yading@10: yading@10: Specify the filtergraph to use as input. Each video open output must be yading@10: labelled by a unique string of the form "outI<N>", where I<N> is a yading@10: number starting from 0 corresponding to the mapped input stream yading@10: generated by the device. yading@10: The first unlabelled output is automatically assigned to the "out0" yading@10: label, but all the others need to be specified explicitly. yading@10: yading@10: If not specified defaults to the filename specified for the input yading@10: device. yading@10: yading@10: yading@10: =item B<graph_file> yading@10: yading@10: Set the filename of the filtergraph to be read and sent to the other yading@10: filters. Syntax of the filtergraph is the same as the one specified by yading@10: the option I<graph>. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Create a color video stream and play it back with B<ffplay>: yading@10: yading@10: ffplay -f lavfi -graph "color=c=pink [out0]" dummy yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: As the previous example, but use filename for specifying the graph yading@10: description, and omit the "out0" label: yading@10: yading@10: ffplay -f lavfi color=c=pink yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Create three different video test filtered sources and play them: yading@10: yading@10: ffplay -f lavfi -graph "testsrc [out0]; testsrc,hflip [out1]; testsrc,negate [out2]" test3 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Read an audio stream from a file using the amovie source and play it yading@10: back with B<ffplay>: yading@10: yading@10: ffplay -f lavfi "amovie=test.wav" yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Read an audio stream and a video stream and play it back with yading@10: B<ffplay>: yading@10: yading@10: ffplay -f lavfi "movie=test.avi[out0];amovie=test.wav[out1]" yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 libdc1394 yading@10: yading@10: yading@10: IIDC1394 input device, based on libdc1394 and libraw1394. yading@10: yading@10: yading@10: =head2 openal yading@10: yading@10: yading@10: The OpenAL input device provides audio capture on all systems with a yading@10: working OpenAL 1.1 implementation. yading@10: yading@10: To enable this input device during configuration, you need OpenAL yading@10: headers and libraries installed on your system, and need to configure yading@10: FFmpeg with C<--enable-openal>. yading@10: yading@10: OpenAL headers and libraries should be provided as part of your OpenAL yading@10: implementation, or as an additional download (an SDK). Depending on your yading@10: installation you may need to specify additional flags via the yading@10: C<--extra-cflags> and C<--extra-ldflags> for allowing the build yading@10: system to locate the OpenAL headers and libraries. yading@10: yading@10: An incomplete list of OpenAL implementations follows: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<Creative> yading@10: yading@10: The official Windows implementation, providing hardware acceleration yading@10: with supported devices and software fallback. yading@10: See E<lt>B<http://openal.org/>E<gt>. yading@10: yading@10: =item B<OpenAL Soft> yading@10: yading@10: Portable, open source (LGPL) software implementation. Includes yading@10: backends for the most common sound APIs on the Windows, Linux, yading@10: Solaris, and BSD operating systems. yading@10: See E<lt>B<http://kcat.strangesoft.net/openal.html>E<gt>. yading@10: yading@10: =item B<Apple> yading@10: yading@10: OpenAL is part of Core Audio, the official Mac OS X Audio interface. yading@10: See E<lt>B<http://developer.apple.com/technologies/mac/audio-and-video.html>E<gt> yading@10: yading@10: =back yading@10: yading@10: yading@10: This device allows to capture from an audio input device handled yading@10: through OpenAL. yading@10: yading@10: You need to specify the name of the device to capture in the provided yading@10: filename. If the empty string is provided, the device will yading@10: automatically select the default device. You can get the list of the yading@10: supported devices by using the option I<list_devices>. yading@10: yading@10: yading@10: =head3 Options yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<channels> yading@10: yading@10: Set the number of channels in the captured audio. Only the values yading@10: B<1> (monaural) and B<2> (stereo) are currently supported. yading@10: Defaults to B<2>. yading@10: yading@10: yading@10: =item B<sample_size> yading@10: yading@10: Set the sample size (in bits) of the captured audio. Only the values yading@10: B<8> and B<16> are currently supported. Defaults to yading@10: B<16>. yading@10: yading@10: yading@10: =item B<sample_rate> yading@10: yading@10: Set the sample rate (in Hz) of the captured audio. yading@10: Defaults to B<44.1k>. yading@10: yading@10: yading@10: =item B<list_devices> yading@10: yading@10: If set to B<true>, print a list of devices and exit. yading@10: Defaults to B<false>. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: Print the list of OpenAL supported devices and exit: yading@10: yading@10: $ ffmpeg -list_devices true -f openal -i dummy out.ogg yading@10: yading@10: yading@10: Capture from the OpenAL device F<DR-BT101 via PulseAudio>: yading@10: yading@10: $ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg yading@10: yading@10: yading@10: Capture from the default device (note the empty string '' as filename): yading@10: yading@10: $ ffmpeg -f openal -i '' out.ogg yading@10: yading@10: yading@10: Capture from two devices simultaneously, writing to two different files, yading@10: within the same B<ffmpeg> command: yading@10: yading@10: $ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out1.ogg -f openal -i 'ALSA Default' out2.ogg yading@10: yading@10: Note: not all OpenAL implementations support multiple simultaneous capture - yading@10: try the latest OpenAL Soft if the above does not work. yading@10: yading@10: yading@10: =head2 oss yading@10: yading@10: yading@10: Open Sound System input device. yading@10: yading@10: The filename to provide to the input device is the device node yading@10: representing the OSS input device, and is usually set to yading@10: F</dev/dsp>. yading@10: yading@10: For example to grab from F</dev/dsp> using B<ffmpeg> use the yading@10: command: yading@10: yading@10: ffmpeg -f oss -i /dev/dsp /tmp/oss.wav yading@10: yading@10: yading@10: For more information about OSS see: yading@10: E<lt>B<http://manuals.opensound.com/usersguide/dsp.html>E<gt> yading@10: yading@10: yading@10: =head2 pulse yading@10: yading@10: yading@10: pulseaudio input device. yading@10: yading@10: To enable this input device during configuration you need libpulse-simple yading@10: installed in your system. yading@10: yading@10: The filename to provide to the input device is a source device or the yading@10: string "default" yading@10: yading@10: To list the pulse source devices and their properties you can invoke yading@10: the command B<pactl list sources>. yading@10: yading@10: yading@10: ffmpeg -f pulse -i default /tmp/pulse.wav yading@10: yading@10: yading@10: yading@10: =head3 I<server> AVOption yading@10: yading@10: yading@10: The syntax is: yading@10: yading@10: -server <server name> yading@10: yading@10: yading@10: Connects to a specific server. yading@10: yading@10: yading@10: =head3 I<name> AVOption yading@10: yading@10: yading@10: The syntax is: yading@10: yading@10: -name <application name> yading@10: yading@10: yading@10: Specify the application name pulse will use when showing active clients, yading@10: by default it is the LIBAVFORMAT_IDENT string yading@10: yading@10: yading@10: =head3 I<stream_name> AVOption yading@10: yading@10: yading@10: The syntax is: yading@10: yading@10: -stream_name <stream name> yading@10: yading@10: yading@10: Specify the stream name pulse will use when showing active streams, yading@10: by default it is "record" yading@10: yading@10: yading@10: =head3 I<sample_rate> AVOption yading@10: yading@10: yading@10: The syntax is: yading@10: yading@10: -sample_rate <samplerate> yading@10: yading@10: yading@10: Specify the samplerate in Hz, by default 48kHz is used. yading@10: yading@10: yading@10: =head3 I<channels> AVOption yading@10: yading@10: yading@10: The syntax is: yading@10: yading@10: -channels <N> yading@10: yading@10: yading@10: Specify the channels in use, by default 2 (stereo) is set. yading@10: yading@10: yading@10: =head3 I<frame_size> AVOption yading@10: yading@10: yading@10: The syntax is: yading@10: yading@10: -frame_size <bytes> yading@10: yading@10: yading@10: Specify the number of byte per frame, by default it is set to 1024. yading@10: yading@10: yading@10: =head3 I<fragment_size> AVOption yading@10: yading@10: yading@10: The syntax is: yading@10: yading@10: -fragment_size <bytes> yading@10: yading@10: yading@10: Specify the minimal buffering fragment in pulseaudio, it will affect the yading@10: audio latency. By default it is unset. yading@10: yading@10: yading@10: =head2 sndio yading@10: yading@10: yading@10: sndio input device. yading@10: yading@10: To enable this input device during configuration you need libsndio yading@10: installed on your system. yading@10: yading@10: The filename to provide to the input device is the device node yading@10: representing the sndio input device, and is usually set to yading@10: F</dev/audio0>. yading@10: yading@10: For example to grab from F</dev/audio0> using B<ffmpeg> use the yading@10: command: yading@10: yading@10: ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav yading@10: yading@10: yading@10: yading@10: =head2 video4linux2, v4l2 yading@10: yading@10: yading@10: Video4Linux2 input video device. yading@10: yading@10: "v4l2" can be used as alias for "video4linux2". yading@10: yading@10: If FFmpeg is built with v4l-utils support (by using the yading@10: C<--enable-libv4l2> configure option), the device will always rely yading@10: on libv4l2. yading@10: yading@10: The name of the device to grab is a file device node, usually Linux yading@10: systems tend to automatically create such nodes when the device yading@10: (e.g. an USB webcam) is plugged into the system, and has a name of the yading@10: kind F</dev/videoI<N>>, where I<N> is a number associated to yading@10: the device. yading@10: yading@10: Video4Linux2 devices usually support a limited set of yading@10: I<width>xI<height> sizes and frame rates. You can check which are yading@10: supported using B<-list_formats all> for Video4Linux2 devices. yading@10: Some devices, like TV cards, support one or more standards. It is possible yading@10: to list all the supported standards using B<-list_standards all>. yading@10: yading@10: The time base for the timestamps is 1 microsecond. Depending on the kernel yading@10: version and configuration, the timestamps may be derived from the real time yading@10: clock (origin at the Unix Epoch) or the monotonic clock (origin usually at yading@10: boot time, unaffected by NTP or manual changes to the clock). The yading@10: B<-timestamps abs> or B<-ts abs> option can be used to force yading@10: conversion into the real time clock. yading@10: yading@10: Some usage examples of the video4linux2 device with B<ffmpeg> yading@10: and B<ffplay>: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Grab and show the input of a video4linux2 device: yading@10: yading@10: ffplay -f video4linux2 -framerate 30 -video_size hd720 /dev/video0 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Grab and record the input of a video4linux2 device, leave the yading@10: frame rate and size as previously set: yading@10: yading@10: ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: For more information about Video4Linux, check E<lt>B<http://linuxtv.org/>E<gt>. yading@10: yading@10: yading@10: =head3 Options yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<standard> yading@10: yading@10: Set the standard. Must be the name of a supported standard. To get a yading@10: list of the supported standards, use the B<list_standards> yading@10: option. yading@10: yading@10: yading@10: =item B<channel> yading@10: yading@10: Set the input channel number. Default to -1, which means using the yading@10: previously selected channel. yading@10: yading@10: yading@10: =item B<video_size> yading@10: yading@10: Set the video frame size. The argument must be a string in the form yading@10: I<WIDTH>xI<HEIGHT> or a valid size abbreviation. yading@10: yading@10: yading@10: =item B<pixel_format> yading@10: yading@10: Select the pixel format (only valid for raw video input). yading@10: yading@10: yading@10: =item B<input_format> yading@10: yading@10: Set the preferred pixel format (for raw video) or a codec name. yading@10: This option allows to select the input format, when several are yading@10: available. yading@10: yading@10: yading@10: =item B<framerate> yading@10: yading@10: Set the preferred video frame rate. yading@10: yading@10: yading@10: =item B<list_formats> yading@10: yading@10: List available formats (supported pixel formats, codecs, and frame yading@10: sizes) and exit. yading@10: yading@10: Available values are: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<all> yading@10: yading@10: Show all available (compressed and non-compressed) formats. yading@10: yading@10: yading@10: =item B<raw> yading@10: yading@10: Show only raw video (non-compressed) formats. yading@10: yading@10: yading@10: =item B<compressed> yading@10: yading@10: Show only compressed formats. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<list_standards> yading@10: yading@10: List supported standards and exit. yading@10: yading@10: Available values are: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<all> yading@10: yading@10: Show all supported standards. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<timestamps, ts> yading@10: yading@10: Set type of timestamps for grabbed frames. yading@10: yading@10: Available values are: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<default> yading@10: yading@10: Use timestamps from the kernel. yading@10: yading@10: yading@10: =item B<abs> yading@10: yading@10: Use absolute timestamps (wall clock). yading@10: yading@10: yading@10: =item B<mono2abs> yading@10: yading@10: Force conversion from monotonic to absolute timestamps. yading@10: yading@10: =back yading@10: yading@10: yading@10: Default value is C<default>. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 vfwcap yading@10: yading@10: yading@10: VfW (Video for Windows) capture input device. yading@10: yading@10: The filename passed as input is the capture driver number, ranging from yading@10: 0 to 9. You may use "list" as filename to print a list of drivers. Any yading@10: other filename will be interpreted as device number 0. yading@10: yading@10: yading@10: =head2 x11grab yading@10: yading@10: yading@10: X11 video input device. yading@10: yading@10: This device allows to capture a region of an X11 display. yading@10: yading@10: The filename passed as input has the syntax: yading@10: yading@10: [<hostname>]:<display_number>.<screen_number>[+<x_offset>,<y_offset>] yading@10: yading@10: yading@10: I<hostname>:I<display_number>.I<screen_number> specifies the yading@10: X11 display name of the screen to grab from. I<hostname> can be yading@10: omitted, and defaults to "localhost". The environment variable yading@10: B<DISPLAY> contains the default display name. yading@10: yading@10: I<x_offset> and I<y_offset> specify the offsets of the grabbed yading@10: area with respect to the top-left border of the X11 screen. They yading@10: default to 0. yading@10: yading@10: Check the X11 documentation (e.g. man X) for more detailed information. yading@10: yading@10: Use the B<dpyinfo> program for getting basic information about the yading@10: properties of your X11 display (e.g. grep for "name" or "dimensions"). yading@10: yading@10: For example to grab from F<:0.0> using B<ffmpeg>: yading@10: yading@10: ffmpeg -f x11grab -r 25 -s cif -i :0.0 out.mpg yading@10: yading@10: yading@10: Grab at position C<10,20>: yading@10: yading@10: ffmpeg -f x11grab -r 25 -s cif -i :0.0+10,20 out.mpg yading@10: yading@10: yading@10: yading@10: =head3 Options yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<draw_mouse> yading@10: yading@10: Specify whether to draw the mouse pointer. A value of C<0> specify yading@10: not to draw the pointer. Default value is C<1>. yading@10: yading@10: yading@10: =item B<follow_mouse> yading@10: yading@10: Make the grabbed area follow the mouse. The argument can be yading@10: C<centered> or a number of pixels I<PIXELS>. yading@10: yading@10: When it is specified with "centered", the grabbing region follows the mouse yading@10: pointer and keeps the pointer at the center of region; otherwise, the region yading@10: follows only when the mouse pointer reaches within I<PIXELS> (greater than yading@10: zero) to the edge of region. yading@10: yading@10: For example: yading@10: yading@10: ffmpeg -f x11grab -follow_mouse centered -r 25 -s cif -i :0.0 out.mpg yading@10: yading@10: yading@10: To follow only when the mouse pointer reaches within 100 pixels to edge: yading@10: yading@10: ffmpeg -f x11grab -follow_mouse 100 -r 25 -s cif -i :0.0 out.mpg yading@10: yading@10: yading@10: yading@10: =item B<framerate> yading@10: yading@10: Set the grabbing frame rate. Default value is C<ntsc>, yading@10: corresponding to a frame rate of C<30000/1001>. yading@10: yading@10: yading@10: =item B<show_region> yading@10: yading@10: Show grabbed region on screen. yading@10: yading@10: If I<show_region> is specified with C<1>, then the grabbing yading@10: region will be indicated on screen. With this option, it is easy to yading@10: know what is being grabbed if only a portion of the screen is grabbed. yading@10: yading@10: For example: yading@10: yading@10: ffmpeg -f x11grab -show_region 1 -r 25 -s cif -i :0.0+10,20 out.mpg yading@10: yading@10: yading@10: With I<follow_mouse>: yading@10: yading@10: ffmpeg -f x11grab -follow_mouse centered -show_region 1 -r 25 -s cif -i :0.0 out.mpg yading@10: yading@10: yading@10: yading@10: =item B<video_size> yading@10: yading@10: Set the video frame size. Default value is C<vga>. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head1 OUTPUT DEVICES yading@10: yading@10: yading@10: Output devices are configured elements in FFmpeg which allow to write yading@10: multimedia data to an output device attached to your system. yading@10: yading@10: When you configure your FFmpeg build, all the supported output devices yading@10: are enabled by default. You can list all available ones using the yading@10: configure option "--list-outdevs". yading@10: yading@10: You can disable all the output devices using the configure option yading@10: "--disable-outdevs", and selectively enable an output device using the yading@10: option "--enable-outdev=I<OUTDEV>", or you can disable a particular yading@10: input device using the option "--disable-outdev=I<OUTDEV>". yading@10: yading@10: The option "-formats" of the ff* tools will display the list of yading@10: enabled output devices (amongst the muxers). yading@10: yading@10: A description of the currently available output devices follows. yading@10: yading@10: yading@10: =head2 alsa yading@10: yading@10: yading@10: ALSA (Advanced Linux Sound Architecture) output device. yading@10: yading@10: yading@10: =head2 caca yading@10: yading@10: yading@10: CACA output device. yading@10: yading@10: This output devices allows to show a video stream in CACA window. yading@10: Only one CACA window is allowed per application, so you can yading@10: have only one instance of this output device in an application. yading@10: yading@10: To enable this output device you need to configure FFmpeg with yading@10: C<--enable-libcaca>. yading@10: libcaca is a graphics library that outputs text instead of pixels. yading@10: yading@10: For more information about libcaca, check: yading@10: E<lt>B<http://caca.zoy.org/wiki/libcaca>E<gt> yading@10: yading@10: yading@10: =head3 Options yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<window_title> yading@10: yading@10: Set the CACA window title, if not specified default to the filename yading@10: specified for the output device. yading@10: yading@10: yading@10: =item B<window_size> yading@10: yading@10: Set the CACA window size, can be a string of the form yading@10: I<width>xI<height> or a video size abbreviation. yading@10: If not specified it defaults to the size of the input video. yading@10: yading@10: yading@10: =item B<driver> yading@10: yading@10: Set display driver. yading@10: yading@10: yading@10: =item B<algorithm> yading@10: yading@10: Set dithering algorithm. Dithering is necessary yading@10: because the picture being rendered has usually far more colours than yading@10: the available palette. yading@10: The accepted values are listed with C<-list_dither algorithms>. yading@10: yading@10: yading@10: =item B<antialias> yading@10: yading@10: Set antialias method. Antialiasing smoothens the rendered yading@10: image and avoids the commonly seen staircase effect. yading@10: The accepted values are listed with C<-list_dither antialiases>. yading@10: yading@10: yading@10: =item B<charset> yading@10: yading@10: Set which characters are going to be used when rendering text. yading@10: The accepted values are listed with C<-list_dither charsets>. yading@10: yading@10: yading@10: =item B<color> yading@10: yading@10: Set color to be used when rendering text. yading@10: The accepted values are listed with C<-list_dither colors>. yading@10: yading@10: yading@10: =item B<list_drivers> yading@10: yading@10: If set to B<true>, print a list of available drivers and exit. yading@10: yading@10: yading@10: =item B<list_dither> yading@10: yading@10: List available dither options related to the argument. yading@10: The argument must be one of C<algorithms>, C<antialiases>, yading@10: C<charsets>, C<colors>. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: The following command shows the B<ffmpeg> output is an yading@10: CACA window, forcing its size to 80x25: yading@10: yading@10: ffmpeg -i INPUT -vcodec rawvideo -pix_fmt rgb24 -window_size 80x25 -f caca - yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Show the list of available drivers and exit: yading@10: yading@10: ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_drivers true - yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Show the list of available dither colors and exit: yading@10: yading@10: ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_dither colors - yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 oss yading@10: yading@10: yading@10: OSS (Open Sound System) output device. yading@10: yading@10: yading@10: =head2 sdl yading@10: yading@10: yading@10: SDL (Simple DirectMedia Layer) output device. yading@10: yading@10: This output devices allows to show a video stream in an SDL yading@10: window. Only one SDL window is allowed per application, so you can yading@10: have only one instance of this output device in an application. yading@10: yading@10: To enable this output device you need libsdl installed on your system yading@10: when configuring your build. yading@10: yading@10: For more information about SDL, check: yading@10: E<lt>B<http://www.libsdl.org/>E<gt> yading@10: yading@10: yading@10: =head3 Options yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<window_title> yading@10: yading@10: Set the SDL window title, if not specified default to the filename yading@10: specified for the output device. yading@10: yading@10: yading@10: =item B<icon_title> yading@10: yading@10: Set the name of the iconified SDL window, if not specified it is set yading@10: to the same value of I<window_title>. yading@10: yading@10: yading@10: =item B<window_size> yading@10: yading@10: Set the SDL window size, can be a string of the form yading@10: I<width>xI<height> or a video size abbreviation. yading@10: If not specified it defaults to the size of the input video, yading@10: downscaled according to the aspect ratio. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: The following command shows the B<ffmpeg> output is an yading@10: SDL window, forcing its size to the qcif format: yading@10: yading@10: ffmpeg -i INPUT -vcodec rawvideo -pix_fmt yuv420p -window_size qcif -f sdl "SDL output" yading@10: yading@10: yading@10: yading@10: =head2 sndio yading@10: yading@10: yading@10: sndio audio output device. yading@10: yading@10: yading@10: yading@10: =head1 RESAMPLER OPTIONS yading@10: yading@10: yading@10: The audio resampler supports the following named options. yading@10: yading@10: Options may be set by specifying -I<option> I<value> in the yading@10: FFmpeg tools, I<option>=I<value> for the aresample filter, yading@10: by setting the value explicitly in the yading@10: C<SwrContext> options or using the F<libavutil/opt.h> API for yading@10: programmatic use. yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<ich, in_channel_count> yading@10: yading@10: Set the number of input channels. Default value is 0. Setting this yading@10: value is not mandatory if the corresponding channel layout yading@10: B<in_channel_layout> is set. yading@10: yading@10: yading@10: =item B<och, out_channel_count> yading@10: yading@10: Set the number of output channels. Default value is 0. Setting this yading@10: value is not mandatory if the corresponding channel layout yading@10: B<out_channel_layout> is set. yading@10: yading@10: yading@10: =item B<uch, used_channel_count> yading@10: yading@10: Set the number of used input channels. Default value is 0. This option is yading@10: only used for special remapping. yading@10: yading@10: yading@10: =item B<isr, in_sample_rate> yading@10: yading@10: Set the input sample rate. Default value is 0. yading@10: yading@10: yading@10: =item B<osr, out_sample_rate> yading@10: yading@10: Set the output sample rate. Default value is 0. yading@10: yading@10: yading@10: =item B<isf, in_sample_fmt> yading@10: yading@10: Specify the input sample format. It is set by default to C<none>. yading@10: yading@10: yading@10: =item B<osf, out_sample_fmt> yading@10: yading@10: Specify the output sample format. It is set by default to C<none>. yading@10: yading@10: yading@10: =item B<tsf, internal_sample_fmt> yading@10: yading@10: Set the internal sample format. Default value is C<none>. yading@10: This will automatically be chosen when it is not explicitly set. yading@10: yading@10: yading@10: =item B<icl, in_channel_layout> yading@10: yading@10: Set the input channel layout. yading@10: yading@10: yading@10: =item B<ocl, out_channel_layout> yading@10: yading@10: Set the output channel layout. yading@10: yading@10: yading@10: =item B<clev, center_mix_level> yading@10: yading@10: Set the center mix level. It is a value expressed in deciBel, and must be yading@10: in the interval [-32,32]. yading@10: yading@10: yading@10: =item B<slev, surround_mix_level> yading@10: yading@10: Set the surround mix level. It is a value expressed in deciBel, and must yading@10: be in the interval [-32,32]. yading@10: yading@10: yading@10: =item B<lfe_mix_level> yading@10: yading@10: Set LFE mix into non LFE level. It is used when there is a LFE input but no yading@10: LFE output. It is a value expressed in deciBel, and must yading@10: be in the interval [-32,32]. yading@10: yading@10: yading@10: =item B<rmvol, rematrix_volume> yading@10: yading@10: Set rematrix volume. Default value is 1.0. yading@10: yading@10: yading@10: =item B<flags, swr_flags> yading@10: yading@10: Set flags used by the converter. Default value is 0. yading@10: yading@10: It supports the following individual flags: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<res> yading@10: yading@10: force resampling, this flag forces resampling to be used even when the yading@10: input and output sample rates match. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<dither_scale> yading@10: yading@10: Set the dither scale. Default value is 1. yading@10: yading@10: yading@10: =item B<dither_method> yading@10: yading@10: Set dither method. Default value is 0. yading@10: yading@10: Supported values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<rectangular> yading@10: yading@10: select rectangular dither yading@10: yading@10: =item B<triangular> yading@10: yading@10: select triangular dither yading@10: yading@10: =item B<triangular_hp> yading@10: yading@10: select triangular dither with high pass yading@10: yading@10: =item B<lipshitz> yading@10: yading@10: select lipshitz noise shaping dither yading@10: yading@10: =item B<shibata> yading@10: yading@10: select shibata noise shaping dither yading@10: yading@10: =item B<low_shibata> yading@10: yading@10: select low shibata noise shaping dither yading@10: yading@10: =item B<high_shibata> yading@10: yading@10: select high shibata noise shaping dither yading@10: yading@10: =item B<f_weighted> yading@10: yading@10: select f-weighted noise shaping dither yading@10: yading@10: =item B<modified_e_weighted> yading@10: yading@10: select modified-e-weighted noise shaping dither yading@10: yading@10: =item B<improved_e_weighted> yading@10: yading@10: select improved-e-weighted noise shaping dither yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<resampler> yading@10: yading@10: Set resampling engine. Default value is swr. yading@10: yading@10: Supported values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<swr> yading@10: yading@10: select the native SW Resampler; filter options precision and cheby are not yading@10: applicable in this case. yading@10: yading@10: =item B<soxr> yading@10: yading@10: select the SoX Resampler (where available); compensation, and filter options yading@10: filter_size, phase_shift, filter_type & kaiser_beta, are not applicable in this yading@10: case. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<filter_size> yading@10: yading@10: For swr only, set resampling filter size, default value is 32. yading@10: yading@10: yading@10: =item B<phase_shift> yading@10: yading@10: For swr only, set resampling phase shift, default value is 10, and must be in yading@10: the interval [0,30]. yading@10: yading@10: yading@10: =item B<linear_interp> yading@10: yading@10: Use Linear Interpolation if set to 1, default value is 0. yading@10: yading@10: yading@10: =item B<cutoff> yading@10: yading@10: Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float yading@10: value between 0 and 1. Default value is 0.97 with swr, and 0.91 with soxr yading@10: (which, with a sample-rate of 44100, preserves the entire audio band to 20kHz). yading@10: yading@10: yading@10: =item B<precision> yading@10: yading@10: For soxr only, the precision in bits to which the resampled signal will be yading@10: calculated. The default value of 20 (which, with suitable dithering, is yading@10: appropriate for a destination bit-depth of 16) gives SoX's 'High Quality'; a yading@10: value of 28 gives SoX's 'Very High Quality'. yading@10: yading@10: yading@10: =item B<cheby> yading@10: yading@10: For soxr only, selects passband rolloff none (Chebyshev) & higher-precision yading@10: approximation for 'irrational' ratios. Default value is 0. yading@10: yading@10: yading@10: =item B<async> yading@10: yading@10: For swr only, simple 1 parameter audio sync to timestamps using stretching, yading@10: squeezing, filling and trimming. Setting this to 1 will enable filling and yading@10: trimming, larger values represent the maximum amount in samples that the data yading@10: may be stretched or squeezed for each second. yading@10: Default value is 0, thus no compensation is applied to make the samples match yading@10: the audio timestamps. yading@10: yading@10: yading@10: =item B<first_pts> yading@10: yading@10: For swr only, assume the first pts should be this value. The time unit is 1 / sample rate. yading@10: This allows for padding/trimming at the start of stream. By default, no yading@10: assumption is made about the first frame's expected pts, so no padding or yading@10: trimming is done. For example, this could be set to 0 to pad the beginning with yading@10: silence if an audio stream starts after the video stream or to trim any samples yading@10: with a negative pts due to encoder delay. yading@10: yading@10: yading@10: =item B<min_comp> yading@10: yading@10: For swr only, set the minimum difference between timestamps and audio data (in yading@10: seconds) to trigger stretching/squeezing/filling or trimming of the yading@10: data to make it match the timestamps. The default is that yading@10: stretching/squeezing/filling and trimming is disabled yading@10: (B<min_comp> = C<FLT_MAX>). yading@10: yading@10: yading@10: =item B<min_hard_comp> yading@10: yading@10: For swr only, set the minimum difference between timestamps and audio data (in yading@10: seconds) to trigger adding/dropping samples to make it match the yading@10: timestamps. This option effectively is a threshold to select between yading@10: hard (trim/fill) and soft (squeeze/stretch) compensation. Note that yading@10: all compensation is by default disabled through B<min_comp>. yading@10: The default is 0.1. yading@10: yading@10: yading@10: =item B<comp_duration> yading@10: yading@10: For swr only, set duration (in seconds) over which data is stretched/squeezed yading@10: to make it match the timestamps. Must be a non-negative double float value, yading@10: default value is 1.0. yading@10: yading@10: yading@10: =item B<max_soft_comp> yading@10: yading@10: For swr only, set maximum factor by which data is stretched/squeezed to make it yading@10: match the timestamps. Must be a non-negative double float value, default value yading@10: is 0. yading@10: yading@10: yading@10: =item B<matrix_encoding> yading@10: yading@10: Select matrixed stereo encoding. yading@10: yading@10: It accepts the following values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<none> yading@10: yading@10: select none yading@10: yading@10: =item B<dolby> yading@10: yading@10: select Dolby yading@10: yading@10: =item B<dplii> yading@10: yading@10: select Dolby Pro Logic II yading@10: yading@10: =back yading@10: yading@10: yading@10: Default value is C<none>. yading@10: yading@10: yading@10: =item B<filter_type> yading@10: yading@10: For swr only, select resampling filter type. This only affects resampling yading@10: operations. yading@10: yading@10: It accepts the following values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<cubic> yading@10: yading@10: select cubic yading@10: yading@10: =item B<blackman_nuttall> yading@10: yading@10: select Blackman Nuttall Windowed Sinc yading@10: yading@10: =item B<kaiser> yading@10: yading@10: select Kaiser Windowed Sinc yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<kaiser_beta> yading@10: yading@10: For swr only, set Kaiser Window Beta value. Must be an integer in the yading@10: interval [2,16], default value is 9. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: yading@10: =head1 SCALER OPTIONS yading@10: yading@10: yading@10: The video scaler supports the following named options. yading@10: yading@10: Options may be set by specifying -I<option> I<value> in the yading@10: FFmpeg tools. For programmatic use, they can be set explicitly in the yading@10: C<SwsContext> options or through the F<libavutil/opt.h> API. yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<sws_flags> yading@10: yading@10: Set the scaler flags. This is also used to set the scaling yading@10: algorithm. Only a single algorithm should be selected. yading@10: yading@10: It accepts the following values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<fast_bilinear> yading@10: yading@10: Select fast bilinear scaling algorithm. yading@10: yading@10: yading@10: =item B<bilinear> yading@10: yading@10: Select bilinear scaling algorithm. yading@10: yading@10: yading@10: =item B<bicubic> yading@10: yading@10: Select bicubic scaling algorithm. yading@10: yading@10: yading@10: =item B<experimental> yading@10: yading@10: Select experimental scaling algorithm. yading@10: yading@10: yading@10: =item B<neighbor> yading@10: yading@10: Select nearest neighbor rescaling algorithm. yading@10: yading@10: yading@10: =item B<area> yading@10: yading@10: Select averaging area rescaling algorithm. yading@10: yading@10: yading@10: =item B<bicubiclin> yading@10: yading@10: Select bicubic scaling algorithm for the luma component, bilinear for yading@10: chroma components. yading@10: yading@10: yading@10: =item B<gauss> yading@10: yading@10: Select Gaussian rescaling algorithm. yading@10: yading@10: yading@10: =item B<sinc> yading@10: yading@10: Select sinc rescaling algorithm. yading@10: yading@10: yading@10: =item B<lanczos> yading@10: yading@10: Select lanczos rescaling algorithm. yading@10: yading@10: yading@10: =item B<spline> yading@10: yading@10: Select natural bicubic spline rescaling algorithm. yading@10: yading@10: yading@10: =item B<print_info> yading@10: yading@10: Enable printing/debug logging. yading@10: yading@10: yading@10: =item B<accurate_rnd> yading@10: yading@10: Enable accurate rounding. yading@10: yading@10: yading@10: =item B<full_chroma_int> yading@10: yading@10: Enable full chroma interpolation. yading@10: yading@10: yading@10: =item B<full_chroma_inp> yading@10: yading@10: Select full chroma input. yading@10: yading@10: yading@10: =item B<bitexact> yading@10: yading@10: Enable bitexact output. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<srcw> yading@10: yading@10: Set source width. yading@10: yading@10: yading@10: =item B<srch> yading@10: yading@10: Set source height. yading@10: yading@10: yading@10: =item B<dstw> yading@10: yading@10: Set destination width. yading@10: yading@10: yading@10: =item B<dsth> yading@10: yading@10: Set destination height. yading@10: yading@10: yading@10: =item B<src_format> yading@10: yading@10: Set source pixel format (must be expressed as an integer). yading@10: yading@10: yading@10: =item B<dst_format> yading@10: yading@10: Set destination pixel format (must be expressed as an integer). yading@10: yading@10: yading@10: =item B<src_range> yading@10: yading@10: Select source range. yading@10: yading@10: yading@10: =item B<dst_range> yading@10: yading@10: Select destination range. yading@10: yading@10: yading@10: =item B<param0, param1> yading@10: yading@10: Set scaling algorithm parameters. The specified values are specific of yading@10: some scaling algorithms and ignored by others. The specified values yading@10: are floating point number values. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: yading@10: =head1 FILTERING INTRODUCTION yading@10: yading@10: yading@10: Filtering in FFmpeg is enabled through the libavfilter library. yading@10: yading@10: In libavfilter, a filter can have multiple inputs and multiple yading@10: outputs. yading@10: To illustrate the sorts of things that are possible, we consider the yading@10: following filtergraph. yading@10: yading@10: yading@10: input --> split ---------------------> overlay --> output yading@10: | ^ yading@10: | | yading@10: +-----> crop --> vflip -------+ yading@10: yading@10: yading@10: This filtergraph splits the input stream in two streams, sends one yading@10: stream through the crop filter and the vflip filter before merging it yading@10: back with the other stream by overlaying it on top. You can use the yading@10: following command to achieve this: yading@10: yading@10: yading@10: ffmpeg -i INPUT -vf "split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2" OUTPUT yading@10: yading@10: yading@10: The result will be that in output the top half of the video is mirrored yading@10: onto the bottom half. yading@10: yading@10: Filters in the same linear chain are separated by commas, and distinct yading@10: linear chains of filters are separated by semicolons. In our example, yading@10: I<crop,vflip> are in one linear chain, I<split> and yading@10: I<overlay> are separately in another. The points where the linear yading@10: chains join are labelled by names enclosed in square brackets. In the yading@10: example, the split filter generates two outputs that are associated to yading@10: the labels I<[main]> and I<[tmp]>. yading@10: yading@10: The stream sent to the second output of I<split>, labelled as yading@10: I<[tmp]>, is processed through the I<crop> filter, which crops yading@10: away the lower half part of the video, and then vertically flipped. The yading@10: I<overlay> filter takes in input the first unchanged output of the yading@10: split filter (which was labelled as I<[main]>), and overlay on its yading@10: lower half the output generated by the I<crop,vflip> filterchain. yading@10: yading@10: Some filters take in input a list of parameters: they are specified yading@10: after the filter name and an equal sign, and are separated from each other yading@10: by a colon. yading@10: yading@10: There exist so-called I<source filters> that do not have an yading@10: audio/video input, and I<sink filters> that will not have audio/video yading@10: output. yading@10: yading@10: yading@10: yading@10: =head1 GRAPH yading@10: yading@10: yading@10: The F<graph2dot> program included in the FFmpeg F<tools> yading@10: directory can be used to parse a filtergraph description and issue a yading@10: corresponding textual representation in the dot language. yading@10: yading@10: Invoke the command: yading@10: yading@10: graph2dot -h yading@10: yading@10: yading@10: to see how to use F<graph2dot>. yading@10: yading@10: You can then pass the dot description to the F<dot> program (from yading@10: the graphviz suite of programs) and obtain a graphical representation yading@10: of the filtergraph. yading@10: yading@10: For example the sequence of commands: yading@10: yading@10: echo <GRAPH_DESCRIPTION> | \ yading@10: tools/graph2dot -o graph.tmp && \ yading@10: dot -Tpng graph.tmp -o graph.png && \ yading@10: display graph.png yading@10: yading@10: yading@10: can be used to create and display an image representing the graph yading@10: described by the I<GRAPH_DESCRIPTION> string. Note that this string must be yading@10: a complete self-contained graph, with its inputs and outputs explicitly defined. yading@10: For example if your command line is of the form: yading@10: yading@10: ffmpeg -i infile -vf scale=640:360 outfile yading@10: yading@10: your I<GRAPH_DESCRIPTION> string will need to be of the form: yading@10: yading@10: nullsrc,scale=640:360,nullsink yading@10: yading@10: you may also need to set the I<nullsrc> parameters and add a I<format> yading@10: filter in order to simulate a specific input file. yading@10: yading@10: yading@10: yading@10: =head1 FILTERGRAPH DESCRIPTION yading@10: yading@10: yading@10: A filtergraph is a directed graph of connected filters. It can contain yading@10: cycles, and there can be multiple links between a pair of yading@10: filters. Each link has one input pad on one side connecting it to one yading@10: filter from which it takes its input, and one output pad on the other yading@10: side connecting it to the one filter accepting its output. yading@10: yading@10: Each filter in a filtergraph is an instance of a filter class yading@10: registered in the application, which defines the features and the yading@10: number of input and output pads of the filter. yading@10: yading@10: A filter with no input pads is called a "source", a filter with no yading@10: output pads is called a "sink". yading@10: yading@10: yading@10: yading@10: =head2 Filtergraph syntax yading@10: yading@10: yading@10: A filtergraph can be represented using a textual representation, which is yading@10: recognized by the B<-filter>/B<-vf> and B<-filter_complex> yading@10: options in B<ffmpeg> and B<-vf> in B<ffplay>, and by the yading@10: C<avfilter_graph_parse()>/C<avfilter_graph_parse2()> function defined in yading@10: F<libavfilter/avfilter.h>. yading@10: yading@10: A filterchain consists of a sequence of connected filters, each one yading@10: connected to the previous one in the sequence. A filterchain is yading@10: represented by a list of ","-separated filter descriptions. yading@10: yading@10: A filtergraph consists of a sequence of filterchains. A sequence of yading@10: filterchains is represented by a list of ";"-separated filterchain yading@10: descriptions. yading@10: yading@10: A filter is represented by a string of the form: yading@10: [I<in_link_1>]...[I<in_link_N>]I<filter_name>=I<arguments>[I<out_link_1>]...[I<out_link_M>] yading@10: yading@10: I<filter_name> is the name of the filter class of which the yading@10: described filter is an instance of, and has to be the name of one of yading@10: the filter classes registered in the program. yading@10: The name of the filter class is optionally followed by a string yading@10: "=I<arguments>". yading@10: yading@10: I<arguments> is a string which contains the parameters used to yading@10: initialize the filter instance. It may have one of the following forms: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: A ':'-separated list of I<key=value> pairs. yading@10: yading@10: yading@10: =item * yading@10: yading@10: A ':'-separated list of I<value>. In this case, the keys are assumed to be yading@10: the option names in the order they are declared. E.g. the C<fade> filter yading@10: declares three options in this order -- B<type>, B<start_frame> and yading@10: B<nb_frames>. Then the parameter list I<in:0:30> means that the value yading@10: I<in> is assigned to the option B<type>, I<0> to yading@10: B<start_frame> and I<30> to B<nb_frames>. yading@10: yading@10: yading@10: =item * yading@10: yading@10: A ':'-separated list of mixed direct I<value> and long I<key=value> yading@10: pairs. The direct I<value> must precede the I<key=value> pairs, and yading@10: follow the same constraints order of the previous point. The following yading@10: I<key=value> pairs can be set in any preferred order. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: If the option value itself is a list of items (e.g. the C<format> filter yading@10: takes a list of pixel formats), the items in the list are usually separated by yading@10: '|'. yading@10: yading@10: The list of arguments can be quoted using the character "'" as initial yading@10: and ending mark, and the character '\' for escaping the characters yading@10: within the quoted text; otherwise the argument string is considered yading@10: terminated when the next special character (belonging to the set yading@10: "[]=;,") is encountered. yading@10: yading@10: The name and arguments of the filter are optionally preceded and yading@10: followed by a list of link labels. yading@10: A link label allows to name a link and associate it to a filter output yading@10: or input pad. The preceding labels I<in_link_1> yading@10: ... I<in_link_N>, are associated to the filter input pads, yading@10: the following labels I<out_link_1> ... I<out_link_M>, are yading@10: associated to the output pads. yading@10: yading@10: When two link labels with the same name are found in the yading@10: filtergraph, a link between the corresponding input and output pad is yading@10: created. yading@10: yading@10: If an output pad is not labelled, it is linked by default to the first yading@10: unlabelled input pad of the next filter in the filterchain. yading@10: For example in the filterchain: yading@10: yading@10: nullsrc, split[L1], [L2]overlay, nullsink yading@10: yading@10: the split filter instance has two output pads, and the overlay filter yading@10: instance two input pads. The first output pad of split is labelled yading@10: "L1", the first input pad of overlay is labelled "L2", and the second yading@10: output pad of split is linked to the second input pad of overlay, yading@10: which are both unlabelled. yading@10: yading@10: In a complete filterchain all the unlabelled filter input and output yading@10: pads must be connected. A filtergraph is considered valid if all the yading@10: filter input and output pads of all the filterchains are connected. yading@10: yading@10: Libavfilter will automatically insert scale filters where format yading@10: conversion is required. It is possible to specify swscale flags yading@10: for those automatically inserted scalers by prepending yading@10: C<sws_flags=I<flags>;> yading@10: to the filtergraph description. yading@10: yading@10: Follows a BNF description for the filtergraph syntax: yading@10: yading@10: <NAME> ::= sequence of alphanumeric characters and '_' yading@10: <LINKLABEL> ::= "[" <NAME> "]" yading@10: <LINKLABELS> ::= <LINKLABEL> [<LINKLABELS>] yading@10: <FILTER_ARGUMENTS> ::= sequence of chars (eventually quoted) yading@10: <FILTER> ::= [<LINKLABELS>] <NAME> ["=" <FILTER_ARGUMENTS>] [<LINKLABELS>] yading@10: <FILTERCHAIN> ::= <FILTER> [,<FILTERCHAIN>] yading@10: <FILTERGRAPH> ::= [sws_flags=<flags>;] <FILTERCHAIN> [;<FILTERGRAPH>] yading@10: yading@10: yading@10: yading@10: =head2 Notes on filtergraph escaping yading@10: yading@10: yading@10: Some filter arguments require the use of special characters, typically yading@10: C<:> to separate key=value pairs in a named options list. In this yading@10: case the user should perform a first level escaping when specifying yading@10: the filter arguments. For example, consider the following literal yading@10: string to be embedded in the drawtext filter arguments: yading@10: yading@10: this is a 'string': may contain one, or more, special characters yading@10: yading@10: yading@10: Since C<:> is special for the filter arguments syntax, it needs to yading@10: be escaped, so you get: yading@10: yading@10: text=this is a \'string\'\: may contain one, or more, special characters yading@10: yading@10: yading@10: A second level of escaping is required when embedding the filter yading@10: arguments in a filtergraph description, in order to escape all the yading@10: filtergraph special characters. Thus the example above becomes: yading@10: yading@10: drawtext=text=this is a \\\'string\\\'\\: may contain one\, or more\, special characters yading@10: yading@10: yading@10: Finally an additional level of escaping may be needed when writing the yading@10: filtergraph description in a shell command, which depends on the yading@10: escaping rules of the adopted shell. For example, assuming that yading@10: C<\> is special and needs to be escaped with another C<\>, the yading@10: previous string will finally result in: yading@10: yading@10: -vf "drawtext=text=this is a \\\\\\'string\\\\\\'\\\\: may contain one\\, or more\\, special characters" yading@10: yading@10: yading@10: Sometimes, it might be more convenient to employ quoting in place of yading@10: escaping. For example the string: yading@10: yading@10: Caesar: tu quoque, Brute, fili mi yading@10: yading@10: yading@10: Can be quoted in the filter arguments as: yading@10: yading@10: text='Caesar: tu quoque, Brute, fili mi' yading@10: yading@10: yading@10: And finally inserted in a filtergraph like: yading@10: yading@10: drawtext=text=\'Caesar: tu quoque\, Brute\, fili mi\' yading@10: yading@10: yading@10: See the ``Quoting and escaping'' section in the ffmpeg-utils manual yading@10: for more information about the escaping and quoting rules adopted by yading@10: FFmpeg. yading@10: yading@10: yading@10: yading@10: =head1 AUDIO FILTERS yading@10: yading@10: yading@10: When you configure your FFmpeg build, you can disable any of the yading@10: existing filters using C<--disable-filters>. yading@10: The configure output will show the audio filters included in your yading@10: build. yading@10: yading@10: Below is a description of the currently available audio filters. yading@10: yading@10: yading@10: =head2 aconvert yading@10: yading@10: yading@10: Convert the input audio format to the specified formats. yading@10: yading@10: I<This filter is deprecated. Use aformat> instead. yading@10: yading@10: The filter accepts a string of the form: yading@10: "I<sample_format>:I<channel_layout>". yading@10: yading@10: I<sample_format> specifies the sample format, and can be a string or the yading@10: corresponding numeric value defined in F<libavutil/samplefmt.h>. Use 'p' yading@10: suffix for a planar sample format. yading@10: yading@10: I<channel_layout> specifies the channel layout, and can be a string yading@10: or the corresponding number value defined in F<libavutil/channel_layout.h>. yading@10: yading@10: The special parameter "auto", signifies that the filter will yading@10: automatically select the output format depending on the output filter. yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Convert input to float, planar, stereo: yading@10: yading@10: aconvert=fltp:stereo yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Convert input to unsigned 8-bit, automatically select out channel layout: yading@10: yading@10: aconvert=u8:auto yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 allpass yading@10: yading@10: yading@10: Apply a two-pole all-pass filter with central frequency (in Hz) yading@10: I<frequency>, and filter-width I<width>. yading@10: An all-pass filter changes the audio's frequency to phase relationship yading@10: without changing its frequency to amplitude relationship. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<frequency, f> yading@10: yading@10: Set frequency in Hz. yading@10: yading@10: yading@10: =item B<width_type> yading@10: yading@10: Set method to specify band-width of filter. yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<h> yading@10: yading@10: Hz yading@10: yading@10: =item B<q> yading@10: yading@10: Q-Factor yading@10: yading@10: =item B<o> yading@10: yading@10: octave yading@10: yading@10: =item B<s> yading@10: yading@10: slope yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<width, w> yading@10: yading@10: Specify the band-width of a filter in width_type units. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 highpass yading@10: yading@10: yading@10: Apply a high-pass filter with 3dB point frequency. yading@10: The filter can be either single-pole, or double-pole (the default). yading@10: The filter roll off at 6dB per pole per octave (20dB per pole per decade). yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<frequency, f> yading@10: yading@10: Set frequency in Hz. Default is 3000. yading@10: yading@10: yading@10: =item B<poles, p> yading@10: yading@10: Set number of poles. Default is 2. yading@10: yading@10: yading@10: =item B<width_type> yading@10: yading@10: Set method to specify band-width of filter. yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<h> yading@10: yading@10: Hz yading@10: yading@10: =item B<q> yading@10: yading@10: Q-Factor yading@10: yading@10: =item B<o> yading@10: yading@10: octave yading@10: yading@10: =item B<s> yading@10: yading@10: slope yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<width, w> yading@10: yading@10: Specify the band-width of a filter in width_type units. yading@10: Applies only to double-pole filter. yading@10: The default is 0.707q and gives a Butterworth response. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 lowpass yading@10: yading@10: yading@10: Apply a low-pass filter with 3dB point frequency. yading@10: The filter can be either single-pole or double-pole (the default). yading@10: The filter roll off at 6dB per pole per octave (20dB per pole per decade). yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<frequency, f> yading@10: yading@10: Set frequency in Hz. Default is 500. yading@10: yading@10: yading@10: =item B<poles, p> yading@10: yading@10: Set number of poles. Default is 2. yading@10: yading@10: yading@10: =item B<width_type> yading@10: yading@10: Set method to specify band-width of filter. yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<h> yading@10: yading@10: Hz yading@10: yading@10: =item B<q> yading@10: yading@10: Q-Factor yading@10: yading@10: =item B<o> yading@10: yading@10: octave yading@10: yading@10: =item B<s> yading@10: yading@10: slope yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<width, w> yading@10: yading@10: Specify the band-width of a filter in width_type units. yading@10: Applies only to double-pole filter. yading@10: The default is 0.707q and gives a Butterworth response. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 bass yading@10: yading@10: yading@10: Boost or cut the bass (lower) frequencies of the audio using a two-pole yading@10: shelving filter with a response similar to that of a standard yading@10: hi-fi's tone-controls. This is also known as shelving equalisation (EQ). yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<gain, g> yading@10: yading@10: Give the gain at 0 Hz. Its useful range is about -20 yading@10: (for a large cut) to +20 (for a large boost). yading@10: Beware of clipping when using a positive gain. yading@10: yading@10: yading@10: =item B<frequency, f> yading@10: yading@10: Set the filter's central frequency and so can be used yading@10: to extend or reduce the frequency range to be boosted or cut. yading@10: The default value is C<100> Hz. yading@10: yading@10: yading@10: =item B<width_type> yading@10: yading@10: Set method to specify band-width of filter. yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<h> yading@10: yading@10: Hz yading@10: yading@10: =item B<q> yading@10: yading@10: Q-Factor yading@10: yading@10: =item B<o> yading@10: yading@10: octave yading@10: yading@10: =item B<s> yading@10: yading@10: slope yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<width, w> yading@10: yading@10: Determine how steep is the filter's shelf transition. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 treble yading@10: yading@10: yading@10: Boost or cut treble (upper) frequencies of the audio using a two-pole yading@10: shelving filter with a response similar to that of a standard yading@10: hi-fi's tone-controls. This is also known as shelving equalisation (EQ). yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<gain, g> yading@10: yading@10: Give the gain at whichever is the lower of ~22 kHz and the yading@10: Nyquist frequency. Its useful range is about -20 (for a large cut) yading@10: to +20 (for a large boost). Beware of clipping when using a positive gain. yading@10: yading@10: yading@10: =item B<frequency, f> yading@10: yading@10: Set the filter's central frequency and so can be used yading@10: to extend or reduce the frequency range to be boosted or cut. yading@10: The default value is C<3000> Hz. yading@10: yading@10: yading@10: =item B<width_type> yading@10: yading@10: Set method to specify band-width of filter. yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<h> yading@10: yading@10: Hz yading@10: yading@10: =item B<q> yading@10: yading@10: Q-Factor yading@10: yading@10: =item B<o> yading@10: yading@10: octave yading@10: yading@10: =item B<s> yading@10: yading@10: slope yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<width, w> yading@10: yading@10: Determine how steep is the filter's shelf transition. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 bandpass yading@10: yading@10: yading@10: Apply a two-pole Butterworth band-pass filter with central yading@10: frequency I<frequency>, and (3dB-point) band-width width. yading@10: The I<csg> option selects a constant skirt gain (peak gain = Q) yading@10: instead of the default: constant 0dB peak gain. yading@10: The filter roll off at 6dB per octave (20dB per decade). yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<frequency, f> yading@10: yading@10: Set the filter's central frequency. Default is C<3000>. yading@10: yading@10: yading@10: =item B<csg> yading@10: yading@10: Constant skirt gain if set to 1. Defaults to 0. yading@10: yading@10: yading@10: =item B<width_type> yading@10: yading@10: Set method to specify band-width of filter. yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<h> yading@10: yading@10: Hz yading@10: yading@10: =item B<q> yading@10: yading@10: Q-Factor yading@10: yading@10: =item B<o> yading@10: yading@10: octave yading@10: yading@10: =item B<s> yading@10: yading@10: slope yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<width, w> yading@10: yading@10: Specify the band-width of a filter in width_type units. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 bandreject yading@10: yading@10: yading@10: Apply a two-pole Butterworth band-reject filter with central yading@10: frequency I<frequency>, and (3dB-point) band-width I<width>. yading@10: The filter roll off at 6dB per octave (20dB per decade). yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<frequency, f> yading@10: yading@10: Set the filter's central frequency. Default is C<3000>. yading@10: yading@10: yading@10: =item B<width_type> yading@10: yading@10: Set method to specify band-width of filter. yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<h> yading@10: yading@10: Hz yading@10: yading@10: =item B<q> yading@10: yading@10: Q-Factor yading@10: yading@10: =item B<o> yading@10: yading@10: octave yading@10: yading@10: =item B<s> yading@10: yading@10: slope yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<width, w> yading@10: yading@10: Specify the band-width of a filter in width_type units. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 biquad yading@10: yading@10: yading@10: Apply a biquad IIR filter with the given coefficients. yading@10: Where I<b0>, I<b1>, I<b2> and I<a0>, I<a1>, I<a2> yading@10: are the numerator and denominator coefficients respectively. yading@10: yading@10: yading@10: =head2 equalizer yading@10: yading@10: yading@10: Apply a two-pole peaking equalisation (EQ) filter. With this yading@10: filter, the signal-level at and around a selected frequency can yading@10: be increased or decreased, whilst (unlike bandpass and bandreject yading@10: filters) that at all other frequencies is unchanged. yading@10: yading@10: In order to produce complex equalisation curves, this filter can yading@10: be given several times, each with a different central frequency. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<frequency, f> yading@10: yading@10: Set the filter's central frequency in Hz. yading@10: yading@10: yading@10: =item B<width_type> yading@10: yading@10: Set method to specify band-width of filter. yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<h> yading@10: yading@10: Hz yading@10: yading@10: =item B<q> yading@10: yading@10: Q-Factor yading@10: yading@10: =item B<o> yading@10: yading@10: octave yading@10: yading@10: =item B<s> yading@10: yading@10: slope yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<width, w> yading@10: yading@10: Specify the band-width of a filter in width_type units. yading@10: yading@10: yading@10: =item B<gain, g> yading@10: yading@10: Set the required gain or attenuation in dB. yading@10: Beware of clipping when using a positive gain. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 afade yading@10: yading@10: yading@10: Apply fade-in/out effect to input audio. yading@10: yading@10: A description of the accepted parameters follows. yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<type, t> yading@10: yading@10: Specify the effect type, can be either C<in> for fade-in, or yading@10: C<out> for a fade-out effect. Default is C<in>. yading@10: yading@10: yading@10: =item B<start_sample, ss> yading@10: yading@10: Specify the number of the start sample for starting to apply the fade yading@10: effect. Default is 0. yading@10: yading@10: yading@10: =item B<nb_samples, ns> yading@10: yading@10: Specify the number of samples for which the fade effect has to last. At yading@10: the end of the fade-in effect the output audio will have the same yading@10: volume as the input audio, at the end of the fade-out transition yading@10: the output audio will be silence. Default is 44100. yading@10: yading@10: yading@10: =item B<start_time, st> yading@10: yading@10: Specify time for starting to apply the fade effect. Default is 0. yading@10: The accepted syntax is: yading@10: yading@10: [-]HH[:MM[:SS[.m...]]] yading@10: [-]S+[.m...] yading@10: yading@10: See also the function C<av_parse_time()>. yading@10: If set this option is used instead of I<start_sample> one. yading@10: yading@10: yading@10: =item B<duration, d> yading@10: yading@10: Specify the duration for which the fade effect has to last. Default is 0. yading@10: The accepted syntax is: yading@10: yading@10: [-]HH[:MM[:SS[.m...]]] yading@10: [-]S+[.m...] yading@10: yading@10: See also the function C<av_parse_time()>. yading@10: At the end of the fade-in effect the output audio will have the same yading@10: volume as the input audio, at the end of the fade-out transition yading@10: the output audio will be silence. yading@10: If set this option is used instead of I<nb_samples> one. yading@10: yading@10: yading@10: =item B<curve> yading@10: yading@10: Set curve for fade transition. yading@10: yading@10: It accepts the following values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<tri> yading@10: yading@10: select triangular, linear slope (default) yading@10: yading@10: =item B<qsin> yading@10: yading@10: select quarter of sine wave yading@10: yading@10: =item B<hsin> yading@10: yading@10: select half of sine wave yading@10: yading@10: =item B<esin> yading@10: yading@10: select exponential sine wave yading@10: yading@10: =item B<log> yading@10: yading@10: select logarithmic yading@10: yading@10: =item B<par> yading@10: yading@10: select inverted parabola yading@10: yading@10: =item B<qua> yading@10: yading@10: select quadratic yading@10: yading@10: =item B<cub> yading@10: yading@10: select cubic yading@10: yading@10: =item B<squ> yading@10: yading@10: select square root yading@10: yading@10: =item B<cbr> yading@10: yading@10: select cubic root yading@10: yading@10: =back yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Fade in first 15 seconds of audio: yading@10: yading@10: afade=t=in:ss=0:d=15 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Fade out last 25 seconds of a 900 seconds audio: yading@10: yading@10: afade=t=out:ss=875:d=25 yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: yading@10: =head2 aformat yading@10: yading@10: yading@10: Set output format constraints for the input audio. The framework will yading@10: negotiate the most appropriate format to minimize conversions. yading@10: yading@10: The filter accepts the following named parameters: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<sample_fmts> yading@10: yading@10: A '|'-separated list of requested sample formats. yading@10: yading@10: yading@10: =item B<sample_rates> yading@10: yading@10: A '|'-separated list of requested sample rates. yading@10: yading@10: yading@10: =item B<channel_layouts> yading@10: yading@10: A '|'-separated list of requested channel layouts. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: If a parameter is omitted, all values are allowed. yading@10: yading@10: For example to force the output to either unsigned 8-bit or signed 16-bit stereo: yading@10: yading@10: aformat=sample_fmts=u8|s16:channel_layouts=stereo yading@10: yading@10: yading@10: yading@10: =head2 amerge yading@10: yading@10: yading@10: Merge two or more audio streams into a single multi-channel stream. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<inputs> yading@10: yading@10: Set the number of inputs. Default is 2. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: If the channel layouts of the inputs are disjoint, and therefore compatible, yading@10: the channel layout of the output will be set accordingly and the channels yading@10: will be reordered as necessary. If the channel layouts of the inputs are not yading@10: disjoint, the output will have all the channels of the first input then all yading@10: the channels of the second input, in that order, and the channel layout of yading@10: the output will be the default value corresponding to the total number of yading@10: channels. yading@10: yading@10: For example, if the first input is in 2.1 (FL+FR+LF) and the second input yading@10: is FC+BL+BR, then the output will be in 5.1, with the channels in the yading@10: following order: a1, a2, b1, a3, b2, b3 (a1 is the first channel of the yading@10: first input, b1 is the first channel of the second input). yading@10: yading@10: On the other hand, if both input are in stereo, the output channels will be yading@10: in the default order: a1, a2, b1, b2, and the channel layout will be yading@10: arbitrarily set to 4.0, which may or may not be the expected value. yading@10: yading@10: All inputs must have the same sample rate, and format. yading@10: yading@10: If inputs do not have the same duration, the output will stop with the yading@10: shortest. yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Merge two mono files into a stereo stream: yading@10: yading@10: amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Multiple merges assuming 1 video stream and 6 audio streams in F<input.mkv>: yading@10: yading@10: ffmpeg -i input.mkv -filter_complex "[0:1][0:2][0:3][0:4][0:5][0:6] amerge=inputs=6" -c:a pcm_s16le output.mkv yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 amix yading@10: yading@10: yading@10: Mixes multiple audio inputs into a single output. yading@10: yading@10: For example yading@10: yading@10: ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT yading@10: yading@10: will mix 3 input audio streams to a single output with the same duration as the yading@10: first input and a dropout transition time of 3 seconds. yading@10: yading@10: The filter accepts the following named parameters: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<inputs> yading@10: yading@10: Number of inputs. If unspecified, it defaults to 2. yading@10: yading@10: yading@10: =item B<duration> yading@10: yading@10: How to determine the end-of-stream. yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<longest> yading@10: yading@10: Duration of longest input. (default) yading@10: yading@10: yading@10: =item B<shortest> yading@10: yading@10: Duration of shortest input. yading@10: yading@10: yading@10: =item B<first> yading@10: yading@10: Duration of first input. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<dropout_transition> yading@10: yading@10: Transition time, in seconds, for volume renormalization when an input yading@10: stream ends. The default value is 2 seconds. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 anull yading@10: yading@10: yading@10: Pass the audio source unchanged to the output. yading@10: yading@10: yading@10: =head2 apad yading@10: yading@10: yading@10: Pad the end of a audio stream with silence, this can be used together with yading@10: -shortest to extend audio streams to the same length as the video stream. yading@10: yading@10: yading@10: =head2 aphaser yading@10: yading@10: Add a phasing effect to the input audio. yading@10: yading@10: A phaser filter creates series of peaks and troughs in the frequency spectrum. yading@10: The position of the peaks and troughs are modulated so that they vary over time, creating a sweeping effect. yading@10: yading@10: A description of the accepted parameters follows. yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<in_gain> yading@10: yading@10: Set input gain. Default is 0.4. yading@10: yading@10: yading@10: =item B<out_gain> yading@10: yading@10: Set output gain. Default is 0.74 yading@10: yading@10: yading@10: =item B<delay> yading@10: yading@10: Set delay in milliseconds. Default is 3.0. yading@10: yading@10: yading@10: =item B<decay> yading@10: yading@10: Set decay. Default is 0.4. yading@10: yading@10: yading@10: =item B<speed> yading@10: yading@10: Set modulation speed in Hz. Default is 0.5. yading@10: yading@10: yading@10: =item B<type> yading@10: yading@10: Set modulation type. Default is triangular. yading@10: yading@10: It accepts the following values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<triangular, t> yading@10: yading@10: yading@10: =item B<sinusoidal, s> yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: yading@10: =head2 aresample yading@10: yading@10: yading@10: Resample the input audio to the specified parameters, using the yading@10: libswresample library. If none are specified then the filter will yading@10: automatically convert between its input and output. yading@10: yading@10: This filter is also able to stretch/squeeze the audio data to make it match yading@10: the timestamps or to inject silence / cut out audio to make it match the yading@10: timestamps, do a combination of both or do neither. yading@10: yading@10: The filter accepts the syntax yading@10: [I<sample_rate>:]I<resampler_options>, where I<sample_rate> yading@10: expresses a sample rate and I<resampler_options> is a list of yading@10: I<key>=I<value> pairs, separated by ":". See the yading@10: ffmpeg-resampler manual for the complete list of supported options. yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Resample the input audio to 44100Hz: yading@10: yading@10: aresample=44100 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Stretch/squeeze samples to the given timestamps, with a maximum of 1000 yading@10: samples per second compensation: yading@10: yading@10: aresample=async=1000 yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 asetnsamples yading@10: yading@10: yading@10: Set the number of samples per each output audio frame. yading@10: yading@10: The last output packet may contain a different number of samples, as yading@10: the filter will flush all the remaining samples when the input audio yading@10: signal its end. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<nb_out_samples, n> yading@10: yading@10: Set the number of frames per each output audio frame. The number is yading@10: intended as the number of samples I<per each channel>. yading@10: Default value is 1024. yading@10: yading@10: yading@10: =item B<pad, p> yading@10: yading@10: If set to 1, the filter will pad the last audio frame with zeroes, so yading@10: that the last frame will contain the same number of samples as the yading@10: previous ones. Default value is 1. yading@10: yading@10: =back yading@10: yading@10: yading@10: For example, to set the number of per-frame samples to 1234 and yading@10: disable padding for the last frame, use: yading@10: yading@10: asetnsamples=n=1234:p=0 yading@10: yading@10: yading@10: yading@10: =head2 ashowinfo yading@10: yading@10: yading@10: Show a line containing various information for each input audio frame. yading@10: The input audio is not modified. yading@10: yading@10: The shown line contains a sequence of key/value pairs of the form yading@10: I<key>:I<value>. yading@10: yading@10: A description of each shown parameter follows: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<n> yading@10: yading@10: sequential number of the input frame, starting from 0 yading@10: yading@10: yading@10: =item B<pts> yading@10: yading@10: Presentation timestamp of the input frame, in time base units; the time base yading@10: depends on the filter input pad, and is usually 1/I<sample_rate>. yading@10: yading@10: yading@10: =item B<pts_time> yading@10: yading@10: presentation timestamp of the input frame in seconds yading@10: yading@10: yading@10: =item B<pos> yading@10: yading@10: position of the frame in the input stream, -1 if this information in yading@10: unavailable and/or meaningless (for example in case of synthetic audio) yading@10: yading@10: yading@10: =item B<fmt> yading@10: yading@10: sample format yading@10: yading@10: yading@10: =item B<chlayout> yading@10: yading@10: channel layout yading@10: yading@10: yading@10: =item B<rate> yading@10: yading@10: sample rate for the audio frame yading@10: yading@10: yading@10: =item B<nb_samples> yading@10: yading@10: number of samples (per channel) in the frame yading@10: yading@10: yading@10: =item B<checksum> yading@10: yading@10: Adler-32 checksum (printed in hexadecimal) of the audio data. For planar audio yading@10: the data is treated as if all the planes were concatenated. yading@10: yading@10: yading@10: =item B<plane_checksums> yading@10: yading@10: A list of Adler-32 checksums for each data plane. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 astreamsync yading@10: yading@10: yading@10: Forward two audio streams and control the order the buffers are forwarded. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<expr, e> yading@10: yading@10: Set the expression deciding which stream should be yading@10: forwarded next: if the result is negative, the first stream is forwarded; if yading@10: the result is positive or zero, the second stream is forwarded. It can use yading@10: the following variables: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item I<b1 b2> yading@10: yading@10: number of buffers forwarded so far on each stream yading@10: yading@10: =item I<s1 s2> yading@10: yading@10: number of samples forwarded so far on each stream yading@10: yading@10: =item I<t1 t2> yading@10: yading@10: current timestamp of each stream yading@10: yading@10: =back yading@10: yading@10: yading@10: The default value is C<t1-t2>, which means to always forward the stream yading@10: that has a smaller timestamp. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: Stress-test C<amerge> by randomly sending buffers on the wrong yading@10: input, while avoiding too much of a desynchronization: yading@10: yading@10: amovie=file.ogg [a] ; amovie=file.mp3 [b] ; yading@10: [a] [b] astreamsync=(2*random(1))-1+tanh(5*(t1-t2)) [a2] [b2] ; yading@10: [a2] [b2] amerge yading@10: yading@10: yading@10: yading@10: =head2 atempo yading@10: yading@10: yading@10: Adjust audio tempo. yading@10: yading@10: The filter accepts exactly one parameter, the audio tempo. If not yading@10: specified then the filter will assume nominal 1.0 tempo. Tempo must yading@10: be in the [0.5, 2.0] range. yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Slow down audio to 80% tempo: yading@10: yading@10: atempo=0.8 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: To speed up audio to 125% tempo: yading@10: yading@10: atempo=1.25 yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 earwax yading@10: yading@10: yading@10: Make audio easier to listen to on headphones. yading@10: yading@10: This filter adds `cues' to 44.1kHz stereo (i.e. audio CD format) audio yading@10: so that when listened to on headphones the stereo image is moved from yading@10: inside your head (standard for headphones) to outside and in front of yading@10: the listener (standard for speakers). yading@10: yading@10: Ported from SoX. yading@10: yading@10: yading@10: =head2 pan yading@10: yading@10: yading@10: Mix channels with specific gain levels. The filter accepts the output yading@10: channel layout followed by a set of channels definitions. yading@10: yading@10: This filter is also designed to remap efficiently the channels of an audio yading@10: stream. yading@10: yading@10: The filter accepts parameters of the form: yading@10: "I<l>:I<outdef>:I<outdef>:..." yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<l> yading@10: yading@10: output channel layout or number of channels yading@10: yading@10: yading@10: =item B<outdef> yading@10: yading@10: output channel specification, of the form: yading@10: "I<out_name>=[I<gain>*]I<in_name>[+[I<gain>*]I<in_name>...]" yading@10: yading@10: yading@10: =item B<out_name> yading@10: yading@10: output channel to define, either a channel name (FL, FR, etc.) or a channel yading@10: number (c0, c1, etc.) yading@10: yading@10: yading@10: =item B<gain> yading@10: yading@10: multiplicative coefficient for the channel, 1 leaving the volume unchanged yading@10: yading@10: yading@10: =item B<in_name> yading@10: yading@10: input channel to use, see out_name for details; it is not possible to mix yading@10: named and numbered input channels yading@10: yading@10: =back yading@10: yading@10: yading@10: If the `=' in a channel specification is replaced by `E<lt>', then the gains for yading@10: that specification will be renormalized so that the total is 1, thus yading@10: avoiding clipping noise. yading@10: yading@10: yading@10: =head3 Mixing examples yading@10: yading@10: yading@10: For example, if you want to down-mix from stereo to mono, but with a bigger yading@10: factor for the left channel: yading@10: yading@10: pan=1:c0=0.9*c0+0.1*c1 yading@10: yading@10: yading@10: A customized down-mix to stereo that works automatically for 3-, 4-, 5- and yading@10: 7-channels surround: yading@10: yading@10: pan=stereo: FL < FL + 0.5*FC + 0.6*BL + 0.6*SL : FR < FR + 0.5*FC + 0.6*BR + 0.6*SR yading@10: yading@10: yading@10: Note that B<ffmpeg> integrates a default down-mix (and up-mix) system yading@10: that should be preferred (see "-ac" option) unless you have very specific yading@10: needs. yading@10: yading@10: yading@10: =head3 Remapping examples yading@10: yading@10: yading@10: The channel remapping will be effective if, and only if: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item *<gain coefficients are zeroes or ones,> yading@10: yading@10: yading@10: =item *<only one input per channel output,> yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: If all these conditions are satisfied, the filter will notify the user ("Pure yading@10: channel mapping detected"), and use an optimized and lossless method to do the yading@10: remapping. yading@10: yading@10: For example, if you have a 5.1 source and want a stereo audio stream by yading@10: dropping the extra channels: yading@10: yading@10: pan="stereo: c0=FL : c1=FR" yading@10: yading@10: yading@10: Given the same source, you can also switch front left and front right channels yading@10: and keep the input channel layout: yading@10: yading@10: pan="5.1: c0=c1 : c1=c0 : c2=c2 : c3=c3 : c4=c4 : c5=c5" yading@10: yading@10: yading@10: If the input is a stereo audio stream, you can mute the front left channel (and yading@10: still keep the stereo channel layout) with: yading@10: yading@10: pan="stereo:c1=c1" yading@10: yading@10: yading@10: Still with a stereo audio stream input, you can copy the right channel in both yading@10: front left and right: yading@10: yading@10: pan="stereo: c0=FR : c1=FR" yading@10: yading@10: yading@10: yading@10: =head2 silencedetect yading@10: yading@10: yading@10: Detect silence in an audio stream. yading@10: yading@10: This filter logs a message when it detects that the input audio volume is less yading@10: or equal to a noise tolerance value for a duration greater or equal to the yading@10: minimum detected noise duration. yading@10: yading@10: The printed times and duration are expressed in seconds. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<duration, d> yading@10: yading@10: Set silence duration until notification (default is 2 seconds). yading@10: yading@10: yading@10: =item B<noise, n> yading@10: yading@10: Set noise tolerance. Can be specified in dB (in case "dB" is appended to the yading@10: specified value) or amplitude ratio. Default is -60dB, or 0.001. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Detect 5 seconds of silence with -50dB noise tolerance: yading@10: yading@10: silencedetect=n=-50dB:d=5 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Complete example with B<ffmpeg> to detect silence with 0.0001 noise yading@10: tolerance in F<silence.mp3>: yading@10: yading@10: ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f null - yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 asyncts yading@10: yading@10: Synchronize audio data with timestamps by squeezing/stretching it and/or yading@10: dropping samples/adding silence when needed. yading@10: yading@10: This filter is not built by default, please use aresample to do squeezing/stretching. yading@10: yading@10: The filter accepts the following named parameters: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<compensate> yading@10: yading@10: Enable stretching/squeezing the data to make it match the timestamps. Disabled yading@10: by default. When disabled, time gaps are covered with silence. yading@10: yading@10: yading@10: =item B<min_delta> yading@10: yading@10: Minimum difference between timestamps and audio data (in seconds) to trigger yading@10: adding/dropping samples. Default value is 0.1. If you get non-perfect sync with yading@10: this filter, try setting this parameter to 0. yading@10: yading@10: yading@10: =item B<max_comp> yading@10: yading@10: Maximum compensation in samples per second. Relevant only with compensate=1. yading@10: Default value 500. yading@10: yading@10: yading@10: =item B<first_pts> yading@10: yading@10: Assume the first pts should be this value. The time base is 1 / sample rate. yading@10: This allows for padding/trimming at the start of stream. By default, no yading@10: assumption is made about the first frame's expected pts, so no padding or yading@10: trimming is done. For example, this could be set to 0 to pad the beginning with yading@10: silence if an audio stream starts after the video stream or to trim any samples yading@10: with a negative pts due to encoder delay. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 channelsplit yading@10: yading@10: Split each channel in input audio stream into a separate output stream. yading@10: yading@10: This filter accepts the following named parameters: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<channel_layout> yading@10: yading@10: Channel layout of the input stream. Default is "stereo". yading@10: yading@10: =back yading@10: yading@10: yading@10: For example, assuming a stereo input MP3 file yading@10: yading@10: ffmpeg -i in.mp3 -filter_complex channelsplit out.mkv yading@10: yading@10: will create an output Matroska file with two audio streams, one containing only yading@10: the left channel and the other the right channel. yading@10: yading@10: To split a 5.1 WAV file into per-channel files yading@10: yading@10: ffmpeg -i in.wav -filter_complex yading@10: 'channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]' yading@10: -map '[FL]' front_left.wav -map '[FR]' front_right.wav -map '[FC]' yading@10: front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]' yading@10: side_right.wav yading@10: yading@10: yading@10: yading@10: =head2 channelmap yading@10: yading@10: Remap input channels to new locations. yading@10: yading@10: This filter accepts the following named parameters: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<channel_layout> yading@10: yading@10: Channel layout of the output stream. yading@10: yading@10: yading@10: =item B<map> yading@10: yading@10: Map channels from input to output. The argument is a '|'-separated list of yading@10: mappings, each in the C<I<in_channel>-I<out_channel>> or yading@10: I<in_channel> form. I<in_channel> can be either the name of the input yading@10: channel (e.g. FL for front left) or its index in the input channel layout. yading@10: I<out_channel> is the name of the output channel or its index in the output yading@10: channel layout. If I<out_channel> is not given then it is implicitly an yading@10: index, starting with zero and increasing by one for each mapping. yading@10: yading@10: =back yading@10: yading@10: yading@10: If no mapping is present, the filter will implicitly map input channels to yading@10: output channels preserving index. yading@10: yading@10: For example, assuming a 5.1+downmix input MOV file yading@10: yading@10: ffmpeg -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav yading@10: yading@10: will create an output WAV file tagged as stereo from the downmix channels of yading@10: the input. yading@10: yading@10: To fix a 5.1 WAV improperly encoded in AAC's native channel order yading@10: yading@10: ffmpeg -i in.wav -filter 'channelmap=1|2|0|5|3|4:channel_layout=5.1' out.wav yading@10: yading@10: yading@10: yading@10: =head2 join yading@10: yading@10: Join multiple input streams into one multi-channel stream. yading@10: yading@10: The filter accepts the following named parameters: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<inputs> yading@10: yading@10: Number of input streams. Defaults to 2. yading@10: yading@10: yading@10: =item B<channel_layout> yading@10: yading@10: Desired output channel layout. Defaults to stereo. yading@10: yading@10: yading@10: =item B<map> yading@10: yading@10: Map channels from inputs to output. The argument is a '|'-separated list of yading@10: mappings, each in the C<I<input_idx>.I<in_channel>-I<out_channel>> yading@10: form. I<input_idx> is the 0-based index of the input stream. I<in_channel> yading@10: can be either the name of the input channel (e.g. FL for front left) or its yading@10: index in the specified input stream. I<out_channel> is the name of the output yading@10: channel. yading@10: yading@10: =back yading@10: yading@10: yading@10: The filter will attempt to guess the mappings when those are not specified yading@10: explicitly. It does so by first trying to find an unused matching input channel yading@10: and if that fails it picks the first unused input channel. yading@10: yading@10: E.g. to join 3 inputs (with properly set channel layouts) yading@10: yading@10: ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT yading@10: yading@10: yading@10: To build a 5.1 output from 6 single-channel streams: yading@10: yading@10: ffmpeg -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex yading@10: 'join=inputs=6:channel_layout=5.1:map=0.0-FL|1.0-FR|2.0-FC|3.0-SL|4.0-SR|5.0-LFE' yading@10: out yading@10: yading@10: yading@10: yading@10: =head2 resample yading@10: yading@10: Convert the audio sample format, sample rate and channel layout. This filter is yading@10: not meant to be used directly. yading@10: yading@10: yading@10: =head2 volume yading@10: yading@10: yading@10: Adjust the input audio volume. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<volume> yading@10: yading@10: Expresses how the audio volume will be increased or decreased. yading@10: yading@10: Output values are clipped to the maximum value. yading@10: yading@10: The output audio volume is given by the relation: yading@10: yading@10: <output_volume> = <volume> * <input_volume> yading@10: yading@10: yading@10: Default value for I<volume> is 1.0. yading@10: yading@10: yading@10: =item B<precision> yading@10: yading@10: Set the mathematical precision. yading@10: yading@10: This determines which input sample formats will be allowed, which affects the yading@10: precision of the volume scaling. yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<fixed> yading@10: yading@10: 8-bit fixed-point; limits input sample format to U8, S16, and S32. yading@10: yading@10: =item B<float> yading@10: yading@10: 32-bit floating-point; limits input sample format to FLT. (default) yading@10: yading@10: =item B<double> yading@10: yading@10: 64-bit floating-point; limits input sample format to DBL. yading@10: yading@10: =back yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Halve the input audio volume: yading@10: yading@10: volume=volume=0.5 yading@10: volume=volume=1/2 yading@10: volume=volume=-6.0206dB yading@10: yading@10: yading@10: In all the above example the named key for B<volume> can be yading@10: omitted, for example like in: yading@10: yading@10: volume=0.5 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Increase input audio power by 6 decibels using fixed-point precision: yading@10: yading@10: volume=volume=6dB:precision=fixed yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 volumedetect yading@10: yading@10: yading@10: Detect the volume of the input video. yading@10: yading@10: The filter has no parameters. The input is not modified. Statistics about yading@10: the volume will be printed in the log when the input stream end is reached. yading@10: yading@10: In particular it will show the mean volume (root mean square), maximum yading@10: volume (on a per-sample basis), and the beginning of an histogram of the yading@10: registered volume values (from the maximum value to a cumulated 1/1000 of yading@10: the samples). yading@10: yading@10: All volumes are in decibels relative to the maximum PCM value. yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: Here is an excerpt of the output: yading@10: yading@10: [Parsed_volumedetect_0 0xa23120] mean_volume: -27 dB yading@10: [Parsed_volumedetect_0 0xa23120] max_volume: -4 dB yading@10: [Parsed_volumedetect_0 0xa23120] histogram_4db: 6 yading@10: [Parsed_volumedetect_0 0xa23120] histogram_5db: 62 yading@10: [Parsed_volumedetect_0 0xa23120] histogram_6db: 286 yading@10: [Parsed_volumedetect_0 0xa23120] histogram_7db: 1042 yading@10: [Parsed_volumedetect_0 0xa23120] histogram_8db: 2551 yading@10: [Parsed_volumedetect_0 0xa23120] histogram_9db: 4609 yading@10: [Parsed_volumedetect_0 0xa23120] histogram_10db: 8409 yading@10: yading@10: yading@10: It means that: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: The mean square energy is approximately -27 dB, or 10^-2.7. yading@10: yading@10: =item * yading@10: yading@10: The largest sample is at -4 dB, or more precisely between -4 dB and -5 dB. yading@10: yading@10: =item * yading@10: yading@10: There are 6 samples at -4 dB, 62 at -5 dB, 286 at -6 dB, etc. yading@10: yading@10: =back yading@10: yading@10: yading@10: In other words, raising the volume by +4 dB does not cause any clipping, yading@10: raising it by +5 dB causes clipping for 6 samples, etc. yading@10: yading@10: yading@10: yading@10: =head1 AUDIO SOURCES yading@10: yading@10: yading@10: Below is a description of the currently available audio sources. yading@10: yading@10: yading@10: =head2 abuffer yading@10: yading@10: yading@10: Buffer audio frames, and make them available to the filter chain. yading@10: yading@10: This source is mainly intended for a programmatic use, in particular yading@10: through the interface defined in F<libavfilter/asrc_abuffer.h>. yading@10: yading@10: It accepts the following named parameters: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<time_base> yading@10: yading@10: Timebase which will be used for timestamps of submitted frames. It must be yading@10: either a floating-point number or in I<numerator>/I<denominator> form. yading@10: yading@10: yading@10: =item B<sample_rate> yading@10: yading@10: The sample rate of the incoming audio buffers. yading@10: yading@10: yading@10: =item B<sample_fmt> yading@10: yading@10: The sample format of the incoming audio buffers. yading@10: Either a sample format name or its corresponging integer representation from yading@10: the enum AVSampleFormat in F<libavutil/samplefmt.h> yading@10: yading@10: yading@10: =item B<channel_layout> yading@10: yading@10: The channel layout of the incoming audio buffers. yading@10: Either a channel layout name from channel_layout_map in yading@10: F<libavutil/channel_layout.c> or its corresponding integer representation yading@10: from the AV_CH_LAYOUT_* macros in F<libavutil/channel_layout.h> yading@10: yading@10: yading@10: =item B<channels> yading@10: yading@10: The number of channels of the incoming audio buffers. yading@10: If both I<channels> and I<channel_layout> are specified, then they yading@10: must be consistent. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo yading@10: yading@10: yading@10: will instruct the source to accept planar 16bit signed stereo at 44100Hz. yading@10: Since the sample format with name "s16p" corresponds to the number yading@10: 6 and the "stereo" channel layout corresponds to the value 0x3, this is yading@10: equivalent to: yading@10: yading@10: abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3 yading@10: yading@10: yading@10: yading@10: =head2 aevalsrc yading@10: yading@10: yading@10: Generate an audio signal specified by an expression. yading@10: yading@10: This source accepts in input one or more expressions (one for each yading@10: channel), which are evaluated and used to generate a corresponding yading@10: audio signal. yading@10: yading@10: This source accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<exprs> yading@10: yading@10: Set the '|'-separated expressions list for each separate channel. In case the yading@10: B<channel_layout> option is not specified, the selected channel layout yading@10: depends on the number of provided expressions. yading@10: yading@10: yading@10: =item B<channel_layout, c> yading@10: yading@10: Set the channel layout. The number of channels in the specified layout yading@10: must be equal to the number of specified expressions. yading@10: yading@10: yading@10: =item B<duration, d> yading@10: yading@10: Set the minimum duration of the sourced audio. See the function yading@10: C<av_parse_time()> for the accepted format. yading@10: Note that the resulting duration may be greater than the specified yading@10: duration, as the generated audio is always cut at the end of a yading@10: complete frame. yading@10: yading@10: If not specified, or the expressed duration is negative, the audio is yading@10: supposed to be generated forever. yading@10: yading@10: yading@10: =item B<nb_samples, n> yading@10: yading@10: Set the number of samples per channel per each output frame, yading@10: default to 1024. yading@10: yading@10: yading@10: =item B<sample_rate, s> yading@10: yading@10: Specify the sample rate, default to 44100. yading@10: yading@10: =back yading@10: yading@10: yading@10: Each expression in I<exprs> can contain the following constants: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<n> yading@10: yading@10: number of the evaluated sample, starting from 0 yading@10: yading@10: yading@10: =item B<t> yading@10: yading@10: time of the evaluated sample expressed in seconds, starting from 0 yading@10: yading@10: yading@10: =item B<s> yading@10: yading@10: sample rate yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Generate silence: yading@10: yading@10: aevalsrc=0 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Generate a sin signal with frequency of 440 Hz, set sample rate to yading@10: 8000 Hz: yading@10: yading@10: aevalsrc="sin(440*2*PI*t):s=8000" yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Generate a two channels signal, specify the channel layout (Front yading@10: Center + Back Center) explicitly: yading@10: yading@10: aevalsrc="sin(420*2*PI*t)|cos(430*2*PI*t):c=FC|BC" yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Generate white noise: yading@10: yading@10: aevalsrc="-2+random(0)" yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Generate an amplitude modulated signal: yading@10: yading@10: aevalsrc="sin(10*2*PI*t)*sin(880*2*PI*t)" yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Generate 2.5 Hz binaural beats on a 360 Hz carrier: yading@10: yading@10: aevalsrc="0.1*sin(2*PI*(360-2.5/2)*t) | 0.1*sin(2*PI*(360+2.5/2)*t)" yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 anullsrc yading@10: yading@10: yading@10: Null audio source, return unprocessed audio frames. It is mainly useful yading@10: as a template and to be employed in analysis / debugging tools, or as yading@10: the source for filters which ignore the input data (for example the sox yading@10: synth filter). yading@10: yading@10: This source accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<channel_layout, cl> yading@10: yading@10: yading@10: Specify the channel layout, and can be either an integer or a string yading@10: representing a channel layout. The default value of I<channel_layout> yading@10: is "stereo". yading@10: yading@10: Check the channel_layout_map definition in yading@10: F<libavutil/channel_layout.c> for the mapping between strings and yading@10: channel layout values. yading@10: yading@10: yading@10: =item B<sample_rate, r> yading@10: yading@10: Specify the sample rate, and defaults to 44100. yading@10: yading@10: yading@10: =item B<nb_samples, n> yading@10: yading@10: Set the number of samples per requested frames. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Set the sample rate to 48000 Hz and the channel layout to AV_CH_LAYOUT_MONO. yading@10: yading@10: anullsrc=r=48000:cl=4 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Do the same operation with a more obvious syntax: yading@10: yading@10: anullsrc=r=48000:cl=mono yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 abuffer yading@10: yading@10: Buffer audio frames, and make them available to the filter chain. yading@10: yading@10: This source is not intended to be part of user-supplied graph descriptions but yading@10: for insertion by calling programs through the interface defined in yading@10: F<libavfilter/buffersrc.h>. yading@10: yading@10: It accepts the following named parameters: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<time_base> yading@10: yading@10: Timebase which will be used for timestamps of submitted frames. It must be yading@10: either a floating-point number or in I<numerator>/I<denominator> form. yading@10: yading@10: yading@10: =item B<sample_rate> yading@10: yading@10: Audio sample rate. yading@10: yading@10: yading@10: =item B<sample_fmt> yading@10: yading@10: Name of the sample format, as returned by C<av_get_sample_fmt_name()>. yading@10: yading@10: yading@10: =item B<channel_layout> yading@10: yading@10: Channel layout of the audio data, in the form that can be accepted by yading@10: C<av_get_channel_layout()>. yading@10: yading@10: =back yading@10: yading@10: yading@10: All the parameters need to be explicitly defined. yading@10: yading@10: yading@10: =head2 flite yading@10: yading@10: yading@10: Synthesize a voice utterance using the libflite library. yading@10: yading@10: To enable compilation of this filter you need to configure FFmpeg with yading@10: C<--enable-libflite>. yading@10: yading@10: Note that the flite library is not thread-safe. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<list_voices> yading@10: yading@10: If set to 1, list the names of the available voices and exit yading@10: immediately. Default value is 0. yading@10: yading@10: yading@10: =item B<nb_samples, n> yading@10: yading@10: Set the maximum number of samples per frame. Default value is 512. yading@10: yading@10: yading@10: =item B<textfile> yading@10: yading@10: Set the filename containing the text to speak. yading@10: yading@10: yading@10: =item B<text> yading@10: yading@10: Set the text to speak. yading@10: yading@10: yading@10: =item B<voice, v> yading@10: yading@10: Set the voice to use for the speech synthesis. Default value is yading@10: C<kal>. See also the I<list_voices> option. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Read from file F<speech.txt>, and synthetize the text using the yading@10: standard flite voice: yading@10: yading@10: flite=textfile=speech.txt yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Read the specified text selecting the C<slt> voice: yading@10: yading@10: flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Input text to ffmpeg: yading@10: yading@10: ffmpeg -f lavfi -i flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Make F<ffplay> speak the specified text, using C<flite> and yading@10: the C<lavfi> device: yading@10: yading@10: ffplay -f lavfi flite=text='No more be grieved for which that thou hast done.' yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: For more information about libflite, check: yading@10: E<lt>B<http://www.speech.cs.cmu.edu/flite/>E<gt> yading@10: yading@10: yading@10: =head2 sine yading@10: yading@10: yading@10: Generate an audio signal made of a sine wave with amplitude 1/8. yading@10: yading@10: The audio signal is bit-exact. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<frequency, f> yading@10: yading@10: Set the carrier frequency. Default is 440 Hz. yading@10: yading@10: yading@10: =item B<beep_factor, b> yading@10: yading@10: Enable a periodic beep every second with frequency I<beep_factor> times yading@10: the carrier frequency. Default is 0, meaning the beep is disabled. yading@10: yading@10: yading@10: =item B<sample_rate, s> yading@10: yading@10: Specify the sample rate, default is 44100. yading@10: yading@10: yading@10: =item B<duration, d> yading@10: yading@10: Specify the duration of the generated audio stream. yading@10: yading@10: yading@10: =item B<samples_per_frame> yading@10: yading@10: Set the number of samples per output frame, default is 1024. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Generate a simple 440 Hz sine wave: yading@10: yading@10: sine yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Generate a 220 Hz sine wave with a 880 Hz beep each second, for 5 seconds: yading@10: yading@10: sine=220:4:d=5 yading@10: sine=f=220:b=4:d=5 yading@10: sine=frequency=220:beep_factor=4:duration=5 yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: yading@10: =head1 AUDIO SINKS yading@10: yading@10: yading@10: Below is a description of the currently available audio sinks. yading@10: yading@10: yading@10: =head2 abuffersink yading@10: yading@10: yading@10: Buffer audio frames, and make them available to the end of filter chain. yading@10: yading@10: This sink is mainly intended for programmatic use, in particular yading@10: through the interface defined in F<libavfilter/buffersink.h> yading@10: or the options system. yading@10: yading@10: It accepts a pointer to an AVABufferSinkContext structure, which yading@10: defines the incoming buffers' formats, to be passed as the opaque yading@10: parameter to C<avfilter_init_filter> for initialization. yading@10: yading@10: yading@10: =head2 anullsink yading@10: yading@10: yading@10: Null audio sink, do absolutely nothing with the input audio. It is yading@10: mainly useful as a template and to be employed in analysis / debugging yading@10: tools. yading@10: yading@10: yading@10: yading@10: =head1 VIDEO FILTERS yading@10: yading@10: yading@10: When you configure your FFmpeg build, you can disable any of the yading@10: existing filters using C<--disable-filters>. yading@10: The configure output will show the video filters included in your yading@10: build. yading@10: yading@10: Below is a description of the currently available video filters. yading@10: yading@10: yading@10: =head2 alphaextract yading@10: yading@10: yading@10: Extract the alpha component from the input as a grayscale video. This yading@10: is especially useful with the I<alphamerge> filter. yading@10: yading@10: yading@10: =head2 alphamerge yading@10: yading@10: yading@10: Add or replace the alpha component of the primary input with the yading@10: grayscale value of a second input. This is intended for use with yading@10: I<alphaextract> to allow the transmission or storage of frame yading@10: sequences that have alpha in a format that doesn't support an alpha yading@10: channel. yading@10: yading@10: For example, to reconstruct full frames from a normal YUV-encoded video yading@10: and a separate video created with I<alphaextract>, you might use: yading@10: yading@10: movie=in_alpha.mkv [alpha]; [in][alpha] alphamerge [out] yading@10: yading@10: yading@10: Since this filter is designed for reconstruction, it operates on frame yading@10: sequences without considering timestamps, and terminates when either yading@10: input reaches end of stream. This will cause problems if your encoding yading@10: pipeline drops frames. If you're trying to apply an image as an yading@10: overlay to a video stream, consider the I<overlay> filter instead. yading@10: yading@10: yading@10: =head2 ass yading@10: yading@10: yading@10: Same as the subtitles filter, except that it doesn't require libavcodec yading@10: and libavformat to work. On the other hand, it is limited to ASS (Advanced yading@10: Substation Alpha) subtitles files. yading@10: yading@10: yading@10: =head2 bbox yading@10: yading@10: yading@10: Compute the bounding box for the non-black pixels in the input frame yading@10: luminance plane. yading@10: yading@10: This filter computes the bounding box containing all the pixels with a yading@10: luminance value greater than the minimum allowed value. yading@10: The parameters describing the bounding box are printed on the filter yading@10: log. yading@10: yading@10: yading@10: =head2 blackdetect yading@10: yading@10: yading@10: Detect video intervals that are (almost) completely black. Can be yading@10: useful to detect chapter transitions, commercials, or invalid yading@10: recordings. Output lines contains the time for the start, end and yading@10: duration of the detected black interval expressed in seconds. yading@10: yading@10: In order to display the output lines, you need to set the loglevel at yading@10: least to the AV_LOG_INFO value. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<black_min_duration, d> yading@10: yading@10: Set the minimum detected black duration expressed in seconds. It must yading@10: be a non-negative floating point number. yading@10: yading@10: Default value is 2.0. yading@10: yading@10: yading@10: =item B<picture_black_ratio_th, pic_th> yading@10: yading@10: Set the threshold for considering a picture "black". yading@10: Express the minimum value for the ratio: yading@10: yading@10: <nb_black_pixels> / <nb_pixels> yading@10: yading@10: yading@10: for which a picture is considered black. yading@10: Default value is 0.98. yading@10: yading@10: yading@10: =item B<pixel_black_th, pix_th> yading@10: yading@10: Set the threshold for considering a pixel "black". yading@10: yading@10: The threshold expresses the maximum pixel luminance value for which a yading@10: pixel is considered "black". The provided value is scaled according to yading@10: the following equation: yading@10: yading@10: <absolute_threshold> = <luminance_minimum_value> + <pixel_black_th> * <luminance_range_size> yading@10: yading@10: yading@10: I<luminance_range_size> and I<luminance_minimum_value> depend on yading@10: the input video format, the range is [0-255] for YUV full-range yading@10: formats and [16-235] for YUV non full-range formats. yading@10: yading@10: Default value is 0.10. yading@10: yading@10: =back yading@10: yading@10: yading@10: The following example sets the maximum pixel threshold to the minimum yading@10: value, and detects only black intervals of 2 or more seconds: yading@10: yading@10: blackdetect=d=2:pix_th=0.00 yading@10: yading@10: yading@10: yading@10: =head2 blackframe yading@10: yading@10: yading@10: Detect frames that are (almost) completely black. Can be useful to yading@10: detect chapter transitions or commercials. Output lines consist of yading@10: the frame number of the detected frame, the percentage of blackness, yading@10: the position in the file if known or -1 and the timestamp in seconds. yading@10: yading@10: In order to display the output lines, you need to set the loglevel at yading@10: least to the AV_LOG_INFO value. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<amount> yading@10: yading@10: Set the percentage of the pixels that have to be below the threshold, defaults yading@10: to C<98>. yading@10: yading@10: yading@10: =item B<threshold, thresh> yading@10: yading@10: Set the threshold below which a pixel value is considered black, defaults to yading@10: C<32>. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 blend yading@10: yading@10: yading@10: Blend two video frames into each other. yading@10: yading@10: It takes two input streams and outputs one stream, the first input is the yading@10: "top" layer and second input is "bottom" layer. yading@10: Output terminates when shortest input terminates. yading@10: yading@10: A description of the accepted options follows. yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<c0_mode> yading@10: yading@10: yading@10: =item B<c1_mode> yading@10: yading@10: yading@10: =item B<c2_mode> yading@10: yading@10: yading@10: =item B<c3_mode> yading@10: yading@10: yading@10: =item B<all_mode> yading@10: yading@10: Set blend mode for specific pixel component or all pixel components in case yading@10: of I<all_mode>. Default value is C<normal>. yading@10: yading@10: Available values for component modes are: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<addition> yading@10: yading@10: yading@10: =item B<and> yading@10: yading@10: yading@10: =item B<average> yading@10: yading@10: yading@10: =item B<burn> yading@10: yading@10: yading@10: =item B<darken> yading@10: yading@10: yading@10: =item B<difference> yading@10: yading@10: yading@10: =item B<divide> yading@10: yading@10: yading@10: =item B<dodge> yading@10: yading@10: yading@10: =item B<exclusion> yading@10: yading@10: yading@10: =item B<hardlight> yading@10: yading@10: yading@10: =item B<lighten> yading@10: yading@10: yading@10: =item B<multiply> yading@10: yading@10: yading@10: =item B<negation> yading@10: yading@10: yading@10: =item B<normal> yading@10: yading@10: yading@10: =item B<or> yading@10: yading@10: yading@10: =item B<overlay> yading@10: yading@10: yading@10: =item B<phoenix> yading@10: yading@10: yading@10: =item B<pinlight> yading@10: yading@10: yading@10: =item B<reflect> yading@10: yading@10: yading@10: =item B<screen> yading@10: yading@10: yading@10: =item B<softlight> yading@10: yading@10: yading@10: =item B<subtract> yading@10: yading@10: yading@10: =item B<vividlight> yading@10: yading@10: yading@10: =item B<xor> yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<c0_opacity> yading@10: yading@10: yading@10: =item B<c1_opacity> yading@10: yading@10: yading@10: =item B<c2_opacity> yading@10: yading@10: yading@10: =item B<c3_opacity> yading@10: yading@10: yading@10: =item B<all_opacity> yading@10: yading@10: Set blend opacity for specific pixel component or all pixel components in case yading@10: of I<all_opacity>. Only used in combination with pixel component blend modes. yading@10: yading@10: yading@10: =item B<c0_expr> yading@10: yading@10: yading@10: =item B<c1_expr> yading@10: yading@10: yading@10: =item B<c2_expr> yading@10: yading@10: yading@10: =item B<c3_expr> yading@10: yading@10: yading@10: =item B<all_expr> yading@10: yading@10: Set blend expression for specific pixel component or all pixel components in case yading@10: of I<all_expr>. Note that related mode options will be ignored if those are set. yading@10: yading@10: The expressions can use the following variables: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<N> yading@10: yading@10: The sequential number of the filtered frame, starting from C<0>. yading@10: yading@10: yading@10: =item B<X> yading@10: yading@10: yading@10: =item B<Y> yading@10: yading@10: the coordinates of the current sample yading@10: yading@10: yading@10: =item B<W> yading@10: yading@10: yading@10: =item B<H> yading@10: yading@10: the width and height of currently filtered plane yading@10: yading@10: yading@10: =item B<SW> yading@10: yading@10: yading@10: =item B<SH> yading@10: yading@10: Width and height scale depending on the currently filtered plane. It is the yading@10: ratio between the corresponding luma plane number of pixels and the current yading@10: plane ones. E.g. for YUV4:2:0 the values are C<1,1> for the luma plane, and yading@10: C<0.5,0.5> for chroma planes. yading@10: yading@10: yading@10: =item B<T> yading@10: yading@10: Time of the current frame, expressed in seconds. yading@10: yading@10: yading@10: =item B<TOP, A> yading@10: yading@10: Value of pixel component at current location for first video frame (top layer). yading@10: yading@10: yading@10: =item B<BOTTOM, B> yading@10: yading@10: Value of pixel component at current location for second video frame (bottom layer). yading@10: yading@10: =back yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Apply transition from bottom layer to top layer in first 10 seconds: yading@10: yading@10: blend=all_expr='A*(if(gte(T,10),1,T/10))+B*(1-(if(gte(T,10),1,T/10)))' yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Apply 1x1 checkerboard effect: yading@10: yading@10: blend=all_expr='if(eq(mod(X,2),mod(Y,2)),A,B)' yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 boxblur yading@10: yading@10: yading@10: Apply boxblur algorithm to the input video. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<luma_radius, lr> yading@10: yading@10: yading@10: =item B<luma_power, lp> yading@10: yading@10: yading@10: =item B<chroma_radius, cr> yading@10: yading@10: yading@10: =item B<chroma_power, cp> yading@10: yading@10: yading@10: =item B<alpha_radius, ar> yading@10: yading@10: yading@10: =item B<alpha_power, ap> yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: A description of the accepted options follows. yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<luma_radius, lr> yading@10: yading@10: yading@10: =item B<chroma_radius, cr> yading@10: yading@10: yading@10: =item B<alpha_radius, ar> yading@10: yading@10: Set an expression for the box radius in pixels used for blurring the yading@10: corresponding input plane. yading@10: yading@10: The radius value must be a non-negative number, and must not be yading@10: greater than the value of the expression C<min(w,h)/2> for the yading@10: luma and alpha planes, and of C<min(cw,ch)/2> for the chroma yading@10: planes. yading@10: yading@10: Default value for B<luma_radius> is "2". If not specified, yading@10: B<chroma_radius> and B<alpha_radius> default to the yading@10: corresponding value set for B<luma_radius>. yading@10: yading@10: The expressions can contain the following constants: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<w, h> yading@10: yading@10: the input width and height in pixels yading@10: yading@10: yading@10: =item B<cw, ch> yading@10: yading@10: the input chroma image width and height in pixels yading@10: yading@10: yading@10: =item B<hsub, vsub> yading@10: yading@10: horizontal and vertical chroma subsample values. For example for the yading@10: pixel format "yuv422p" I<hsub> is 2 and I<vsub> is 1. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<luma_power, lp> yading@10: yading@10: yading@10: =item B<chroma_power, cp> yading@10: yading@10: yading@10: =item B<alpha_power, ap> yading@10: yading@10: Specify how many times the boxblur filter is applied to the yading@10: corresponding plane. yading@10: yading@10: Default value for B<luma_power> is 2. If not specified, yading@10: B<chroma_power> and B<alpha_power> default to the yading@10: corresponding value set for B<luma_power>. yading@10: yading@10: A value of 0 will disable the effect. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Apply a boxblur filter with luma, chroma, and alpha radius yading@10: set to 2: yading@10: yading@10: boxblur=luma_radius=2:luma_power=1 yading@10: boxblur=2:1 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Set luma radius to 2, alpha and chroma radius to 0: yading@10: yading@10: boxblur=2:1:cr=0:ar=0 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Set luma and chroma radius to a fraction of the video dimension: yading@10: yading@10: boxblur=luma_radius=min(h\,w)/10:luma_power=1:chroma_radius=min(cw\,ch)/10:chroma_power=1 yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 colorbalance yading@10: yading@10: Modify intensity of primary colors (red, green and blue) of input frames. yading@10: yading@10: The filter allows an input frame to be adjusted in the shadows, midtones or highlights yading@10: regions for the red-cyan, green-magenta or blue-yellow balance. yading@10: yading@10: A positive adjustment value shifts the balance towards the primary color, a negative yading@10: value towards the complementary color. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<rs> yading@10: yading@10: yading@10: =item B<gs> yading@10: yading@10: yading@10: =item B<bs> yading@10: yading@10: Adjust red, green and blue shadows (darkest pixels). yading@10: yading@10: yading@10: =item B<rm> yading@10: yading@10: yading@10: =item B<gm> yading@10: yading@10: yading@10: =item B<bm> yading@10: yading@10: Adjust red, green and blue midtones (medium pixels). yading@10: yading@10: yading@10: =item B<rh> yading@10: yading@10: yading@10: =item B<gh> yading@10: yading@10: yading@10: =item B<bh> yading@10: yading@10: Adjust red, green and blue highlights (brightest pixels). yading@10: yading@10: Allowed ranges for options are C<[-1.0, 1.0]>. Defaults are C<0>. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Add red color cast to shadows: yading@10: yading@10: colorbalance=rs=.3 yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 colorchannelmixer yading@10: yading@10: yading@10: Adjust video input frames by re-mixing color channels. yading@10: yading@10: This filter modifies a color channel by adding the values associated to yading@10: the other channels of the same pixels. For example if the value to yading@10: modify is red, the output value will be: yading@10: yading@10: <red>=<red>*<rr> + <blue>*<rb> + <green>*<rg> + <alpha>*<ra> yading@10: yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<rr> yading@10: yading@10: yading@10: =item B<rg> yading@10: yading@10: yading@10: =item B<rb> yading@10: yading@10: yading@10: =item B<ra> yading@10: yading@10: Adjust contribution of input red, green, blue and alpha channels for output red channel. yading@10: Default is C<1> for I<rr>, and C<0> for I<rg>, I<rb> and I<ra>. yading@10: yading@10: yading@10: =item B<gr> yading@10: yading@10: yading@10: =item B<gg> yading@10: yading@10: yading@10: =item B<gb> yading@10: yading@10: yading@10: =item B<ga> yading@10: yading@10: Adjust contribution of input red, green, blue and alpha channels for output green channel. yading@10: Default is C<1> for I<gg>, and C<0> for I<gr>, I<gb> and I<ga>. yading@10: yading@10: yading@10: =item B<br> yading@10: yading@10: yading@10: =item B<bg> yading@10: yading@10: yading@10: =item B<bb> yading@10: yading@10: yading@10: =item B<ba> yading@10: yading@10: Adjust contribution of input red, green, blue and alpha channels for output blue channel. yading@10: Default is C<1> for I<bb>, and C<0> for I<br>, I<bg> and I<ba>. yading@10: yading@10: yading@10: =item B<ar> yading@10: yading@10: yading@10: =item B<ag> yading@10: yading@10: yading@10: =item B<ab> yading@10: yading@10: yading@10: =item B<aa> yading@10: yading@10: Adjust contribution of input red, green, blue and alpha channels for output alpha channel. yading@10: Default is C<1> for I<aa>, and C<0> for I<ar>, I<ag> and I<ab>. yading@10: yading@10: Allowed ranges for options are C<[-2.0, 2.0]>. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Convert source to grayscale: yading@10: yading@10: colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3 yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 colormatrix yading@10: yading@10: yading@10: Convert color matrix. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<src> yading@10: yading@10: yading@10: =item B<dst> yading@10: yading@10: Specify the source and destination color matrix. Both values must be yading@10: specified. yading@10: yading@10: The accepted values are: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<bt709> yading@10: yading@10: BT.709 yading@10: yading@10: yading@10: =item B<bt601> yading@10: yading@10: BT.601 yading@10: yading@10: yading@10: =item B<smpte240m> yading@10: yading@10: SMPTE-240M yading@10: yading@10: yading@10: =item B<fcc> yading@10: yading@10: FCC yading@10: yading@10: =back yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: For example to convert from BT.601 to SMPTE-240M, use the command: yading@10: yading@10: colormatrix=bt601:smpte240m yading@10: yading@10: yading@10: yading@10: =head2 copy yading@10: yading@10: yading@10: Copy the input source unchanged to the output. Mainly useful for yading@10: testing purposes. yading@10: yading@10: yading@10: =head2 crop yading@10: yading@10: yading@10: Crop the input video to given dimensions. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<w, out_w> yading@10: yading@10: Width of the output video. It defaults to C<iw>. yading@10: This expression is evaluated only once during the filter yading@10: configuration. yading@10: yading@10: yading@10: =item B<h, out_h> yading@10: yading@10: Height of the output video. It defaults to C<ih>. yading@10: This expression is evaluated only once during the filter yading@10: configuration. yading@10: yading@10: yading@10: =item B<x> yading@10: yading@10: Horizontal position, in the input video, of the left edge of the output video. yading@10: It defaults to C<(in_w-out_w)/2>. yading@10: This expression is evaluated per-frame. yading@10: yading@10: yading@10: =item B<y> yading@10: yading@10: Vertical position, in the input video, of the top edge of the output video. yading@10: It defaults to C<(in_h-out_h)/2>. yading@10: This expression is evaluated per-frame. yading@10: yading@10: yading@10: =item B<keep_aspect> yading@10: yading@10: If set to 1 will force the output display aspect ratio yading@10: to be the same of the input, by changing the output sample aspect yading@10: ratio. It defaults to 0. yading@10: yading@10: =back yading@10: yading@10: yading@10: The I<out_w>, I<out_h>, I<x>, I<y> parameters are yading@10: expressions containing the following constants: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<x, y> yading@10: yading@10: the computed values for I<x> and I<y>. They are evaluated for yading@10: each new frame. yading@10: yading@10: yading@10: =item B<in_w, in_h> yading@10: yading@10: the input width and height yading@10: yading@10: yading@10: =item B<iw, ih> yading@10: yading@10: same as I<in_w> and I<in_h> yading@10: yading@10: yading@10: =item B<out_w, out_h> yading@10: yading@10: the output (cropped) width and height yading@10: yading@10: yading@10: =item B<ow, oh> yading@10: yading@10: same as I<out_w> and I<out_h> yading@10: yading@10: yading@10: =item B<a> yading@10: yading@10: same as I<iw> / I<ih> yading@10: yading@10: yading@10: =item B<sar> yading@10: yading@10: input sample aspect ratio yading@10: yading@10: yading@10: =item B<dar> yading@10: yading@10: input display aspect ratio, it is the same as (I<iw> / I<ih>) * I<sar> yading@10: yading@10: yading@10: =item B<hsub, vsub> yading@10: yading@10: horizontal and vertical chroma subsample values. For example for the yading@10: pixel format "yuv422p" I<hsub> is 2 and I<vsub> is 1. yading@10: yading@10: yading@10: =item B<n> yading@10: yading@10: the number of input frame, starting from 0 yading@10: yading@10: yading@10: =item B<pos> yading@10: yading@10: the position in the file of the input frame, NAN if unknown yading@10: yading@10: yading@10: =item B<t> yading@10: yading@10: timestamp expressed in seconds, NAN if the input timestamp is unknown yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: The expression for I<out_w> may depend on the value of I<out_h>, yading@10: and the expression for I<out_h> may depend on I<out_w>, but they yading@10: cannot depend on I<x> and I<y>, as I<x> and I<y> are yading@10: evaluated after I<out_w> and I<out_h>. yading@10: yading@10: The I<x> and I<y> parameters specify the expressions for the yading@10: position of the top-left corner of the output (non-cropped) area. They yading@10: are evaluated for each frame. If the evaluated value is not valid, it yading@10: is approximated to the nearest valid value. yading@10: yading@10: The expression for I<x> may depend on I<y>, and the expression yading@10: for I<y> may depend on I<x>. yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Crop area with size 100x100 at position (12,34). yading@10: yading@10: crop=100:100:12:34 yading@10: yading@10: yading@10: Using named options, the example above becomes: yading@10: yading@10: crop=w=100:h=100:x=12:y=34 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Crop the central input area with size 100x100: yading@10: yading@10: crop=100:100 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Crop the central input area with size 2/3 of the input video: yading@10: yading@10: crop=2/3*in_w:2/3*in_h yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Crop the input video central square: yading@10: yading@10: crop=out_w=in_h yading@10: crop=in_h yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Delimit the rectangle with the top-left corner placed at position yading@10: 100:100 and the right-bottom corner corresponding to the right-bottom yading@10: corner of the input image: yading@10: yading@10: crop=in_w-100:in_h-100:100:100 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Crop 10 pixels from the left and right borders, and 20 pixels from yading@10: the top and bottom borders yading@10: yading@10: crop=in_w-2*10:in_h-2*20 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Keep only the bottom right quarter of the input image: yading@10: yading@10: crop=in_w/2:in_h/2:in_w/2:in_h/2 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Crop height for getting Greek harmony: yading@10: yading@10: crop=in_w:1/PHI*in_w yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Appply trembling effect: yading@10: yading@10: 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) yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Apply erratic camera effect depending on timestamp: yading@10: yading@10: 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)" yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Set x depending on the value of y: yading@10: yading@10: crop=in_w/2:in_h/2:y:10+10*sin(n/10) yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 cropdetect yading@10: yading@10: yading@10: Auto-detect crop size. yading@10: yading@10: Calculate necessary cropping parameters and prints the recommended yading@10: parameters through the logging system. The detected dimensions yading@10: correspond to the non-black area of the input video. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<limit> yading@10: yading@10: Set higher black value threshold, which can be optionally specified yading@10: from nothing (0) to everything (255). An intensity value greater yading@10: to the set value is considered non-black. Default value is 24. yading@10: yading@10: yading@10: =item B<round> yading@10: yading@10: Set the value for which the width/height should be divisible by. The yading@10: offset is automatically adjusted to center the video. Use 2 to get yading@10: only even dimensions (needed for 4:2:2 video). 16 is best when yading@10: encoding to most video codecs. Default value is 16. yading@10: yading@10: yading@10: =item B<reset_count, reset> yading@10: yading@10: Set the counter that determines after how many frames cropdetect will yading@10: reset the previously detected largest video area and start over to yading@10: detect the current optimal crop area. Default value is 0. yading@10: yading@10: This can be useful when channel logos distort the video area. 0 yading@10: indicates never reset and return the largest area encountered during yading@10: playback. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 curves yading@10: yading@10: yading@10: Apply color adjustments using curves. yading@10: yading@10: This filter is similar to the Adobe Photoshop and GIMP curves tools. Each yading@10: component (red, green and blue) has its values defined by I<N> key points yading@10: tied from each other using a smooth curve. The x-axis represents the pixel yading@10: values from the input frame, and the y-axis the new pixel values to be set for yading@10: the output frame. yading@10: yading@10: By default, a component curve is defined by the two points I<(0;0)> and yading@10: I<(1;1)>. This creates a straight line where each original pixel value is yading@10: "adjusted" to its own value, which means no change to the image. yading@10: yading@10: The filter allows you to redefine these two points and add some more. A new yading@10: curve (using a natural cubic spline interpolation) will be define to pass yading@10: smoothly through all these new coordinates. The new defined points needs to be yading@10: strictly increasing over the x-axis, and their I<x> and I<y> values must yading@10: be in the I<[0;1]> interval. If the computed curves happened to go outside yading@10: the vector spaces, the values will be clipped accordingly. yading@10: yading@10: If there is no key point defined in C<x=0>, the filter will automatically yading@10: insert a I<(0;0)> point. In the same way, if there is no key point defined yading@10: in C<x=1>, the filter will automatically insert a I<(1;1)> point. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<preset> yading@10: yading@10: Select one of the available color presets. This option can be used in addition yading@10: to the B<r>, B<g>, B<b> parameters; in this case, the later yading@10: options takes priority on the preset values. yading@10: Available presets are: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<none> yading@10: yading@10: yading@10: =item B<color_negative> yading@10: yading@10: yading@10: =item B<cross_process> yading@10: yading@10: yading@10: =item B<darker> yading@10: yading@10: yading@10: =item B<increase_contrast> yading@10: yading@10: yading@10: =item B<lighter> yading@10: yading@10: yading@10: =item B<linear_contrast> yading@10: yading@10: yading@10: =item B<medium_contrast> yading@10: yading@10: yading@10: =item B<negative> yading@10: yading@10: yading@10: =item B<strong_contrast> yading@10: yading@10: yading@10: =item B<vintage> yading@10: yading@10: yading@10: =back yading@10: yading@10: Default is C<none>. yading@10: yading@10: =item B<master, m> yading@10: yading@10: Set the master key points. These points will define a second pass mapping. It yading@10: is sometimes called a "luminance" or "value" mapping. It can be used with yading@10: B<r>, B<g>, B<b> or B<all> since it acts like a yading@10: post-processing LUT. yading@10: yading@10: =item B<red, r> yading@10: yading@10: Set the key points for the red component. yading@10: yading@10: =item B<green, g> yading@10: yading@10: Set the key points for the green component. yading@10: yading@10: =item B<blue, b> yading@10: yading@10: Set the key points for the blue component. yading@10: yading@10: =item B<all> yading@10: yading@10: Set the key points for all components (not including master). yading@10: Can be used in addition to the other key points component yading@10: options. In this case, the unset component(s) will fallback on this yading@10: B<all> setting. yading@10: yading@10: =item B<psfile> yading@10: yading@10: Specify a Photoshop curves file (C<.asv>) to import the settings from. yading@10: yading@10: =back yading@10: yading@10: yading@10: To avoid some filtergraph syntax conflicts, each key points list need to be yading@10: defined using the following syntax: C<x0/y0 x1/y1 x2/y2 ...>. yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Increase slightly the middle level of blue: yading@10: yading@10: curves=blue='0.5/0.58' yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Vintage effect: yading@10: yading@10: curves=r='0/0.11 .42/.51 1/0.95':g='0.50/0.48':b='0/0.22 .49/.44 1/0.8' yading@10: yading@10: Here we obtain the following coordinates for each components: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item I<red> yading@10: yading@10: C<(0;0.11) (0.42;0.51) (1;0.95)> yading@10: yading@10: =item I<green> yading@10: yading@10: C<(0;0) (0.50;0.48) (1;1)> yading@10: yading@10: =item I<blue> yading@10: yading@10: C<(0;0.22) (0.49;0.44) (1;0.80)> yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: The previous example can also be achieved with the associated built-in preset: yading@10: yading@10: curves=preset=vintage yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Or simply: yading@10: yading@10: curves=vintage yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Use a Photoshop preset and redefine the points of the green component: yading@10: yading@10: curves=psfile='MyCurvesPresets/purple.asv':green='0.45/0.53' yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: yading@10: =head2 decimate yading@10: yading@10: yading@10: Drop duplicated frames at regular intervals. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<cycle> yading@10: yading@10: Set the number of frames from which one will be dropped. Setting this to yading@10: I<N> means one frame in every batch of I<N> frames will be dropped. yading@10: Default is C<5>. yading@10: yading@10: yading@10: =item B<dupthresh> yading@10: yading@10: Set the threshold for duplicate detection. If the difference metric for a frame yading@10: is less than or equal to this value, then it is declared as duplicate. Default yading@10: is C<1.1> yading@10: yading@10: yading@10: =item B<scthresh> yading@10: yading@10: Set scene change threshold. Default is C<15>. yading@10: yading@10: yading@10: =item B<blockx> yading@10: yading@10: yading@10: =item B<blocky> yading@10: yading@10: Set the size of the x and y-axis blocks used during metric calculations. yading@10: Larger blocks give better noise suppression, but also give worse detection of yading@10: small movements. Must be a power of two. Default is C<32>. yading@10: yading@10: yading@10: =item B<ppsrc> yading@10: yading@10: Mark main input as a pre-processed input and activate clean source input yading@10: stream. This allows the input to be pre-processed with various filters to help yading@10: the metrics calculation while keeping the frame selection lossless. When set to yading@10: C<1>, the first stream is for the pre-processed input, and the second yading@10: stream is the clean source from where the kept frames are chosen. Default is yading@10: C<0>. yading@10: yading@10: yading@10: =item B<chroma> yading@10: yading@10: Set whether or not chroma is considered in the metric calculations. Default is yading@10: C<1>. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 delogo yading@10: yading@10: yading@10: Suppress a TV station logo by a simple interpolation of the surrounding yading@10: pixels. Just set a rectangle covering the logo and watch it disappear yading@10: (and sometimes something even uglier appear - your mileage may vary). yading@10: yading@10: This filter accepts the following options: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<x, y> yading@10: yading@10: Specify the top left corner coordinates of the logo. They must be yading@10: specified. yading@10: yading@10: yading@10: =item B<w, h> yading@10: yading@10: Specify the width and height of the logo to clear. They must be yading@10: specified. yading@10: yading@10: yading@10: =item B<band, t> yading@10: yading@10: Specify the thickness of the fuzzy edge of the rectangle (added to yading@10: I<w> and I<h>). The default value is 4. yading@10: yading@10: yading@10: =item B<show> yading@10: yading@10: When set to 1, a green rectangle is drawn on the screen to simplify yading@10: finding the right I<x>, I<y>, I<w>, I<h> parameters, and yading@10: I<band> is set to 4. The default value is 0. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Set a rectangle covering the area with top left corner coordinates 0,0 yading@10: and size 100x77, setting a band of size 10: yading@10: yading@10: delogo=x=0:y=0:w=100:h=77:band=10 yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 deshake yading@10: yading@10: yading@10: Attempt to fix small changes in horizontal and/or vertical shift. This yading@10: filter helps remove camera shake from hand-holding a camera, bumping a yading@10: tripod, moving on a vehicle, etc. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<x> yading@10: yading@10: yading@10: =item B<y> yading@10: yading@10: yading@10: =item B<w> yading@10: yading@10: yading@10: =item B<h> yading@10: yading@10: Specify a rectangular area where to limit the search for motion yading@10: vectors. yading@10: If desired the search for motion vectors can be limited to a yading@10: rectangular area of the frame defined by its top left corner, width yading@10: and height. These parameters have the same meaning as the drawbox yading@10: filter which can be used to visualise the position of the bounding yading@10: box. yading@10: yading@10: This is useful when simultaneous movement of subjects within the frame yading@10: might be confused for camera motion by the motion vector search. yading@10: yading@10: If any or all of I<x>, I<y>, I<w> and I<h> are set to -1 yading@10: then the full frame is used. This allows later options to be set yading@10: without specifying the bounding box for the motion vector search. yading@10: yading@10: Default - search the whole frame. yading@10: yading@10: yading@10: =item B<rx> yading@10: yading@10: yading@10: =item B<ry> yading@10: yading@10: Specify the maximum extent of movement in x and y directions in the yading@10: range 0-64 pixels. Default 16. yading@10: yading@10: yading@10: =item B<edge> yading@10: yading@10: Specify how to generate pixels to fill blanks at the edge of the yading@10: frame. Available values are: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<blank, 0> yading@10: yading@10: Fill zeroes at blank locations yading@10: yading@10: =item B<original, 1> yading@10: yading@10: Original image at blank locations yading@10: yading@10: =item B<clamp, 2> yading@10: yading@10: Extruded edge value at blank locations yading@10: yading@10: =item B<mirror, 3> yading@10: yading@10: Mirrored edge at blank locations yading@10: yading@10: =back yading@10: yading@10: Default value is B<mirror>. yading@10: yading@10: yading@10: =item B<blocksize> yading@10: yading@10: Specify the blocksize to use for motion search. Range 4-128 pixels, yading@10: default 8. yading@10: yading@10: yading@10: =item B<contrast> yading@10: yading@10: Specify the contrast threshold for blocks. Only blocks with more than yading@10: the specified contrast (difference between darkest and lightest yading@10: pixels) will be considered. Range 1-255, default 125. yading@10: yading@10: yading@10: =item B<search> yading@10: yading@10: Specify the search strategy. Available values are: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<exhaustive, 0> yading@10: yading@10: Set exhaustive search yading@10: yading@10: =item B<less, 1> yading@10: yading@10: Set less exhaustive search. yading@10: yading@10: =back yading@10: yading@10: Default value is B<exhaustive>. yading@10: yading@10: yading@10: =item B<filename> yading@10: yading@10: If set then a detailed log of the motion search is written to the yading@10: specified file. yading@10: yading@10: yading@10: =item B<opencl> yading@10: yading@10: If set to 1, specify using OpenCL capabilities, only available if yading@10: FFmpeg was configured with C<--enable-opencl>. Default value is 0. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 drawbox yading@10: yading@10: yading@10: Draw a colored box on the input image. yading@10: yading@10: This filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<x, y> yading@10: yading@10: Specify the top left corner coordinates of the box. Default to 0. yading@10: yading@10: yading@10: =item B<width, w> yading@10: yading@10: yading@10: =item B<height, h> yading@10: yading@10: Specify the width and height of the box, if 0 they are interpreted as yading@10: the input width and height. Default to 0. yading@10: yading@10: yading@10: =item B<color, c> yading@10: yading@10: Specify the color of the box to write, it can be the name of a color yading@10: (case insensitive match) or a 0xRRGGBB[AA] sequence. If the special yading@10: value C<invert> is used, the box edge color is the same as the yading@10: video with inverted luma. yading@10: yading@10: yading@10: =item B<thickness, t> yading@10: yading@10: Set the thickness of the box edge. Default value is C<4>. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Draw a black box around the edge of the input image: yading@10: yading@10: drawbox yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Draw a box with color red and an opacity of 50%: yading@10: yading@10: drawbox=10:20:200:60:red@0.5 yading@10: yading@10: yading@10: The previous example can be specified as: yading@10: yading@10: drawbox=x=10:y=20:w=200:h=60:color=red@0.5 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Fill the box with pink color: yading@10: yading@10: drawbox=x=10:y=10:w=100:h=100:color=pink@0.5:t=max yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: yading@10: =head2 drawtext yading@10: yading@10: yading@10: Draw text string or text from specified file on top of video using the yading@10: libfreetype library. yading@10: yading@10: To enable compilation of this filter you need to configure FFmpeg with yading@10: C<--enable-libfreetype>. yading@10: yading@10: yading@10: =head3 Syntax yading@10: yading@10: yading@10: The description of the accepted parameters follows. yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<box> yading@10: yading@10: Used to draw a box around text using background color. yading@10: Value should be either 1 (enable) or 0 (disable). yading@10: The default value of I<box> is 0. yading@10: yading@10: yading@10: =item B<boxcolor> yading@10: yading@10: The color to be used for drawing box around text. yading@10: Either a string (e.g. "yellow") or in 0xRRGGBB[AA] format yading@10: (e.g. "0xff00ff"), possibly followed by an alpha specifier. yading@10: The default value of I<boxcolor> is "white". yading@10: yading@10: yading@10: =item B<draw> yading@10: yading@10: Set an expression which specifies if the text should be drawn. If the yading@10: expression evaluates to 0, the text is not drawn. This is useful for yading@10: specifying that the text should be drawn only when specific conditions yading@10: are met. yading@10: yading@10: Default value is "1". yading@10: yading@10: See below for the list of accepted constants and functions. yading@10: yading@10: yading@10: =item B<expansion> yading@10: yading@10: Select how the I<text> is expanded. Can be either C<none>, yading@10: C<strftime> (deprecated) or yading@10: C<normal> (default). See the drawtext_expansion, Text expansion section yading@10: below for details. yading@10: yading@10: yading@10: =item B<fix_bounds> yading@10: yading@10: If true, check and fix text coords to avoid clipping. yading@10: yading@10: yading@10: =item B<fontcolor> yading@10: yading@10: The color to be used for drawing fonts. yading@10: Either a string (e.g. "red") or in 0xRRGGBB[AA] format yading@10: (e.g. "0xff000033"), possibly followed by an alpha specifier. yading@10: The default value of I<fontcolor> is "black". yading@10: yading@10: yading@10: =item B<fontfile> yading@10: yading@10: The font file to be used for drawing text. Path must be included. yading@10: This parameter is mandatory. yading@10: yading@10: yading@10: =item B<fontsize> yading@10: yading@10: The font size to be used for drawing text. yading@10: The default value of I<fontsize> is 16. yading@10: yading@10: yading@10: =item B<ft_load_flags> yading@10: yading@10: Flags to be used for loading the fonts. yading@10: yading@10: The flags map the corresponding flags supported by libfreetype, and are yading@10: a combination of the following values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item I<default> yading@10: yading@10: yading@10: =item I<no_scale> yading@10: yading@10: yading@10: =item I<no_hinting> yading@10: yading@10: yading@10: =item I<render> yading@10: yading@10: yading@10: =item I<no_bitmap> yading@10: yading@10: yading@10: =item I<vertical_layout> yading@10: yading@10: yading@10: =item I<force_autohint> yading@10: yading@10: yading@10: =item I<crop_bitmap> yading@10: yading@10: yading@10: =item I<pedantic> yading@10: yading@10: yading@10: =item I<ignore_global_advance_width> yading@10: yading@10: yading@10: =item I<no_recurse> yading@10: yading@10: yading@10: =item I<ignore_transform> yading@10: yading@10: yading@10: =item I<monochrome> yading@10: yading@10: yading@10: =item I<linear_design> yading@10: yading@10: yading@10: =item I<no_autohint> yading@10: yading@10: yading@10: =item I<end table> yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: Default value is "render". yading@10: yading@10: For more information consult the documentation for the FT_LOAD_* yading@10: libfreetype flags. yading@10: yading@10: yading@10: =item B<shadowcolor> yading@10: yading@10: The color to be used for drawing a shadow behind the drawn text. It yading@10: can be a color name (e.g. "yellow") or a string in the 0xRRGGBB[AA] yading@10: form (e.g. "0xff00ff"), possibly followed by an alpha specifier. yading@10: The default value of I<shadowcolor> is "black". yading@10: yading@10: yading@10: =item B<shadowx, shadowy> yading@10: yading@10: The x and y offsets for the text shadow position with respect to the yading@10: position of the text. They can be either positive or negative yading@10: values. Default value for both is "0". yading@10: yading@10: yading@10: =item B<tabsize> yading@10: yading@10: The size in number of spaces to use for rendering the tab. yading@10: Default value is 4. yading@10: yading@10: yading@10: =item B<timecode> yading@10: yading@10: Set the initial timecode representation in "hh:mm:ss[:;.]ff" yading@10: format. It can be used with or without text parameter. I<timecode_rate> yading@10: option must be specified. yading@10: yading@10: yading@10: =item B<timecode_rate, rate, r> yading@10: yading@10: Set the timecode frame rate (timecode only). yading@10: yading@10: yading@10: =item B<text> yading@10: yading@10: The text string to be drawn. The text must be a sequence of UTF-8 yading@10: encoded characters. yading@10: This parameter is mandatory if no file is specified with the parameter yading@10: I<textfile>. yading@10: yading@10: yading@10: =item B<textfile> yading@10: yading@10: A text file containing text to be drawn. The text must be a sequence yading@10: of UTF-8 encoded characters. yading@10: yading@10: This parameter is mandatory if no text string is specified with the yading@10: parameter I<text>. yading@10: yading@10: If both I<text> and I<textfile> are specified, an error is thrown. yading@10: yading@10: yading@10: =item B<reload> yading@10: yading@10: If set to 1, the I<textfile> will be reloaded before each frame. yading@10: Be sure to update it atomically, or it may be read partially, or even fail. yading@10: yading@10: yading@10: =item B<x, y> yading@10: yading@10: The expressions which specify the offsets where text will be drawn yading@10: within the video frame. They are relative to the top/left border of the yading@10: output image. yading@10: yading@10: The default value of I<x> and I<y> is "0". yading@10: yading@10: See below for the list of accepted constants and functions. yading@10: yading@10: =back yading@10: yading@10: yading@10: The parameters for I<x> and I<y> are expressions containing the yading@10: following constants and functions: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<dar> yading@10: yading@10: input display aspect ratio, it is the same as (I<w> / I<h>) * I<sar> yading@10: yading@10: yading@10: =item B<hsub, vsub> yading@10: yading@10: horizontal and vertical chroma subsample values. For example for the yading@10: pixel format "yuv422p" I<hsub> is 2 and I<vsub> is 1. yading@10: yading@10: yading@10: =item B<line_h, lh> yading@10: yading@10: the height of each text line yading@10: yading@10: yading@10: =item B<main_h, h, H> yading@10: yading@10: the input height yading@10: yading@10: yading@10: =item B<main_w, w, W> yading@10: yading@10: the input width yading@10: yading@10: yading@10: =item B<max_glyph_a, ascent> yading@10: yading@10: the maximum distance from the baseline to the highest/upper grid yading@10: coordinate used to place a glyph outline point, for all the rendered yading@10: glyphs. yading@10: It is a positive value, due to the grid's orientation with the Y axis yading@10: upwards. yading@10: yading@10: yading@10: =item B<max_glyph_d, descent> yading@10: yading@10: the maximum distance from the baseline to the lowest grid coordinate yading@10: used to place a glyph outline point, for all the rendered glyphs. yading@10: This is a negative value, due to the grid's orientation, with the Y axis yading@10: upwards. yading@10: yading@10: yading@10: =item B<max_glyph_h> yading@10: yading@10: maximum glyph height, that is the maximum height for all the glyphs yading@10: contained in the rendered text, it is equivalent to I<ascent> - yading@10: I<descent>. yading@10: yading@10: yading@10: =item B<max_glyph_w> yading@10: yading@10: maximum glyph width, that is the maximum width for all the glyphs yading@10: contained in the rendered text yading@10: yading@10: yading@10: =item B<n> yading@10: yading@10: the number of input frame, starting from 0 yading@10: yading@10: yading@10: =item B<rand(min, max)> yading@10: yading@10: return a random number included between I<min> and I<max> yading@10: yading@10: yading@10: =item B<sar> yading@10: yading@10: input sample aspect ratio yading@10: yading@10: yading@10: =item B<t> yading@10: yading@10: timestamp expressed in seconds, NAN if the input timestamp is unknown yading@10: yading@10: yading@10: =item B<text_h, th> yading@10: yading@10: the height of the rendered text yading@10: yading@10: yading@10: =item B<text_w, tw> yading@10: yading@10: the width of the rendered text yading@10: yading@10: yading@10: =item B<x, y> yading@10: yading@10: the x and y offset coordinates where the text is drawn. yading@10: yading@10: These parameters allow the I<x> and I<y> expressions to refer yading@10: each other, so you can for example specify C<y=x/dar>. yading@10: yading@10: =back yading@10: yading@10: yading@10: If libavfilter was built with C<--enable-fontconfig>, then yading@10: B<fontfile> can be a fontconfig pattern or omitted. yading@10: yading@10: yading@10: yading@10: =head3 Text expansion yading@10: yading@10: yading@10: If B<expansion> is set to C<strftime>, yading@10: the filter recognizes strftime() sequences in the provided text and yading@10: expands them accordingly. Check the documentation of strftime(). This yading@10: feature is deprecated. yading@10: yading@10: If B<expansion> is set to C<none>, the text is printed verbatim. yading@10: yading@10: If B<expansion> is set to C<normal> (which is the default), yading@10: the following expansion mechanism is used. yading@10: yading@10: The backslash character '\', followed by any character, always expands to yading@10: the second character. yading@10: yading@10: Sequence of the form C<%{...}> are expanded. The text between the yading@10: braces is a function name, possibly followed by arguments separated by ':'. yading@10: If the arguments contain special characters or delimiters (':' or '}'), yading@10: they should be escaped. yading@10: yading@10: Note that they probably must also be escaped as the value for the yading@10: B<text> option in the filter argument string and as the filter yading@10: argument in the filtergraph description, and possibly also for the shell, yading@10: that makes up to four levels of escaping; using a text file avoids these yading@10: problems. yading@10: yading@10: The following functions are available: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<expr, e> yading@10: yading@10: The expression evaluation result. yading@10: yading@10: It must take one argument specifying the expression to be evaluated, yading@10: which accepts the same constants and functions as the I<x> and yading@10: I<y> values. Note that not all constants should be used, for yading@10: example the text size is not known when evaluating the expression, so yading@10: the constants I<text_w> and I<text_h> will have an undefined yading@10: value. yading@10: yading@10: yading@10: =item B<gmtime> yading@10: yading@10: The time at which the filter is running, expressed in UTC. yading@10: It can accept an argument: a strftime() format string. yading@10: yading@10: yading@10: =item B<localtime> yading@10: yading@10: The time at which the filter is running, expressed in the local time zone. yading@10: It can accept an argument: a strftime() format string. yading@10: yading@10: yading@10: =item B<n, frame_num> yading@10: yading@10: The frame number, starting from 0. yading@10: yading@10: yading@10: =item B<pts> yading@10: yading@10: The timestamp of the current frame, in seconds, with microsecond accuracy. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Draw "Test Text" with font FreeSerif, using the default values for the yading@10: optional parameters. yading@10: yading@10: yading@10: drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'" yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Draw 'Test Text' with font FreeSerif of size 24 at position x=100 yading@10: and y=50 (counting from the top-left corner of the screen), text is yading@10: yellow with a red box around it. Both the text and the box have an yading@10: opacity of 20%. yading@10: yading@10: yading@10: drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\ yading@10: x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2" yading@10: yading@10: yading@10: Note that the double quotes are not necessary if spaces are not used yading@10: within the parameter list. yading@10: yading@10: yading@10: =item * yading@10: yading@10: Show the text at the center of the video frame: yading@10: yading@10: drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h-line_h)/2" yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Show a text line sliding from right to left in the last row of the video yading@10: frame. The file F<LONG_LINE> is assumed to contain a single line yading@10: with no newlines. yading@10: yading@10: drawtext="fontsize=15:fontfile=FreeSerif.ttf:text=LONG_LINE:y=h-line_h:x=-50*t" yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Show the content of file F<CREDITS> off the bottom of the frame and scroll up. yading@10: yading@10: drawtext="fontsize=20:fontfile=FreeSerif.ttf:textfile=CREDITS:y=h-20*t" yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Draw a single green letter "g", at the center of the input video. yading@10: The glyph baseline is placed at half screen height. yading@10: yading@10: drawtext="fontsize=60:fontfile=FreeSerif.ttf:fontcolor=green:text=g:x=(w-max_glyph_w)/2:y=h/2-ascent" yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Show text for 1 second every 3 seconds: yading@10: yading@10: drawtext="fontfile=FreeSerif.ttf:fontcolor=white:x=100:y=x/dar:draw=lt(mod(t\,3)\,1):text='blink'" yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Use fontconfig to set the font. Note that the colons need to be escaped. yading@10: yading@10: drawtext='fontfile=Linux Libertine O-40\:style=Semibold:text=FFmpeg' yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Print the date of a real-time encoding (see strftime(3)): yading@10: yading@10: drawtext='fontfile=FreeSans.ttf:text=%{localtime:%a %b %d %Y}' yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: For more information about libfreetype, check: yading@10: E<lt>B<http://www.freetype.org/>E<gt>. yading@10: yading@10: For more information about fontconfig, check: yading@10: E<lt>B<http://freedesktop.org/software/fontconfig/fontconfig-user.html>E<gt>. yading@10: yading@10: yading@10: =head2 edgedetect yading@10: yading@10: yading@10: Detect and draw edges. The filter uses the Canny Edge Detection algorithm. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<low, high> yading@10: yading@10: Set low and high threshold values used by the Canny thresholding yading@10: algorithm. yading@10: yading@10: The high threshold selects the "strong" edge pixels, which are then yading@10: connected through 8-connectivity with the "weak" edge pixels selected yading@10: by the low threshold. yading@10: yading@10: I<low> and I<high> threshold values must be choosen in the range yading@10: [0,1], and I<low> should be lesser or equal to I<high>. yading@10: yading@10: Default value for I<low> is C<20/255>, and default value for I<high> yading@10: is C<50/255>. yading@10: yading@10: =back yading@10: yading@10: yading@10: Example: yading@10: yading@10: edgedetect=low=0.1:high=0.4 yading@10: yading@10: yading@10: yading@10: =head2 fade yading@10: yading@10: yading@10: Apply fade-in/out effect to input video. yading@10: yading@10: This filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<type, t> yading@10: yading@10: The effect type -- can be either "in" for fade-in, or "out" for a fade-out yading@10: effect. yading@10: Default is C<in>. yading@10: yading@10: yading@10: =item B<start_frame, s> yading@10: yading@10: Specify the number of the start frame for starting to apply the fade yading@10: effect. Default is 0. yading@10: yading@10: yading@10: =item B<nb_frames, n> yading@10: yading@10: The number of frames for which the fade effect has to last. At the end of the yading@10: fade-in effect the output video will have the same intensity as the input video, yading@10: at the end of the fade-out transition the output video will be completely black. yading@10: Default is 25. yading@10: yading@10: yading@10: =item B<alpha> yading@10: yading@10: If set to 1, fade only alpha channel, if one exists on the input. yading@10: Default value is 0. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Fade in first 30 frames of video: yading@10: yading@10: fade=in:0:30 yading@10: yading@10: yading@10: The command above is equivalent to: yading@10: yading@10: fade=t=in:s=0:n=30 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Fade out last 45 frames of a 200-frame video: yading@10: yading@10: fade=out:155:45 yading@10: fade=type=out:start_frame=155:nb_frames=45 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Fade in first 25 frames and fade out last 25 frames of a 1000-frame video: yading@10: yading@10: fade=in:0:25, fade=out:975:25 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Make first 5 frames black, then fade in from frame 5-24: yading@10: yading@10: fade=in:5:20 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Fade in alpha over first 25 frames of video: yading@10: yading@10: fade=in:0:25:alpha=1 yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 field yading@10: yading@10: yading@10: Extract a single field from an interlaced image using stride yading@10: arithmetic to avoid wasting CPU time. The output frames are marked as yading@10: non-interlaced. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<type> yading@10: yading@10: Specify whether to extract the top (if the value is C<0> or yading@10: C<top>) or the bottom field (if the value is C<1> or yading@10: C<bottom>). yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 fieldmatch yading@10: yading@10: yading@10: Field matching filter for inverse telecine. It is meant to reconstruct the yading@10: progressive frames from a telecined stream. The filter does not drop duplicated yading@10: frames, so to achieve a complete inverse telecine C<fieldmatch> needs to be yading@10: followed by a decimation filter such as decimate in the filtergraph. yading@10: yading@10: The separation of the field matching and the decimation is notably motivated by yading@10: the possibility of inserting a de-interlacing filter fallback between the two. yading@10: If the source has mixed telecined and real interlaced content, yading@10: C<fieldmatch> will not be able to match fields for the interlaced parts. yading@10: But these remaining combed frames will be marked as interlaced, and thus can be yading@10: de-interlaced by a later filter such as yadif before decimation. yading@10: yading@10: In addition to the various configuration options, C<fieldmatch> can take an yading@10: optional second stream, activated through the B<ppsrc> option. If yading@10: enabled, the frames reconstruction will be based on the fields and frames from yading@10: this second stream. This allows the first input to be pre-processed in order to yading@10: help the various algorithms of the filter, while keeping the output lossless yading@10: (assuming the fields are matched properly). Typically, a field-aware denoiser, yading@10: or brightness/contrast adjustments can help. yading@10: yading@10: Note that this filter uses the same algorithms as TIVTC/TFM (AviSynth project) yading@10: and VIVTC/VFM (VapourSynth project). The later is a light clone of TFM from yading@10: which C<fieldmatch> is based on. While the semantic and usage are very yading@10: close, some behaviour and options names can differ. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<order> yading@10: yading@10: Specify the assumed field order of the input stream. Available values are: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<auto> yading@10: yading@10: Auto detect parity (use FFmpeg's internal parity value). yading@10: yading@10: =item B<bff> yading@10: yading@10: Assume bottom field first. yading@10: yading@10: =item B<tff> yading@10: yading@10: Assume top field first. yading@10: yading@10: =back yading@10: yading@10: yading@10: Note that it is sometimes recommended not to trust the parity announced by the yading@10: stream. yading@10: yading@10: Default value is I<auto>. yading@10: yading@10: yading@10: =item B<mode> yading@10: yading@10: Set the matching mode or strategy to use. B<pc> mode is the safest in the yading@10: sense that it wont risk creating jerkiness due to duplicate frames when yading@10: possible, but if there are bad edits or blended fields it will end up yading@10: outputting combed frames when a good match might actually exist. On the other yading@10: hand, B<pcn_ub> mode is the most risky in terms of creating jerkiness, yading@10: but will almost always find a good frame if there is one. The other values are yading@10: all somewhere in between B<pc> and B<pcn_ub> in terms of risking yading@10: jerkiness and creating duplicate frames versus finding good matches in sections yading@10: with bad edits, orphaned fields, blended fields, etc. yading@10: yading@10: More details about p/c/n/u/b are available in p/c/n/u/b meaning section. yading@10: yading@10: Available values are: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<pc> yading@10: yading@10: 2-way matching (p/c) yading@10: yading@10: =item B<pc_n> yading@10: yading@10: 2-way matching, and trying 3rd match if still combed (p/c + n) yading@10: yading@10: =item B<pc_u> yading@10: yading@10: 2-way matching, and trying 3rd match (same order) if still combed (p/c + u) yading@10: yading@10: =item B<pc_n_ub> yading@10: yading@10: 2-way matching, trying 3rd match if still combed, and trying 4th/5th matches if yading@10: still combed (p/c + n + u/b) yading@10: yading@10: =item B<pcn> yading@10: yading@10: 3-way matching (p/c/n) yading@10: yading@10: =item B<pcn_ub> yading@10: yading@10: 3-way matching, and trying 4th/5th matches if all 3 of the original matches are yading@10: detected as combed (p/c/n + u/b) yading@10: yading@10: =back yading@10: yading@10: yading@10: The parenthesis at the end indicate the matches that would be used for that yading@10: mode assuming B<order>=I<tff> (and B<field> on I<auto> or yading@10: I<top>). yading@10: yading@10: In terms of speed B<pc> mode is by far the fastest and B<pcn_ub> is yading@10: the slowest. yading@10: yading@10: Default value is I<pc_n>. yading@10: yading@10: yading@10: =item B<ppsrc> yading@10: yading@10: Mark the main input stream as a pre-processed input, and enable the secondary yading@10: input stream as the clean source to pick the fields from. See the filter yading@10: introduction for more details. It is similar to the B<clip2> feature from yading@10: VFM/TFM. yading@10: yading@10: Default value is C<0> (disabled). yading@10: yading@10: yading@10: =item B<field> yading@10: yading@10: Set the field to match from. It is recommended to set this to the same value as yading@10: B<order> unless you experience matching failures with that setting. In yading@10: certain circumstances changing the field that is used to match from can have a yading@10: large impact on matching performance. Available values are: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<auto> yading@10: yading@10: Automatic (same value as B<order>). yading@10: yading@10: =item B<bottom> yading@10: yading@10: Match from the bottom field. yading@10: yading@10: =item B<top> yading@10: yading@10: Match from the top field. yading@10: yading@10: =back yading@10: yading@10: yading@10: Default value is I<auto>. yading@10: yading@10: yading@10: =item B<mchroma> yading@10: yading@10: Set whether or not chroma is included during the match comparisons. In most yading@10: cases it is recommended to leave this enabled. You should set this to C<0> yading@10: only if your clip has bad chroma problems such as heavy rainbowing or other yading@10: artifacts. Setting this to C<0> could also be used to speed things up at yading@10: the cost of some accuracy. yading@10: yading@10: Default value is C<1>. yading@10: yading@10: yading@10: =item B<y0> yading@10: yading@10: yading@10: =item B<y1> yading@10: yading@10: These define an exclusion band which excludes the lines between B<y0> and yading@10: B<y1> from being included in the field matching decision. An exclusion yading@10: band can be used to ignore subtitles, a logo, or other things that may yading@10: interfere with the matching. B<y0> sets the starting scan line and yading@10: B<y1> sets the ending line; all lines in between B<y0> and yading@10: B<y1> (including B<y0> and B<y1>) will be ignored. Setting yading@10: B<y0> and B<y1> to the same value will disable the feature. yading@10: B<y0> and B<y1> defaults to C<0>. yading@10: yading@10: yading@10: =item B<scthresh> yading@10: yading@10: Set the scene change detection threshold as a percentage of maximum change on yading@10: the luma plane. Good values are in the C<[8.0, 14.0]> range. Scene change yading@10: detection is only relevant in case B<combmatch>=I<sc>. The range for yading@10: B<scthresh> is C<[0.0, 100.0]>. yading@10: yading@10: Default value is C<12.0>. yading@10: yading@10: yading@10: =item B<combmatch> yading@10: yading@10: When B<combatch> is not I<none>, C<fieldmatch> will take into yading@10: account the combed scores of matches when deciding what match to use as the yading@10: final match. Available values are: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<none> yading@10: yading@10: No final matching based on combed scores. yading@10: yading@10: =item B<sc> yading@10: yading@10: Combed scores are only used when a scene change is detected. yading@10: yading@10: =item B<full> yading@10: yading@10: Use combed scores all the time. yading@10: yading@10: =back yading@10: yading@10: yading@10: Default is I<sc>. yading@10: yading@10: yading@10: =item B<combdbg> yading@10: yading@10: Force C<fieldmatch> to calculate the combed metrics for certain matches and yading@10: print them. This setting is known as B<micout> in TFM/VFM vocabulary. yading@10: Available values are: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<none> yading@10: yading@10: No forced calculation. yading@10: yading@10: =item B<pcn> yading@10: yading@10: Force p/c/n calculations. yading@10: yading@10: =item B<pcnub> yading@10: yading@10: Force p/c/n/u/b calculations. yading@10: yading@10: =back yading@10: yading@10: yading@10: Default value is I<none>. yading@10: yading@10: yading@10: =item B<cthresh> yading@10: yading@10: This is the area combing threshold used for combed frame detection. This yading@10: essentially controls how "strong" or "visible" combing must be to be detected. yading@10: Larger values mean combing must be more visible and smaller values mean combing yading@10: can be less visible or strong and still be detected. Valid settings are from yading@10: C<-1> (every pixel will be detected as combed) to C<255> (no pixel will yading@10: be detected as combed). This is basically a pixel difference value. A good yading@10: range is C<[8, 12]>. yading@10: yading@10: Default value is C<9>. yading@10: yading@10: yading@10: =item B<chroma> yading@10: yading@10: Sets whether or not chroma is considered in the combed frame decision. Only yading@10: disable this if your source has chroma problems (rainbowing, etc.) that are yading@10: causing problems for the combed frame detection with chroma enabled. Actually, yading@10: using B<chroma>=I<0> is usually more reliable, except for the case yading@10: where there is chroma only combing in the source. yading@10: yading@10: Default value is C<0>. yading@10: yading@10: yading@10: =item B<blockx> yading@10: yading@10: yading@10: =item B<blocky> yading@10: yading@10: Respectively set the x-axis and y-axis size of the window used during combed yading@10: frame detection. This has to do with the size of the area in which yading@10: B<combpel> pixels are required to be detected as combed for a frame to be yading@10: declared combed. See the B<combpel> parameter description for more info. yading@10: Possible values are any number that is a power of 2 starting at 4 and going up yading@10: to 512. yading@10: yading@10: Default value is C<16>. yading@10: yading@10: yading@10: =item B<combpel> yading@10: yading@10: The number of combed pixels inside any of the B<blocky> by yading@10: B<blockx> size blocks on the frame for the frame to be detected as yading@10: combed. While B<cthresh> controls how "visible" the combing must be, this yading@10: setting controls "how much" combing there must be in any localized area (a yading@10: window defined by the B<blockx> and B<blocky> settings) on the yading@10: frame. Minimum value is C<0> and maximum is C<blocky x blockx> (at yading@10: which point no frames will ever be detected as combed). This setting is known yading@10: as B<MI> in TFM/VFM vocabulary. yading@10: yading@10: Default value is C<80>. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: yading@10: =head3 p/c/n/u/b meaning yading@10: yading@10: yading@10: yading@10: =head4 p/c/n yading@10: yading@10: yading@10: We assume the following telecined stream: yading@10: yading@10: yading@10: Top fields: 1 2 2 3 4 yading@10: Bottom fields: 1 2 3 4 4 yading@10: yading@10: yading@10: The numbers correspond to the progressive frame the fields relate to. Here, the yading@10: first two frames are progressive, the 3rd and 4th are combed, and so on. yading@10: yading@10: When C<fieldmatch> is configured to run a matching from bottom yading@10: (B<field>=I<bottom>) this is how this input stream get transformed: yading@10: yading@10: yading@10: Input stream: yading@10: T 1 2 2 3 4 yading@10: B 1 2 3 4 4 <-- matching reference yading@10: yading@10: Matches: c c n n c yading@10: yading@10: Output stream: yading@10: T 1 2 3 4 4 yading@10: B 1 2 3 4 4 yading@10: yading@10: yading@10: As a result of the field matching, we can see that some frames get duplicated. yading@10: To perform a complete inverse telecine, you need to rely on a decimation filter yading@10: after this operation. See for instance the decimate filter. yading@10: yading@10: The same operation now matching from top fields (B<field>=I<top>) yading@10: looks like this: yading@10: yading@10: yading@10: Input stream: yading@10: T 1 2 2 3 4 <-- matching reference yading@10: B 1 2 3 4 4 yading@10: yading@10: Matches: c c p p c yading@10: yading@10: Output stream: yading@10: T 1 2 2 3 4 yading@10: B 1 2 2 3 4 yading@10: yading@10: yading@10: In these examples, we can see what I<p>, I<c> and I<n> mean; yading@10: basically, they refer to the frame and field of the opposite parity: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item *<I<p> matches the field of the opposite parity in the previous frame> yading@10: yading@10: yading@10: =item *<I<c> matches the field of the opposite parity in the current frame> yading@10: yading@10: yading@10: =item *<I<n> matches the field of the opposite parity in the next frame> yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head4 u/b yading@10: yading@10: yading@10: The I<u> and I<b> matching are a bit special in the sense that they match yading@10: from the opposite parity flag. In the following examples, we assume that we are yading@10: currently matching the 2nd frame (Top:2, bottom:2). According to the match, a yading@10: 'x' is placed above and below each matched fields. yading@10: yading@10: With bottom matching (B<field>=I<bottom>): yading@10: yading@10: Match: c p n b u yading@10: yading@10: x x x x x yading@10: Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2 yading@10: Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 yading@10: x x x x x yading@10: yading@10: Output frames: yading@10: 2 1 2 2 2 yading@10: 2 2 2 1 3 yading@10: yading@10: yading@10: With top matching (B<field>=I<top>): yading@10: yading@10: Match: c p n b u yading@10: yading@10: x x x x x yading@10: Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2 yading@10: Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 yading@10: x x x x x yading@10: yading@10: Output frames: yading@10: 2 2 2 1 2 yading@10: 2 1 3 2 2 yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: Simple IVTC of a top field first telecined stream: yading@10: yading@10: fieldmatch=order=tff:combmatch=none, decimate yading@10: yading@10: yading@10: Advanced IVTC, with fallback on yadif for still combed frames: yading@10: yading@10: fieldmatch=order=tff:combmatch=full, yadif=deint=interlaced, decimate yading@10: yading@10: yading@10: yading@10: =head2 fieldorder yading@10: yading@10: yading@10: Transform the field order of the input video. yading@10: yading@10: This filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<order> yading@10: yading@10: Output field order. Valid values are I<tff> for top field first or I<bff> yading@10: for bottom field first. yading@10: yading@10: =back yading@10: yading@10: yading@10: Default value is B<tff>. yading@10: yading@10: Transformation is achieved by shifting the picture content up or down yading@10: by one line, and filling the remaining line with appropriate picture content. yading@10: This method is consistent with most broadcast field order converters. yading@10: yading@10: If the input video is not flagged as being interlaced, or it is already yading@10: flagged as being of the required output field order then this filter does yading@10: not alter the incoming video. yading@10: yading@10: This filter is very useful when converting to or from PAL DV material, yading@10: which is bottom field first. yading@10: yading@10: For example: yading@10: yading@10: ffmpeg -i in.vob -vf "fieldorder=bff" out.dv yading@10: yading@10: yading@10: yading@10: =head2 fifo yading@10: yading@10: yading@10: Buffer input images and send them when they are requested. yading@10: yading@10: This filter is mainly useful when auto-inserted by the libavfilter yading@10: framework. yading@10: yading@10: The filter does not take parameters. yading@10: yading@10: yading@10: yading@10: =head2 format yading@10: yading@10: yading@10: Convert the input video to one of the specified pixel formats. yading@10: Libavfilter will try to pick one that is supported for the input to yading@10: the next filter. yading@10: yading@10: This filter accepts the following parameters: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<pix_fmts> yading@10: yading@10: A '|'-separated list of pixel format names, for example yading@10: "pix_fmts=yuv420p|monow|rgb24". yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Convert the input video to the format I<yuv420p> yading@10: yading@10: format=pix_fmts=yuv420p yading@10: yading@10: yading@10: Convert the input video to any of the formats in the list yading@10: yading@10: format=pix_fmts=yuv420p|yuv444p|yuv410p yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 fps yading@10: yading@10: yading@10: Convert the video to specified constant frame rate by duplicating or dropping yading@10: frames as necessary. yading@10: yading@10: This filter accepts the following named parameters: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<fps> yading@10: yading@10: Desired output frame rate. The default is C<25>. yading@10: yading@10: yading@10: =item B<round> yading@10: yading@10: Rounding method. yading@10: yading@10: Possible values are: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<zero> yading@10: yading@10: zero round towards 0 yading@10: yading@10: =item B<inf> yading@10: yading@10: round away from 0 yading@10: yading@10: =item B<down> yading@10: yading@10: round towards -infinity yading@10: yading@10: =item B<up> yading@10: yading@10: round towards +infinity yading@10: yading@10: =item B<near> yading@10: yading@10: round to nearest yading@10: yading@10: =back yading@10: yading@10: The default is C<near>. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: Alternatively, the options can be specified as a flat string: yading@10: I<fps>[:I<round>]. yading@10: yading@10: See also the setpts filter. yading@10: yading@10: yading@10: =head2 framestep yading@10: yading@10: yading@10: Select one frame every N-th frame. yading@10: yading@10: This filter accepts the following option: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<step> yading@10: yading@10: Select frame after every C<step> frames. yading@10: Allowed values are positive integers higher than 0. Default value is C<1>. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: yading@10: =head2 frei0r yading@10: yading@10: yading@10: Apply a frei0r effect to the input video. yading@10: yading@10: To enable compilation of this filter you need to install the frei0r yading@10: header and configure FFmpeg with C<--enable-frei0r>. yading@10: yading@10: This filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<filter_name> yading@10: yading@10: The name to the frei0r effect to load. If the environment variable yading@10: B<FREI0R_PATH> is defined, the frei0r effect is searched in each one of the yading@10: directories specified by the colon separated list in B<FREIOR_PATH>, yading@10: otherwise in the standard frei0r paths, which are in this order: yading@10: F<HOME/.frei0r-1/lib/>, F</usr/local/lib/frei0r-1/>, yading@10: F</usr/lib/frei0r-1/>. yading@10: yading@10: yading@10: =item B<filter_params> yading@10: yading@10: A '|'-separated list of parameters to pass to the frei0r effect. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: A frei0r effect parameter can be a boolean (whose values are specified yading@10: with "y" and "n"), a double, a color (specified by the syntax yading@10: I<R>/I<G>/I<B>, I<R>, I<G>, and I<B> being float yading@10: numbers from 0.0 to 1.0) or by an C<av_parse_color()> color yading@10: description), a position (specified by the syntax I<X>/I<Y>, yading@10: I<X> and I<Y> being float numbers) and a string. yading@10: yading@10: The number and kind of parameters depend on the loaded effect. If an yading@10: effect parameter is not specified the default value is set. yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Apply the distort0r effect, set the first two double parameters: yading@10: yading@10: frei0r=filter_name=distort0r:filter_params=0.5|0.01 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Apply the colordistance effect, take a color as first parameter: yading@10: yading@10: frei0r=colordistance:0.2/0.3/0.4 yading@10: frei0r=colordistance:violet yading@10: frei0r=colordistance:0x112233 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Apply the perspective effect, specify the top left and top right image yading@10: positions: yading@10: yading@10: frei0r=perspective:0.2/0.2|0.8/0.2 yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: For more information see: yading@10: E<lt>B<http://frei0r.dyne.org>E<gt> yading@10: yading@10: yading@10: =head2 geq yading@10: yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<lum_expr> yading@10: yading@10: the luminance expression yading@10: yading@10: =item B<cb_expr> yading@10: yading@10: the chrominance blue expression yading@10: yading@10: =item B<cr_expr> yading@10: yading@10: the chrominance red expression yading@10: yading@10: =item B<alpha_expr> yading@10: yading@10: the alpha expression yading@10: yading@10: =back yading@10: yading@10: yading@10: If one of the chrominance expression is not defined, it falls back on the other yading@10: one. If no alpha expression is specified it will evaluate to opaque value. yading@10: If none of chrominance expressions are yading@10: specified, they will evaluate the luminance expression. yading@10: yading@10: The expressions can use the following variables and functions: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<N> yading@10: yading@10: The sequential number of the filtered frame, starting from C<0>. yading@10: yading@10: yading@10: =item B<X> yading@10: yading@10: yading@10: =item B<Y> yading@10: yading@10: The coordinates of the current sample. yading@10: yading@10: yading@10: =item B<W> yading@10: yading@10: yading@10: =item B<H> yading@10: yading@10: The width and height of the image. yading@10: yading@10: yading@10: =item B<SW> yading@10: yading@10: yading@10: =item B<SH> yading@10: yading@10: Width and height scale depending on the currently filtered plane. It is the yading@10: ratio between the corresponding luma plane number of pixels and the current yading@10: plane ones. E.g. for YUV4:2:0 the values are C<1,1> for the luma plane, and yading@10: C<0.5,0.5> for chroma planes. yading@10: yading@10: yading@10: =item B<T> yading@10: yading@10: Time of the current frame, expressed in seconds. yading@10: yading@10: yading@10: =item B<p(x, y)> yading@10: yading@10: Return the value of the pixel at location (I<x>,I<y>) of the current yading@10: plane. yading@10: yading@10: yading@10: =item B<lum(x, y)> yading@10: yading@10: Return the value of the pixel at location (I<x>,I<y>) of the luminance yading@10: plane. yading@10: yading@10: yading@10: =item B<cb(x, y)> yading@10: yading@10: Return the value of the pixel at location (I<x>,I<y>) of the yading@10: blue-difference chroma plane. Returns 0 if there is no such plane. yading@10: yading@10: yading@10: =item B<cr(x, y)> yading@10: yading@10: Return the value of the pixel at location (I<x>,I<y>) of the yading@10: red-difference chroma plane. Returns 0 if there is no such plane. yading@10: yading@10: yading@10: =item B<alpha(x, y)> yading@10: yading@10: Return the value of the pixel at location (I<x>,I<y>) of the alpha yading@10: plane. Returns 0 if there is no such plane. yading@10: yading@10: =back yading@10: yading@10: yading@10: For functions, if I<x> and I<y> are outside the area, the value will be yading@10: automatically clipped to the closer edge. yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Flip the image horizontally: yading@10: yading@10: geq=p(W-X\,Y) yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Generate a bidimensional sine wave, with angle C<PI/3> and a yading@10: wavelength of 100 pixels: yading@10: yading@10: geq=128 + 100*sin(2*(PI/100)*(cos(PI/3)*(X-50*T) + sin(PI/3)*Y)):128:128 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Generate a fancy enigmatic moving light: yading@10: yading@10: nullsrc=s=256x256,geq=random(1)/hypot(X-cos(N*0.07)*W/2-W/2\,Y-sin(N*0.09)*H/2-H/2)^2*1000000*sin(N*0.02):128:128 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Generate a quick emboss effect: yading@10: yading@10: format=gray,geq=lum_expr='(p(X,Y)+(256-p(X-4,Y-4)))/2' yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 gradfun yading@10: yading@10: yading@10: Fix the banding artifacts that are sometimes introduced into nearly flat yading@10: regions by truncation to 8bit color depth. yading@10: Interpolate the gradients that should go where the bands are, and yading@10: dither them. yading@10: yading@10: This filter is designed for playback only. Do not use it prior to yading@10: lossy compression, because compression tends to lose the dither and yading@10: bring back the bands. yading@10: yading@10: This filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<strength> yading@10: yading@10: The maximum amount by which the filter will change any one pixel. Also the yading@10: threshold for detecting nearly flat regions. Acceptable values range from .51 to yading@10: 64, default value is 1.2, out-of-range values will be clipped to the valid yading@10: range. yading@10: yading@10: yading@10: =item B<radius> yading@10: yading@10: The neighborhood to fit the gradient to. A larger radius makes for smoother yading@10: gradients, but also prevents the filter from modifying the pixels near detailed yading@10: regions. Acceptable values are 8-32, default value is 16, out-of-range values yading@10: will be clipped to the valid range. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: Alternatively, the options can be specified as a flat string: yading@10: I<strength>[:I<radius>] yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Apply the filter with a C<3.5> strength and radius of C<8>: yading@10: yading@10: gradfun=3.5:8 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Specify radius, omitting the strength (which will fall-back to the default yading@10: value): yading@10: yading@10: gradfun=radius=8 yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 hflip yading@10: yading@10: yading@10: Flip the input video horizontally. yading@10: yading@10: For example to horizontally flip the input video with B<ffmpeg>: yading@10: yading@10: ffmpeg -i in.avi -vf "hflip" out.avi yading@10: yading@10: yading@10: yading@10: =head2 histeq yading@10: yading@10: This filter applies a global color histogram equalization on a yading@10: per-frame basis. yading@10: yading@10: It can be used to correct video that has a compressed range of pixel yading@10: intensities. The filter redistributes the pixel intensities to yading@10: equalize their distribution across the intensity range. It may be yading@10: viewed as an "automatically adjusting contrast filter". This filter is yading@10: useful only for correcting degraded or poorly captured source yading@10: video. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<strength> yading@10: yading@10: Determine the amount of equalization to be applied. As the strength yading@10: is reduced, the distribution of pixel intensities more-and-more yading@10: approaches that of the input frame. The value must be a float number yading@10: in the range [0,1] and defaults to 0.200. yading@10: yading@10: yading@10: =item B<intensity> yading@10: yading@10: Set the maximum intensity that can generated and scale the output yading@10: values appropriately. The strength should be set as desired and then yading@10: the intensity can be limited if needed to avoid washing-out. The value yading@10: must be a float number in the range [0,1] and defaults to 0.210. yading@10: yading@10: yading@10: =item B<antibanding> yading@10: yading@10: Set the antibanding level. If enabled the filter will randomly vary yading@10: the luminance of output pixels by a small amount to avoid banding of yading@10: the histogram. Possible values are C<none>, C<weak> or yading@10: C<strong>. It defaults to C<none>. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 histogram yading@10: yading@10: yading@10: Compute and draw a color distribution histogram for the input video. yading@10: yading@10: The computed histogram is a representation of distribution of color components yading@10: in an image. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<mode> yading@10: yading@10: Set histogram mode. yading@10: yading@10: It accepts the following values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<levels> yading@10: yading@10: standard histogram that display color components distribution in an image. yading@10: Displays color graph for each color component. Shows distribution yading@10: of the Y, U, V, A or G, B, R components, depending on input format, yading@10: in current frame. Bellow each graph is color component scale meter. yading@10: yading@10: yading@10: =item B<color> yading@10: yading@10: chroma values in vectorscope, if brighter more such chroma values are yading@10: distributed in an image. yading@10: Displays chroma values (U/V color placement) in two dimensional graph yading@10: (which is called a vectorscope). It can be used to read of the hue and yading@10: saturation of the current frame. At a same time it is a histogram. yading@10: The whiter a pixel in the vectorscope, the more pixels of the input frame yading@10: correspond to that pixel (that is the more pixels have this chroma value). yading@10: The V component is displayed on the horizontal (X) axis, with the leftmost yading@10: side being V = 0 and the rightmost side being V = 255. yading@10: The U component is displayed on the vertical (Y) axis, with the top yading@10: representing U = 0 and the bottom representing U = 255. yading@10: yading@10: The position of a white pixel in the graph corresponds to the chroma value yading@10: of a pixel of the input clip. So the graph can be used to read of the yading@10: hue (color flavor) and the saturation (the dominance of the hue in the color). yading@10: As the hue of a color changes, it moves around the square. At the center of yading@10: the square, the saturation is zero, which means that the corresponding pixel yading@10: has no color. If you increase the amount of a specific color, while leaving yading@10: the other colors unchanged, the saturation increases, and you move towards yading@10: the edge of the square. yading@10: yading@10: yading@10: =item B<color2> yading@10: yading@10: chroma values in vectorscope, similar as C<color> but actual chroma values yading@10: are displayed. yading@10: yading@10: yading@10: =item B<waveform> yading@10: yading@10: per row/column color component graph. In row mode graph in the left side represents yading@10: color component value 0 and right side represents value = 255. In column mode top yading@10: side represents color component value = 0 and bottom side represents value = 255. yading@10: yading@10: =back yading@10: yading@10: Default value is C<levels>. yading@10: yading@10: yading@10: =item B<level_height> yading@10: yading@10: Set height of level in C<levels>. Default value is C<200>. yading@10: Allowed range is [50, 2048]. yading@10: yading@10: yading@10: =item B<scale_height> yading@10: yading@10: Set height of color scale in C<levels>. Default value is C<12>. yading@10: Allowed range is [0, 40]. yading@10: yading@10: yading@10: =item B<step> yading@10: yading@10: Set step for C<waveform> mode. Smaller values are useful to find out how much yading@10: of same luminance values across input rows/columns are distributed. yading@10: Default value is C<10>. Allowed range is [1, 255]. yading@10: yading@10: yading@10: =item B<waveform_mode> yading@10: yading@10: Set mode for C<waveform>. Can be either C<row>, or C<column>. yading@10: Default is C<row>. yading@10: yading@10: yading@10: =item B<display_mode> yading@10: yading@10: Set display mode for C<waveform> and C<levels>. yading@10: It accepts the following values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<parade> yading@10: yading@10: Display separate graph for the color components side by side in yading@10: C<row> waveform mode or one below other in C<column> waveform mode yading@10: for C<waveform> histogram mode. For C<levels> histogram mode yading@10: per color component graphs are placed one bellow other. yading@10: yading@10: This display mode in C<waveform> histogram mode makes it easy to spot yading@10: color casts in the highlights and shadows of an image, by comparing the yading@10: contours of the top and the bottom of each waveform. yading@10: Since whites, grays, and blacks are characterized by yading@10: exactly equal amounts of red, green, and blue, neutral areas of the yading@10: picture should display three waveforms of roughly equal width/height. yading@10: If not, the correction is easy to make by making adjustments to level the yading@10: three waveforms. yading@10: yading@10: yading@10: =item B<overlay> yading@10: yading@10: Presents information that's identical to that in the C<parade>, except yading@10: that the graphs representing color components are superimposed directly yading@10: over one another. yading@10: yading@10: This display mode in C<waveform> histogram mode can make it easier to spot yading@10: the relative differences or similarities in overlapping areas of the color yading@10: components that are supposed to be identical, such as neutral whites, grays, yading@10: or blacks. yading@10: yading@10: =back yading@10: yading@10: Default is C<parade>. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Calculate and draw histogram: yading@10: yading@10: ffplay -i input -vf histogram yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 hqdn3d yading@10: yading@10: yading@10: High precision/quality 3d denoise filter. This filter aims to reduce yading@10: image noise producing smooth images and making still images really yading@10: still. It should enhance compressibility. yading@10: yading@10: It accepts the following optional parameters: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<luma_spatial> yading@10: yading@10: a non-negative float number which specifies spatial luma strength, yading@10: defaults to 4.0 yading@10: yading@10: yading@10: =item B<chroma_spatial> yading@10: yading@10: a non-negative float number which specifies spatial chroma strength, yading@10: defaults to 3.0*I<luma_spatial>/4.0 yading@10: yading@10: yading@10: =item B<luma_tmp> yading@10: yading@10: a float number which specifies luma temporal strength, defaults to yading@10: 6.0*I<luma_spatial>/4.0 yading@10: yading@10: yading@10: =item B<chroma_tmp> yading@10: yading@10: a float number which specifies chroma temporal strength, defaults to yading@10: I<luma_tmp>*I<chroma_spatial>/I<luma_spatial> yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 hue yading@10: yading@10: yading@10: Modify the hue and/or the saturation of the input. yading@10: yading@10: This filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<h> yading@10: yading@10: Specify the hue angle as a number of degrees. It accepts an expression, yading@10: and defaults to "0". yading@10: yading@10: yading@10: =item B<s> yading@10: yading@10: Specify the saturation in the [-10,10] range. It accepts a float number and yading@10: defaults to "1". yading@10: yading@10: yading@10: =item B<H> yading@10: yading@10: Specify the hue angle as a number of radians. It accepts a float yading@10: number or an expression, and defaults to "0". yading@10: yading@10: =back yading@10: yading@10: yading@10: B<h> and B<H> are mutually exclusive, and can't be yading@10: specified at the same time. yading@10: yading@10: The B<h>, B<H> and B<s> option values are yading@10: expressions containing the following constants: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<n> yading@10: yading@10: frame count of the input frame starting from 0 yading@10: yading@10: yading@10: =item B<pts> yading@10: yading@10: presentation timestamp of the input frame expressed in time base units yading@10: yading@10: yading@10: =item B<r> yading@10: yading@10: frame rate of the input video, NAN if the input frame rate is unknown yading@10: yading@10: yading@10: =item B<t> yading@10: yading@10: timestamp expressed in seconds, NAN if the input timestamp is unknown yading@10: yading@10: yading@10: =item B<tb> yading@10: yading@10: time base of the input video yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Set the hue to 90 degrees and the saturation to 1.0: yading@10: yading@10: hue=h=90:s=1 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Same command but expressing the hue in radians: yading@10: yading@10: hue=H=PI/2:s=1 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Rotate hue and make the saturation swing between 0 yading@10: and 2 over a period of 1 second: yading@10: yading@10: hue="H=2*PI*t: s=sin(2*PI*t)+1" yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Apply a 3 seconds saturation fade-in effect starting at 0: yading@10: yading@10: hue="s=min(t/3\,1)" yading@10: yading@10: yading@10: The general fade-in expression can be written as: yading@10: yading@10: hue="s=min(0\, max((t-START)/DURATION\, 1))" yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Apply a 3 seconds saturation fade-out effect starting at 5 seconds: yading@10: yading@10: hue="s=max(0\, min(1\, (8-t)/3))" yading@10: yading@10: yading@10: The general fade-out expression can be written as: yading@10: yading@10: hue="s=max(0\, min(1\, (START+DURATION-t)/DURATION))" yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Commands yading@10: yading@10: yading@10: This filter supports the following commands: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<s> yading@10: yading@10: yading@10: =item B<h> yading@10: yading@10: yading@10: =item B<H> yading@10: yading@10: Modify the hue and/or the saturation of the input video. yading@10: The command accepts the same syntax of the corresponding option. yading@10: yading@10: If the specified expression is not valid, it is kept at its current yading@10: value. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 idet yading@10: yading@10: yading@10: Detect video interlacing type. yading@10: yading@10: This filter tries to detect if the input is interlaced or progressive, yading@10: top or bottom field first. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<intl_thres> yading@10: yading@10: Set interlacing threshold. yading@10: yading@10: =item B<prog_thres> yading@10: yading@10: Set progressive threshold. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 il yading@10: yading@10: yading@10: Deinterleave or interleave fields. yading@10: yading@10: This filter allows to process interlaced images fields without yading@10: deinterlacing them. Deinterleaving splits the input frame into 2 yading@10: fields (so called half pictures). Odd lines are moved to the top yading@10: half of the output image, even lines to the bottom half. yading@10: You can process (filter) them independently and then re-interleave them. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<luma_mode, l> yading@10: yading@10: yading@10: =item B<chroma_mode, s> yading@10: yading@10: yading@10: =item B<alpha_mode, a> yading@10: yading@10: Available values for I<luma_mode>, I<chroma_mode> and yading@10: I<alpha_mode> are: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<none> yading@10: yading@10: Do nothing. yading@10: yading@10: yading@10: =item B<deinterleave, d> yading@10: yading@10: Deinterleave fields, placing one above the other. yading@10: yading@10: yading@10: =item B<interleave, i> yading@10: yading@10: Interleave fields. Reverse the effect of deinterleaving. yading@10: yading@10: =back yading@10: yading@10: Default value is C<none>. yading@10: yading@10: yading@10: =item B<luma_swap, ls> yading@10: yading@10: yading@10: =item B<chroma_swap, cs> yading@10: yading@10: yading@10: =item B<alpha_swap, as> yading@10: yading@10: Swap luma/chroma/alpha fields. Exchange even & odd lines. Default value is C<0>. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 interlace yading@10: yading@10: yading@10: Simple interlacing filter from progressive contents. This interleaves upper (or yading@10: lower) lines from odd frames with lower (or upper) lines from even frames, yading@10: halving the frame rate and preserving image height. yading@10: yading@10: yading@10: Original Original New Frame yading@10: Frame 'j' Frame 'j+1' (tff) yading@10: ========== =========== ================== yading@10: Line 0 --------------------> Frame 'j' Line 0 yading@10: Line 1 Line 1 ----> Frame 'j+1' Line 1 yading@10: Line 2 ---------------------> Frame 'j' Line 2 yading@10: Line 3 Line 3 ----> Frame 'j+1' Line 3 yading@10: ... ... ... yading@10: New Frame + 1 will be generated by Frame 'j+2' and Frame 'j+3' and so on yading@10: yading@10: yading@10: It accepts the following optional parameters: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<scan> yading@10: yading@10: determines whether the interlaced frame is taken from the even (tff - default) yading@10: or odd (bff) lines of the progressive frame. yading@10: yading@10: yading@10: =item B<lowpass> yading@10: yading@10: Enable (default) or disable the vertical lowpass filter to avoid twitter yading@10: interlacing and reduce moire patterns. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 kerndeint yading@10: yading@10: yading@10: Deinterlace input video by applying Donald Graft's adaptive kernel yading@10: deinterling. Work on interlaced parts of a video to produce yading@10: progressive frames. yading@10: yading@10: The description of the accepted parameters follows. yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<thresh> yading@10: yading@10: Set the threshold which affects the filter's tolerance when yading@10: determining if a pixel line must be processed. It must be an integer yading@10: in the range [0,255] and defaults to 10. A value of 0 will result in yading@10: applying the process on every pixels. yading@10: yading@10: yading@10: =item B<map> yading@10: yading@10: Paint pixels exceeding the threshold value to white if set to 1. yading@10: Default is 0. yading@10: yading@10: yading@10: =item B<order> yading@10: yading@10: Set the fields order. Swap fields if set to 1, leave fields alone if yading@10: 0. Default is 0. yading@10: yading@10: yading@10: =item B<sharp> yading@10: yading@10: Enable additional sharpening if set to 1. Default is 0. yading@10: yading@10: yading@10: =item B<twoway> yading@10: yading@10: Enable twoway sharpening if set to 1. Default is 0. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Apply default values: yading@10: yading@10: kerndeint=thresh=10:map=0:order=0:sharp=0:twoway=0 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Enable additional sharpening: yading@10: yading@10: kerndeint=sharp=1 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Paint processed pixels in white: yading@10: yading@10: kerndeint=map=1 yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 lut, lutrgb, lutyuv yading@10: yading@10: yading@10: Compute a look-up table for binding each pixel component input value yading@10: to an output value, and apply it to input video. yading@10: yading@10: I<lutyuv> applies a lookup table to a YUV input video, I<lutrgb> yading@10: to an RGB input video. yading@10: yading@10: These filters accept the following options: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<c0> yading@10: yading@10: set first pixel component expression yading@10: yading@10: =item B<c1> yading@10: yading@10: set second pixel component expression yading@10: yading@10: =item B<c2> yading@10: yading@10: set third pixel component expression yading@10: yading@10: =item B<c3> yading@10: yading@10: set fourth pixel component expression, corresponds to the alpha component yading@10: yading@10: yading@10: =item B<r> yading@10: yading@10: set red component expression yading@10: yading@10: =item B<g> yading@10: yading@10: set green component expression yading@10: yading@10: =item B<b> yading@10: yading@10: set blue component expression yading@10: yading@10: =item B<a> yading@10: yading@10: alpha component expression yading@10: yading@10: yading@10: =item B<y> yading@10: yading@10: set Y/luminance component expression yading@10: yading@10: =item B<u> yading@10: yading@10: set U/Cb component expression yading@10: yading@10: =item B<v> yading@10: yading@10: set V/Cr component expression yading@10: yading@10: =back yading@10: yading@10: yading@10: Each of them specifies the expression to use for computing the lookup table for yading@10: the corresponding pixel component values. yading@10: yading@10: The exact component associated to each of the I<c*> options depends on the yading@10: format in input. yading@10: yading@10: The I<lut> filter requires either YUV or RGB pixel formats in input, yading@10: I<lutrgb> requires RGB pixel formats in input, and I<lutyuv> requires YUV. yading@10: yading@10: The expressions can contain the following constants and functions: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<w, h> yading@10: yading@10: the input width and height yading@10: yading@10: yading@10: =item B<val> yading@10: yading@10: input value for the pixel component yading@10: yading@10: yading@10: =item B<clipval> yading@10: yading@10: the input value clipped in the I<minval>-I<maxval> range yading@10: yading@10: yading@10: =item B<maxval> yading@10: yading@10: maximum value for the pixel component yading@10: yading@10: yading@10: =item B<minval> yading@10: yading@10: minimum value for the pixel component yading@10: yading@10: yading@10: =item B<negval> yading@10: yading@10: the negated value for the pixel component value clipped in the yading@10: I<minval>-I<maxval> range , it corresponds to the expression yading@10: "maxval-clipval+minval" yading@10: yading@10: yading@10: =item B<clip(val)> yading@10: yading@10: the computed value in I<val> clipped in the yading@10: I<minval>-I<maxval> range yading@10: yading@10: yading@10: =item B<gammaval(gamma)> yading@10: yading@10: the computed gamma correction value of the pixel component value yading@10: clipped in the I<minval>-I<maxval> range, corresponds to the yading@10: expression yading@10: "pow((clipval-minval)/(maxval-minval)\,I<gamma>)*(maxval-minval)+minval" yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: All expressions default to "val". yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Negate input video: yading@10: yading@10: lutrgb="r=maxval+minval-val:g=maxval+minval-val:b=maxval+minval-val" yading@10: lutyuv="y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val" yading@10: yading@10: yading@10: The above is the same as: yading@10: yading@10: lutrgb="r=negval:g=negval:b=negval" yading@10: lutyuv="y=negval:u=negval:v=negval" yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Negate luminance: yading@10: yading@10: lutyuv=y=negval yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Remove chroma components, turns the video into a graytone image: yading@10: yading@10: lutyuv="u=128:v=128" yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Apply a luma burning effect: yading@10: yading@10: lutyuv="y=2*val" yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Remove green and blue components: yading@10: yading@10: lutrgb="g=0:b=0" yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Set a constant alpha channel value on input: yading@10: yading@10: format=rgba,lutrgb=a="maxval-minval/2" yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Correct luminance gamma by a 0.5 factor: yading@10: yading@10: lutyuv=y=gammaval(0.5) yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Discard least significant bits of luma: yading@10: yading@10: lutyuv=y='bitand(val, 128+64+32)' yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 mp yading@10: yading@10: yading@10: Apply an MPlayer filter to the input video. yading@10: yading@10: This filter provides a wrapper around most of the filters of yading@10: MPlayer/MEncoder. yading@10: yading@10: This wrapper is considered experimental. Some of the wrapped filters yading@10: may not work properly and we may drop support for them, as they will yading@10: be implemented natively into FFmpeg. Thus you should avoid yading@10: depending on them when writing portable scripts. yading@10: yading@10: The filters accepts the parameters: yading@10: I<filter_name>[:=]I<filter_params> yading@10: yading@10: I<filter_name> is the name of a supported MPlayer filter, yading@10: I<filter_params> is a string containing the parameters accepted by yading@10: the named filter. yading@10: yading@10: The list of the currently supported filters follows: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item I<dint> yading@10: yading@10: yading@10: =item I<down3dright> yading@10: yading@10: yading@10: =item I<eq2> yading@10: yading@10: yading@10: =item I<eq> yading@10: yading@10: yading@10: =item I<fil> yading@10: yading@10: yading@10: =item I<fspp> yading@10: yading@10: yading@10: =item I<ilpack> yading@10: yading@10: yading@10: =item I<mcdeint> yading@10: yading@10: yading@10: =item I<ow> yading@10: yading@10: yading@10: =item I<perspective> yading@10: yading@10: yading@10: =item I<phase> yading@10: yading@10: yading@10: =item I<pp7> yading@10: yading@10: yading@10: =item I<pullup> yading@10: yading@10: yading@10: =item I<qp> yading@10: yading@10: yading@10: =item I<sab> yading@10: yading@10: yading@10: =item I<softpulldown> yading@10: yading@10: yading@10: =item I<spp> yading@10: yading@10: yading@10: =item I<tinterlace> yading@10: yading@10: yading@10: =item I<uspp> yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: The parameter syntax and behavior for the listed filters are the same yading@10: of the corresponding MPlayer filters. For detailed instructions check yading@10: the "VIDEO FILTERS" section in the MPlayer manual. yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Adjust gamma, brightness, contrast: yading@10: yading@10: mp=eq2=1.0:2:0.5 yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: See also mplayer(1), E<lt>B<http://www.mplayerhq.hu/>E<gt>. yading@10: yading@10: yading@10: =head2 mpdecimate yading@10: yading@10: yading@10: Drop frames that do not differ greatly from the previous frame in yading@10: order to reduce frame rate. yading@10: yading@10: The main use of this filter is for very-low-bitrate encoding yading@10: (e.g. streaming over dialup modem), but it could in theory be used for yading@10: fixing movies that were inverse-telecined incorrectly. yading@10: yading@10: A description of the accepted options follows. yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<max> yading@10: yading@10: Set the maximum number of consecutive frames which can be dropped (if yading@10: positive), or the minimum interval between dropped frames (if yading@10: negative). If the value is 0, the frame is dropped unregarding the yading@10: number of previous sequentially dropped frames. yading@10: yading@10: Default value is 0. yading@10: yading@10: yading@10: =item B<hi> yading@10: yading@10: yading@10: =item B<lo> yading@10: yading@10: yading@10: =item B<frac> yading@10: yading@10: Set the dropping threshold values. yading@10: yading@10: Values for B<hi> and B<lo> are for 8x8 pixel blocks and yading@10: represent actual pixel value differences, so a threshold of 64 yading@10: corresponds to 1 unit of difference for each pixel, or the same spread yading@10: out differently over the block. yading@10: yading@10: A frame is a candidate for dropping if no 8x8 blocks differ by more yading@10: than a threshold of B<hi>, and if no more than B<frac> blocks (1 yading@10: meaning the whole image) differ by more than a threshold of B<lo>. yading@10: yading@10: Default value for B<hi> is 64*12, default value for B<lo> is yading@10: 64*5, and default value for B<frac> is 0.33. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: yading@10: =head2 negate yading@10: yading@10: yading@10: Negate input video. yading@10: yading@10: This filter accepts an integer in input, if non-zero it negates the yading@10: alpha component (if available). The default value in input is 0. yading@10: yading@10: yading@10: =head2 noformat yading@10: yading@10: yading@10: Force libavfilter not to use any of the specified pixel formats for the yading@10: input to the next filter. yading@10: yading@10: This filter accepts the following parameters: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<pix_fmts> yading@10: yading@10: A '|'-separated list of pixel format names, for example yading@10: "pix_fmts=yuv420p|monow|rgb24". yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Force libavfilter to use a format different from I<yuv420p> for the yading@10: input to the vflip filter: yading@10: yading@10: noformat=pix_fmts=yuv420p,vflip yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Convert the input video to any of the formats not contained in the list: yading@10: yading@10: noformat=yuv420p|yuv444p|yuv410p yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 noise yading@10: yading@10: yading@10: Add noise on video input frame. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<all_seed> yading@10: yading@10: yading@10: =item B<c0_seed> yading@10: yading@10: yading@10: =item B<c1_seed> yading@10: yading@10: yading@10: =item B<c2_seed> yading@10: yading@10: yading@10: =item B<c3_seed> yading@10: yading@10: Set noise seed for specific pixel component or all pixel components in case yading@10: of I<all_seed>. Default value is C<123457>. yading@10: yading@10: yading@10: =item B<all_strength, alls> yading@10: yading@10: yading@10: =item B<c0_strength, c0s> yading@10: yading@10: yading@10: =item B<c1_strength, c1s> yading@10: yading@10: yading@10: =item B<c2_strength, c2s> yading@10: yading@10: yading@10: =item B<c3_strength, c3s> yading@10: yading@10: Set noise strength for specific pixel component or all pixel components in case yading@10: I<all_strength>. Default value is C<0>. Allowed range is [0, 100]. yading@10: yading@10: yading@10: =item B<all_flags, allf> yading@10: yading@10: yading@10: =item B<c0_flags, c0f> yading@10: yading@10: yading@10: =item B<c1_flags, c1f> yading@10: yading@10: yading@10: =item B<c2_flags, c2f> yading@10: yading@10: yading@10: =item B<c3_flags, c3f> yading@10: yading@10: Set pixel component flags or set flags for all components if I<all_flags>. yading@10: Available values for component flags are: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<a> yading@10: yading@10: averaged temporal noise (smoother) yading@10: yading@10: =item B<p> yading@10: yading@10: mix random noise with a (semi)regular pattern yading@10: yading@10: =item B<q> yading@10: yading@10: higher quality (slightly better looking, slightly slower) yading@10: yading@10: =item B<t> yading@10: yading@10: temporal noise (noise pattern changes between frames) yading@10: yading@10: =item B<u> yading@10: yading@10: uniform noise (gaussian otherwise) yading@10: yading@10: =back yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: Add temporal and uniform noise to input video: yading@10: yading@10: noise=alls=20:allf=t+u yading@10: yading@10: yading@10: yading@10: =head2 null yading@10: yading@10: yading@10: Pass the video source unchanged to the output. yading@10: yading@10: yading@10: =head2 ocv yading@10: yading@10: yading@10: Apply video transform using libopencv. yading@10: yading@10: To enable this filter install libopencv library and headers and yading@10: configure FFmpeg with C<--enable-libopencv>. yading@10: yading@10: This filter accepts the following parameters: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<filter_name> yading@10: yading@10: The name of the libopencv filter to apply. yading@10: yading@10: yading@10: =item B<filter_params> yading@10: yading@10: The parameters to pass to the libopencv filter. If not specified the default yading@10: values are assumed. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: Refer to the official libopencv documentation for more precise yading@10: information: yading@10: E<lt>B<http://opencv.willowgarage.com/documentation/c/image_filtering.html>E<gt> yading@10: yading@10: Follows the list of supported libopencv filters. yading@10: yading@10: yading@10: yading@10: =head3 dilate yading@10: yading@10: yading@10: Dilate an image by using a specific structuring element. yading@10: This filter corresponds to the libopencv function C<cvDilate>. yading@10: yading@10: It accepts the parameters: I<struct_el>|I<nb_iterations>. yading@10: yading@10: I<struct_el> represents a structuring element, and has the syntax: yading@10: I<cols>xI<rows>+I<anchor_x>xI<anchor_y>/I<shape> yading@10: yading@10: I<cols> and I<rows> represent the number of columns and rows of yading@10: the structuring element, I<anchor_x> and I<anchor_y> the anchor yading@10: point, and I<shape> the shape for the structuring element, and yading@10: can be one of the values "rect", "cross", "ellipse", "custom". yading@10: yading@10: If the value for I<shape> is "custom", it must be followed by a yading@10: string of the form "=I<filename>". The file with name yading@10: I<filename> is assumed to represent a binary image, with each yading@10: printable character corresponding to a bright pixel. When a custom yading@10: I<shape> is used, I<cols> and I<rows> are ignored, the number yading@10: or columns and rows of the read file are assumed instead. yading@10: yading@10: The default value for I<struct_el> is "3x3+0x0/rect". yading@10: yading@10: I<nb_iterations> specifies the number of times the transform is yading@10: applied to the image, and defaults to 1. yading@10: yading@10: Follow some example: yading@10: yading@10: # use the default values yading@10: ocv=dilate yading@10: yading@10: # dilate using a structuring element with a 5x5 cross, iterate two times yading@10: ocv=filter_name=dilate:filter_params=5x5+2x2/cross|2 yading@10: yading@10: # read the shape from the file diamond.shape, iterate two times yading@10: # the file diamond.shape may contain a pattern of characters like this: yading@10: # * yading@10: # *** yading@10: # ***** yading@10: # *** yading@10: # * yading@10: # the specified cols and rows are ignored (but not the anchor point coordinates) yading@10: ocv=dilate:0x0+2x2/custom=diamond.shape|2 yading@10: yading@10: yading@10: yading@10: =head3 erode yading@10: yading@10: yading@10: Erode an image by using a specific structuring element. yading@10: This filter corresponds to the libopencv function C<cvErode>. yading@10: yading@10: The filter accepts the parameters: I<struct_el>:I<nb_iterations>, yading@10: with the same syntax and semantics as the dilate filter. yading@10: yading@10: yading@10: =head3 smooth yading@10: yading@10: yading@10: Smooth the input video. yading@10: yading@10: The filter takes the following parameters: yading@10: I<type>|I<param1>|I<param2>|I<param3>|I<param4>. yading@10: yading@10: I<type> is the type of smooth filter to apply, and can be one of yading@10: the following values: "blur", "blur_no_scale", "median", "gaussian", yading@10: "bilateral". The default value is "gaussian". yading@10: yading@10: I<param1>, I<param2>, I<param3>, and I<param4> are yading@10: parameters whose meanings depend on smooth type. I<param1> and yading@10: I<param2> accept integer positive values or 0, I<param3> and yading@10: I<param4> accept float values. yading@10: yading@10: The default value for I<param1> is 3, the default value for the yading@10: other parameters is 0. yading@10: yading@10: These parameters correspond to the parameters assigned to the yading@10: libopencv function C<cvSmooth>. yading@10: yading@10: yading@10: yading@10: =head2 overlay yading@10: yading@10: yading@10: Overlay one video on top of another. yading@10: yading@10: It takes two inputs and one output, the first input is the "main" yading@10: video on which the second input is overlayed. yading@10: yading@10: This filter accepts the following parameters: yading@10: yading@10: A description of the accepted options follows. yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<x> yading@10: yading@10: yading@10: =item B<y> yading@10: yading@10: Set the expression for the x and y coordinates of the overlayed video yading@10: on the main video. Default value is "0" for both expressions. In case yading@10: the expression is invalid, it is set to a huge value (meaning that the yading@10: overlay will not be displayed within the output visible area). yading@10: yading@10: yading@10: =item B<enable> yading@10: yading@10: Set the expression which enables the overlay. If the evaluation is yading@10: different from 0, the overlay is displayed on top of the input yading@10: frame. By default it is "1". yading@10: yading@10: yading@10: =item B<eval> yading@10: yading@10: Set when the expressions for B<x>, B<y>, and yading@10: B<enable> are evaluated. yading@10: yading@10: It accepts the following values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<init> yading@10: yading@10: only evaluate expressions once during the filter initialization or yading@10: when a command is processed yading@10: yading@10: yading@10: =item B<frame> yading@10: yading@10: evaluate expressions for each incoming frame yading@10: yading@10: =back yading@10: yading@10: yading@10: Default value is B<frame>. yading@10: yading@10: yading@10: =item B<shortest> yading@10: yading@10: If set to 1, force the output to terminate when the shortest input yading@10: terminates. Default value is 0. yading@10: yading@10: yading@10: =item B<format> yading@10: yading@10: Set the format for the output video. yading@10: yading@10: It accepts the following values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<yuv420> yading@10: yading@10: force YUV420 output yading@10: yading@10: yading@10: =item B<yuv444> yading@10: yading@10: force YUV444 output yading@10: yading@10: yading@10: =item B<rgb> yading@10: yading@10: force RGB output yading@10: yading@10: =back yading@10: yading@10: yading@10: Default value is B<yuv420>. yading@10: yading@10: yading@10: =item B<rgb> I<(deprecated)> yading@10: yading@10: If set to 1, force the filter to accept inputs in the RGB yading@10: color space. Default value is 0. This option is deprecated, use yading@10: B<format> instead. yading@10: yading@10: yading@10: =item B<repeatlast> yading@10: yading@10: If set to 1, force the filter to draw the last overlay frame over the yading@10: main input until the end of the stream. A value of 0 disables this yading@10: behavior, which is enabled by default. yading@10: yading@10: =back yading@10: yading@10: yading@10: The B<x>, B<y>, and B<enable> expressions can yading@10: contain the following parameters. yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<main_w, W> yading@10: yading@10: yading@10: =item B<main_h, H> yading@10: yading@10: main input width and height yading@10: yading@10: yading@10: =item B<overlay_w, w> yading@10: yading@10: yading@10: =item B<overlay_h, h> yading@10: yading@10: overlay input width and height yading@10: yading@10: yading@10: =item B<x> yading@10: yading@10: yading@10: =item B<y> yading@10: yading@10: the computed values for I<x> and I<y>. They are evaluated for yading@10: each new frame. yading@10: yading@10: yading@10: =item B<hsub> yading@10: yading@10: yading@10: =item B<vsub> yading@10: yading@10: horizontal and vertical chroma subsample values of the output yading@10: format. For example for the pixel format "yuv422p" I<hsub> is 2 and yading@10: I<vsub> is 1. yading@10: yading@10: yading@10: =item B<n> yading@10: yading@10: the number of input frame, starting from 0 yading@10: yading@10: yading@10: =item B<pos> yading@10: yading@10: the position in the file of the input frame, NAN if unknown yading@10: yading@10: yading@10: =item B<t> yading@10: yading@10: timestamp expressed in seconds, NAN if the input timestamp is unknown yading@10: yading@10: =back yading@10: yading@10: yading@10: Note that the I<n>, I<pos>, I<t> variables are available only yading@10: when evaluation is done I<per frame>, and will evaluate to NAN yading@10: when B<eval> is set to B<init>. yading@10: yading@10: Be aware that frames are taken from each input video in timestamp yading@10: order, hence, if their initial timestamps differ, it is a a good idea yading@10: to pass the two inputs through a I<setpts=PTS-STARTPTS> filter to yading@10: have them begin in the same zero timestamp, as it does the example for yading@10: the I<movie> filter. yading@10: yading@10: You can chain together more overlays but you should test the yading@10: efficiency of such approach. yading@10: yading@10: yading@10: =head3 Commands yading@10: yading@10: yading@10: This filter supports the following commands: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<x> yading@10: yading@10: yading@10: =item B<y> yading@10: yading@10: yading@10: =item B<enable> yading@10: yading@10: Modify the x/y and enable overlay of the overlay input. yading@10: The command accepts the same syntax of the corresponding option. yading@10: yading@10: If the specified expression is not valid, it is kept at its current yading@10: value. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Draw the overlay at 10 pixels from the bottom right corner of the main yading@10: video: yading@10: yading@10: overlay=main_w-overlay_w-10:main_h-overlay_h-10 yading@10: yading@10: yading@10: Using named options the example above becomes: yading@10: yading@10: overlay=x=main_w-overlay_w-10:y=main_h-overlay_h-10 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Insert a transparent PNG logo in the bottom left corner of the input, yading@10: using the B<ffmpeg> tool with the C<-filter_complex> option: yading@10: yading@10: ffmpeg -i input -i logo -filter_complex 'overlay=10:main_h-overlay_h-10' output yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Insert 2 different transparent PNG logos (second logo on bottom yading@10: right corner) using the B<ffmpeg> tool: yading@10: yading@10: ffmpeg -i input -i logo1 -i logo2 -filter_complex 'overlay=x=10:y=H-h-10,overlay=x=W-w-10:y=H-h-10' output yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Add a transparent color layer on top of the main video, C<WxH> yading@10: must specify the size of the main input to the overlay filter: yading@10: yading@10: color=color=red@.3:size=WxH [over]; [in][over] overlay [out] yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Play an original video and a filtered version (here with the deshake yading@10: filter) side by side using the B<ffplay> tool: yading@10: yading@10: ffplay input.avi -vf 'split[a][b]; [a]pad=iw*2:ih[src]; [b]deshake[filt]; [src][filt]overlay=w' yading@10: yading@10: yading@10: The above command is the same as: yading@10: yading@10: ffplay input.avi -vf 'split[b], pad=iw*2[src], [b]deshake, [src]overlay=w' yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Make a sliding overlay appearing from the left to the right top part of the yading@10: screen starting since time 2: yading@10: yading@10: overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Compose output by putting two input videos side to side: yading@10: yading@10: ffmpeg -i left.avi -i right.avi -filter_complex " yading@10: nullsrc=size=200x100 [background]; yading@10: [0:v] setpts=PTS-STARTPTS, scale=100x100 [left]; yading@10: [1:v] setpts=PTS-STARTPTS, scale=100x100 [right]; yading@10: [background][left] overlay=shortest=1 [background+left]; yading@10: [background+left][right] overlay=shortest=1:x=100 [left+right] yading@10: " yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Chain several overlays in cascade: yading@10: yading@10: nullsrc=s=200x200 [bg]; yading@10: testsrc=s=100x100, split=4 [in0][in1][in2][in3]; yading@10: [in0] lutrgb=r=0, [bg] overlay=0:0 [mid0]; yading@10: [in1] lutrgb=g=0, [mid0] overlay=100:0 [mid1]; yading@10: [in2] lutrgb=b=0, [mid1] overlay=0:100 [mid2]; yading@10: [in3] null, [mid2] overlay=100:100 [out0] yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 pad yading@10: yading@10: yading@10: Add paddings to the input image, and place the original input at the yading@10: given coordinates I<x>, I<y>. yading@10: yading@10: This filter accepts the following parameters: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<width, w> yading@10: yading@10: yading@10: =item B<height, h> yading@10: yading@10: Specify an expression for the size of the output image with the yading@10: paddings added. If the value for I<width> or I<height> is 0, the yading@10: corresponding input size is used for the output. yading@10: yading@10: The I<width> expression can reference the value set by the yading@10: I<height> expression, and vice versa. yading@10: yading@10: The default value of I<width> and I<height> is 0. yading@10: yading@10: yading@10: =item B<x> yading@10: yading@10: yading@10: =item B<y> yading@10: yading@10: Specify an expression for the offsets where to place the input image yading@10: in the padded area with respect to the top/left border of the output yading@10: image. yading@10: yading@10: The I<x> expression can reference the value set by the I<y> yading@10: expression, and vice versa. yading@10: yading@10: The default value of I<x> and I<y> is 0. yading@10: yading@10: yading@10: =item B<color> yading@10: yading@10: Specify the color of the padded area, it can be the name of a color yading@10: (case insensitive match) or a 0xRRGGBB[AA] sequence. yading@10: yading@10: The default value of I<color> is "black". yading@10: yading@10: =back yading@10: yading@10: yading@10: The value for the I<width>, I<height>, I<x>, and I<y> yading@10: options are expressions containing the following constants: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<in_w, in_h> yading@10: yading@10: the input video width and height yading@10: yading@10: yading@10: =item B<iw, ih> yading@10: yading@10: same as I<in_w> and I<in_h> yading@10: yading@10: yading@10: =item B<out_w, out_h> yading@10: yading@10: the output width and height, that is the size of the padded area as yading@10: specified by the I<width> and I<height> expressions yading@10: yading@10: yading@10: =item B<ow, oh> yading@10: yading@10: same as I<out_w> and I<out_h> yading@10: yading@10: yading@10: =item B<x, y> yading@10: yading@10: x and y offsets as specified by the I<x> and I<y> yading@10: expressions, or NAN if not yet specified yading@10: yading@10: yading@10: =item B<a> yading@10: yading@10: same as I<iw> / I<ih> yading@10: yading@10: yading@10: =item B<sar> yading@10: yading@10: input sample aspect ratio yading@10: yading@10: yading@10: =item B<dar> yading@10: yading@10: input display aspect ratio, it is the same as (I<iw> / I<ih>) * I<sar> yading@10: yading@10: yading@10: =item B<hsub, vsub> yading@10: yading@10: horizontal and vertical chroma subsample values. For example for the yading@10: pixel format "yuv422p" I<hsub> is 2 and I<vsub> is 1. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Add paddings with color "violet" to the input video. Output video yading@10: size is 640x480, the top-left corner of the input video is placed at yading@10: column 0, row 40: yading@10: yading@10: pad=640:480:0:40:violet yading@10: yading@10: yading@10: The example above is equivalent to the following command: yading@10: yading@10: pad=width=640:height=480:x=0:y=40:color=violet yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Pad the input to get an output with dimensions increased by 3/2, yading@10: and put the input video at the center of the padded area: yading@10: yading@10: pad="3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2" yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Pad the input to get a squared output with size equal to the maximum yading@10: value between the input width and height, and put the input video at yading@10: the center of the padded area: yading@10: yading@10: pad="max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2" yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Pad the input to get a final w/h ratio of 16:9: yading@10: yading@10: pad="ih*16/9:ih:(ow-iw)/2:(oh-ih)/2" yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: In case of anamorphic video, in order to set the output display aspect yading@10: correctly, it is necessary to use I<sar> in the expression, yading@10: according to the relation: yading@10: yading@10: (ih * X / ih) * sar = output_dar yading@10: X = output_dar / sar yading@10: yading@10: yading@10: Thus the previous example needs to be modified to: yading@10: yading@10: pad="ih*16/9/sar:ih:(ow-iw)/2:(oh-ih)/2" yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Double output size and put the input video in the bottom-right yading@10: corner of the output padded area: yading@10: yading@10: pad="2*iw:2*ih:ow-iw:oh-ih" yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 pixdesctest yading@10: yading@10: yading@10: Pixel format descriptor test filter, mainly useful for internal yading@10: testing. The output video should be equal to the input video. yading@10: yading@10: For example: yading@10: yading@10: format=monow, pixdesctest yading@10: yading@10: yading@10: can be used to test the monowhite pixel format descriptor definition. yading@10: yading@10: yading@10: =head2 pp yading@10: yading@10: yading@10: Enable the specified chain of postprocessing subfilters using libpostproc. This yading@10: library should be automatically selected with a GPL build (C<--enable-gpl>). yading@10: Subfilters must be separated by '/' and can be disabled by prepending a '-'. yading@10: Each subfilter and some options have a short and a long name that can be used yading@10: interchangeably, i.e. dr/dering are the same. yading@10: yading@10: The filters accept the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<subfilters> yading@10: yading@10: Set postprocessing subfilters string. yading@10: yading@10: =back yading@10: yading@10: yading@10: All subfilters share common options to determine their scope: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<a/autoq> yading@10: yading@10: Honor the quality commands for this subfilter. yading@10: yading@10: yading@10: =item B<c/chrom> yading@10: yading@10: Do chrominance filtering, too (default). yading@10: yading@10: yading@10: =item B<y/nochrom> yading@10: yading@10: Do luminance filtering only (no chrominance). yading@10: yading@10: yading@10: =item B<n/noluma> yading@10: yading@10: Do chrominance filtering only (no luminance). yading@10: yading@10: =back yading@10: yading@10: yading@10: These options can be appended after the subfilter name, separated by a '|'. yading@10: yading@10: Available subfilters are: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<hb/hdeblock[|difference[|flatness]]> yading@10: yading@10: Horizontal deblocking filter yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<difference> yading@10: yading@10: Difference factor where higher values mean more deblocking (default: C<32>). yading@10: yading@10: =item B<flatness> yading@10: yading@10: Flatness threshold where lower values mean more deblocking (default: C<39>). yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<vb/vdeblock[|difference[|flatness]]> yading@10: yading@10: Vertical deblocking filter yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<difference> yading@10: yading@10: Difference factor where higher values mean more deblocking (default: C<32>). yading@10: yading@10: =item B<flatness> yading@10: yading@10: Flatness threshold where lower values mean more deblocking (default: C<39>). yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<ha/hadeblock[|difference[|flatness]]> yading@10: yading@10: Accurate horizontal deblocking filter yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<difference> yading@10: yading@10: Difference factor where higher values mean more deblocking (default: C<32>). yading@10: yading@10: =item B<flatness> yading@10: yading@10: Flatness threshold where lower values mean more deblocking (default: C<39>). yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<va/vadeblock[|difference[|flatness]]> yading@10: yading@10: Accurate vertical deblocking filter yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<difference> yading@10: yading@10: Difference factor where higher values mean more deblocking (default: C<32>). yading@10: yading@10: =item B<flatness> yading@10: yading@10: Flatness threshold where lower values mean more deblocking (default: C<39>). yading@10: yading@10: =back yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: The horizontal and vertical deblocking filters share the difference and yading@10: flatness values so you cannot set different horizontal and vertical yading@10: thresholds. yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<h1/x1hdeblock> yading@10: yading@10: Experimental horizontal deblocking filter yading@10: yading@10: yading@10: =item B<v1/x1vdeblock> yading@10: yading@10: Experimental vertical deblocking filter yading@10: yading@10: yading@10: =item B<dr/dering> yading@10: yading@10: Deringing filter yading@10: yading@10: yading@10: =item B<tn/tmpnoise[|threshold1[|threshold2[|threshold3]]], temporal noise reducer> yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<threshold1> yading@10: yading@10: larger -E<gt> stronger filtering yading@10: yading@10: =item B<threshold2> yading@10: yading@10: larger -E<gt> stronger filtering yading@10: yading@10: =item B<threshold3> yading@10: yading@10: larger -E<gt> stronger filtering yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<al/autolevels[:f/fullyrange], automatic brightness / contrast correction> yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<f/fullyrange> yading@10: yading@10: Stretch luminance to C<0-255>. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<lb/linblenddeint> yading@10: yading@10: Linear blend deinterlacing filter that deinterlaces the given block by yading@10: filtering all lines with a C<(1 2 1)> filter. yading@10: yading@10: yading@10: =item B<li/linipoldeint> yading@10: yading@10: Linear interpolating deinterlacing filter that deinterlaces the given block by yading@10: linearly interpolating every second line. yading@10: yading@10: yading@10: =item B<ci/cubicipoldeint> yading@10: yading@10: Cubic interpolating deinterlacing filter deinterlaces the given block by yading@10: cubically interpolating every second line. yading@10: yading@10: yading@10: =item B<md/mediandeint> yading@10: yading@10: Median deinterlacing filter that deinterlaces the given block by applying a yading@10: median filter to every second line. yading@10: yading@10: yading@10: =item B<fd/ffmpegdeint> yading@10: yading@10: FFmpeg deinterlacing filter that deinterlaces the given block by filtering every yading@10: second line with a C<(-1 4 2 4 -1)> filter. yading@10: yading@10: yading@10: =item B<l5/lowpass5> yading@10: yading@10: Vertically applied FIR lowpass deinterlacing filter that deinterlaces the given yading@10: block by filtering all lines with a C<(-1 2 6 2 -1)> filter. yading@10: yading@10: yading@10: =item B<fq/forceQuant[|quantizer]> yading@10: yading@10: Overrides the quantizer table from the input with the constant quantizer you yading@10: specify. yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<quantizer> yading@10: yading@10: Quantizer to use yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<de/default> yading@10: yading@10: Default pp filter combination (C<hb|a,vb|a,dr|a>) yading@10: yading@10: yading@10: =item B<fa/fast> yading@10: yading@10: Fast pp filter combination (C<h1|a,v1|a,dr|a>) yading@10: yading@10: yading@10: =item B<ac> yading@10: yading@10: High quality pp filter combination (C<ha|a|128|7,va|a,dr|a>) yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Apply horizontal and vertical deblocking, deringing and automatic yading@10: brightness/contrast: yading@10: yading@10: pp=hb/vb/dr/al yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Apply default filters without brightness/contrast correction: yading@10: yading@10: pp=de/-al yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Apply default filters and temporal denoiser: yading@10: yading@10: pp=default/tmpnoise|1|2|3 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Apply deblocking on luminance only, and switch vertical deblocking on or off yading@10: automatically depending on available CPU time: yading@10: yading@10: pp=hb|y/vb|a yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 removelogo yading@10: yading@10: yading@10: Suppress a TV station logo, using an image file to determine which yading@10: pixels comprise the logo. It works by filling in the pixels that yading@10: comprise the logo with neighboring pixels. yading@10: yading@10: The filters accept the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<filename, f> yading@10: yading@10: Set the filter bitmap file, which can be any image format supported by yading@10: libavformat. The width and height of the image file must match those of the yading@10: video stream being processed. yading@10: yading@10: =back yading@10: yading@10: yading@10: Pixels in the provided bitmap image with a value of zero are not yading@10: considered part of the logo, non-zero pixels are considered part of yading@10: the logo. If you use white (255) for the logo and black (0) for the yading@10: rest, you will be safe. For making the filter bitmap, it is yading@10: recommended to take a screen capture of a black frame with the logo yading@10: visible, and then using a threshold filter followed by the erode yading@10: filter once or twice. yading@10: yading@10: If needed, little splotches can be fixed manually. Remember that if yading@10: logo pixels are not covered, the filter quality will be much yading@10: reduced. Marking too many pixels as part of the logo does not hurt as yading@10: much, but it will increase the amount of blurring needed to cover over yading@10: the image and will destroy more information than necessary, and extra yading@10: pixels will slow things down on a large logo. yading@10: yading@10: yading@10: =head2 scale yading@10: yading@10: yading@10: Scale (resize) the input video, using the libswscale library. yading@10: yading@10: The scale filter forces the output display aspect ratio to be the same yading@10: of the input, by changing the output sample aspect ratio. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<width, w> yading@10: yading@10: Output video width. yading@10: default value is C<iw>. See below yading@10: for the list of accepted constants. yading@10: yading@10: yading@10: =item B<height, h> yading@10: yading@10: Output video height. yading@10: default value is C<ih>. yading@10: See below for the list of accepted constants. yading@10: yading@10: yading@10: =item B<interl> yading@10: yading@10: Set the interlacing. It accepts the following values: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<1> yading@10: yading@10: force interlaced aware scaling yading@10: yading@10: yading@10: =item B<0> yading@10: yading@10: do not apply interlaced scaling yading@10: yading@10: yading@10: =item B<-1> yading@10: yading@10: select interlaced aware scaling depending on whether the source frames yading@10: are flagged as interlaced or not yading@10: yading@10: =back yading@10: yading@10: yading@10: Default value is C<0>. yading@10: yading@10: yading@10: =item B<flags> yading@10: yading@10: Set libswscale scaling flags. If not explictly specified the filter yading@10: applies a bilinear scaling algorithm. yading@10: yading@10: yading@10: =item B<size, s> yading@10: yading@10: Set the video size, the value must be a valid abbreviation or in the yading@10: form I<width>xI<height>. yading@10: yading@10: =back yading@10: yading@10: yading@10: The values of the I<w> and I<h> options are expressions yading@10: containing the following constants: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<in_w, in_h> yading@10: yading@10: the input width and height yading@10: yading@10: yading@10: =item B<iw, ih> yading@10: yading@10: same as I<in_w> and I<in_h> yading@10: yading@10: yading@10: =item B<out_w, out_h> yading@10: yading@10: the output (cropped) width and height yading@10: yading@10: yading@10: =item B<ow, oh> yading@10: yading@10: same as I<out_w> and I<out_h> yading@10: yading@10: yading@10: =item B<a> yading@10: yading@10: same as I<iw> / I<ih> yading@10: yading@10: yading@10: =item B<sar> yading@10: yading@10: input sample aspect ratio yading@10: yading@10: yading@10: =item B<dar> yading@10: yading@10: input display aspect ratio, it is the same as (I<iw> / I<ih>) * I<sar> yading@10: yading@10: yading@10: =item B<hsub, vsub> yading@10: yading@10: horizontal and vertical chroma subsample values. For example for the yading@10: pixel format "yuv422p" I<hsub> is 2 and I<vsub> is 1. yading@10: yading@10: =back yading@10: yading@10: yading@10: If the input image format is different from the format requested by yading@10: the next filter, the scale filter will convert the input to the yading@10: requested format. yading@10: yading@10: If the value for I<w> or I<h> is 0, the respective input yading@10: size is used for the output. yading@10: yading@10: If the value for I<w> or I<h> is -1, the scale filter will use, for the yading@10: respective output size, a value that maintains the aspect ratio of the input yading@10: image. yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Scale the input video to a size of 200x100: yading@10: yading@10: scale=w=200:h=100 yading@10: yading@10: yading@10: This is equivalent to: yading@10: yading@10: scale=w=200:h=100 yading@10: yading@10: yading@10: or: yading@10: yading@10: scale=200x100 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Specify a size abbreviation for the output size: yading@10: yading@10: scale=qcif yading@10: yading@10: yading@10: which can also be written as: yading@10: yading@10: scale=size=qcif yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Scale the input to 2x: yading@10: yading@10: scale=w=2*iw:h=2*ih yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: The above is the same as: yading@10: yading@10: scale=2*in_w:2*in_h yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Scale the input to 2x with forced interlaced scaling: yading@10: yading@10: scale=2*iw:2*ih:interl=1 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Scale the input to half size: yading@10: yading@10: scale=w=iw/2:h=ih/2 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Increase the width, and set the height to the same size: yading@10: yading@10: scale=3/2*iw:ow yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Seek for Greek harmony: yading@10: yading@10: scale=iw:1/PHI*iw yading@10: scale=ih*PHI:ih yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Increase the height, and set the width to 3/2 of the height: yading@10: yading@10: scale=w=3/2*oh:h=3/5*ih yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Increase the size, but make the size a multiple of the chroma yading@10: subsample values: yading@10: yading@10: scale="trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub" yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Increase the width to a maximum of 500 pixels, keep the same input yading@10: aspect ratio: yading@10: yading@10: scale=w='min(500\, iw*3/2):h=-1' yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 separatefields yading@10: yading@10: yading@10: The C<separatefields> takes a frame-based video input and splits yading@10: each frame into its components fields, producing a new half height clip yading@10: with twice the frame rate and twice the frame count. yading@10: yading@10: This filter use field-dominance information in frame to decide which yading@10: of each pair of fields to place first in the output. yading@10: If it gets it wrong use setfield filter before C<separatefields> filter. yading@10: yading@10: yading@10: =head2 setdar, setsar yading@10: yading@10: yading@10: The C<setdar> filter sets the Display Aspect Ratio for the filter yading@10: output video. yading@10: yading@10: This is done by changing the specified Sample (aka Pixel) Aspect yading@10: Ratio, according to the following equation: yading@10: yading@10: <DAR> = <HORIZONTAL_RESOLUTION> / <VERTICAL_RESOLUTION> * <SAR> yading@10: yading@10: yading@10: Keep in mind that the C<setdar> filter does not modify the pixel yading@10: dimensions of the video frame. Also the display aspect ratio set by yading@10: this filter may be changed by later filters in the filterchain, yading@10: e.g. in case of scaling or if another "setdar" or a "setsar" filter is yading@10: applied. yading@10: yading@10: The C<setsar> filter sets the Sample (aka Pixel) Aspect Ratio for yading@10: the filter output video. yading@10: yading@10: Note that as a consequence of the application of this filter, the yading@10: output display aspect ratio will change according to the equation yading@10: above. yading@10: yading@10: Keep in mind that the sample aspect ratio set by the C<setsar> yading@10: filter may be changed by later filters in the filterchain, e.g. if yading@10: another "setsar" or a "setdar" filter is applied. yading@10: yading@10: The filters accept the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<r, ratio, dar (C<setdar> only), sar (C<setsar> only)> yading@10: yading@10: Set the aspect ratio used by the filter. yading@10: yading@10: The parameter can be a floating point number string, an expression, or yading@10: a string of the form I<num>:I<den>, where I<num> and yading@10: I<den> are the numerator and denominator of the aspect ratio. If yading@10: the parameter is not specified, it is assumed the value "0". yading@10: In case the form "I<num>:I<den>" is used, the C<:> character yading@10: should be escaped. yading@10: yading@10: yading@10: =item B<max> yading@10: yading@10: Set the maximum integer value to use for expressing numerator and yading@10: denominator when reducing the expressed aspect ratio to a rational. yading@10: Default value is C<100>. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: To change the display aspect ratio to 16:9, specify one of the following: yading@10: yading@10: setdar=dar=1.77777 yading@10: setdar=dar=16/9 yading@10: setdar=dar=1.77777 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: To change the sample aspect ratio to 10:11, specify: yading@10: yading@10: setsar=sar=10/11 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: To set a display aspect ratio of 16:9, and specify a maximum integer value of yading@10: 1000 in the aspect ratio reduction, use the command: yading@10: yading@10: setdar=ratio=16/9:max=1000 yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: yading@10: =head2 setfield yading@10: yading@10: yading@10: Force field for the output video frame. yading@10: yading@10: The C<setfield> filter marks the interlace type field for the yading@10: output frames. It does not change the input frame, but only sets the yading@10: corresponding property, which affects how the frame is treated by yading@10: following filters (e.g. C<fieldorder> or C<yadif>). yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<mode> yading@10: yading@10: Available values are: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<auto> yading@10: yading@10: Keep the same field property. yading@10: yading@10: yading@10: =item B<bff> yading@10: yading@10: Mark the frame as bottom-field-first. yading@10: yading@10: yading@10: =item B<tff> yading@10: yading@10: Mark the frame as top-field-first. yading@10: yading@10: yading@10: =item B<prog> yading@10: yading@10: Mark the frame as progressive. yading@10: yading@10: =back yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 showinfo yading@10: yading@10: yading@10: Show a line containing various information for each input video frame. yading@10: The input video is not modified. yading@10: yading@10: The shown line contains a sequence of key/value pairs of the form yading@10: I<key>:I<value>. yading@10: yading@10: A description of each shown parameter follows: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<n> yading@10: yading@10: sequential number of the input frame, starting from 0 yading@10: yading@10: yading@10: =item B<pts> yading@10: yading@10: Presentation TimeStamp of the input frame, expressed as a number of yading@10: time base units. The time base unit depends on the filter input pad. yading@10: yading@10: yading@10: =item B<pts_time> yading@10: yading@10: Presentation TimeStamp of the input frame, expressed as a number of yading@10: seconds yading@10: yading@10: yading@10: =item B<pos> yading@10: yading@10: position of the frame in the input stream, -1 if this information in yading@10: unavailable and/or meaningless (for example in case of synthetic video) yading@10: yading@10: yading@10: =item B<fmt> yading@10: yading@10: pixel format name yading@10: yading@10: yading@10: =item B<sar> yading@10: yading@10: sample aspect ratio of the input frame, expressed in the form yading@10: I<num>/I<den> yading@10: yading@10: yading@10: =item B<s> yading@10: yading@10: size of the input frame, expressed in the form yading@10: I<width>xI<height> yading@10: yading@10: yading@10: =item B<i> yading@10: yading@10: interlaced mode ("P" for "progressive", "T" for top field first, "B" yading@10: for bottom field first) yading@10: yading@10: yading@10: =item B<iskey> yading@10: yading@10: 1 if the frame is a key frame, 0 otherwise yading@10: yading@10: yading@10: =item B<type> yading@10: yading@10: picture type of the input frame ("I" for an I-frame, "P" for a yading@10: P-frame, "B" for a B-frame, "?" for unknown type). yading@10: Check also the documentation of the C<AVPictureType> enum and of yading@10: the C<av_get_picture_type_char> function defined in yading@10: F<libavutil/avutil.h>. yading@10: yading@10: yading@10: =item B<checksum> yading@10: yading@10: Adler-32 checksum (printed in hexadecimal) of all the planes of the input frame yading@10: yading@10: yading@10: =item B<plane_checksum> yading@10: yading@10: Adler-32 checksum (printed in hexadecimal) of each plane of the input frame, yading@10: expressed in the form "[I<c0> I<c1> I<c2> I<c3>]" yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 smartblur yading@10: yading@10: yading@10: Blur the input video without impacting the outlines. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<luma_radius, lr> yading@10: yading@10: Set the luma radius. The option value must be a float number in yading@10: the range [0.1,5.0] that specifies the variance of the gaussian filter yading@10: used to blur the image (slower if larger). Default value is 1.0. yading@10: yading@10: yading@10: =item B<luma_strength, ls> yading@10: yading@10: Set the luma strength. The option value must be a float number yading@10: in the range [-1.0,1.0] that configures the blurring. A value included yading@10: in [0.0,1.0] will blur the image whereas a value included in yading@10: [-1.0,0.0] will sharpen the image. Default value is 1.0. yading@10: yading@10: yading@10: =item B<luma_threshold, lt> yading@10: yading@10: Set the luma threshold used as a coefficient to determine yading@10: whether a pixel should be blurred or not. The option value must be an yading@10: integer in the range [-30,30]. A value of 0 will filter all the image, yading@10: a value included in [0,30] will filter flat areas and a value included yading@10: in [-30,0] will filter edges. Default value is 0. yading@10: yading@10: yading@10: =item B<chroma_radius, cr> yading@10: yading@10: Set the chroma radius. The option value must be a float number in yading@10: the range [0.1,5.0] that specifies the variance of the gaussian filter yading@10: used to blur the image (slower if larger). Default value is 1.0. yading@10: yading@10: yading@10: =item B<chroma_strength, cs> yading@10: yading@10: Set the chroma strength. The option value must be a float number yading@10: in the range [-1.0,1.0] that configures the blurring. A value included yading@10: in [0.0,1.0] will blur the image whereas a value included in yading@10: [-1.0,0.0] will sharpen the image. Default value is 1.0. yading@10: yading@10: yading@10: =item B<chroma_threshold, ct> yading@10: yading@10: Set the chroma threshold used as a coefficient to determine yading@10: whether a pixel should be blurred or not. The option value must be an yading@10: integer in the range [-30,30]. A value of 0 will filter all the image, yading@10: a value included in [0,30] will filter flat areas and a value included yading@10: in [-30,0] will filter edges. Default value is 0. yading@10: yading@10: =back yading@10: yading@10: yading@10: If a chroma option is not explicitly set, the corresponding luma value yading@10: is set. yading@10: yading@10: yading@10: =head2 stereo3d yading@10: yading@10: yading@10: Convert between different stereoscopic image formats. yading@10: yading@10: The filters accept the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<in> yading@10: yading@10: Set stereoscopic image format of input. yading@10: yading@10: Available values for input image formats are: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<sbsl> yading@10: yading@10: side by side parallel (left eye left, right eye right) yading@10: yading@10: yading@10: =item B<sbsr> yading@10: yading@10: side by side crosseye (right eye left, left eye right) yading@10: yading@10: yading@10: =item B<sbs2l> yading@10: yading@10: side by side parallel with half width resolution yading@10: (left eye left, right eye right) yading@10: yading@10: yading@10: =item B<sbs2r> yading@10: yading@10: side by side crosseye with half width resolution yading@10: (right eye left, left eye right) yading@10: yading@10: yading@10: =item B<abl> yading@10: yading@10: above-below (left eye above, right eye below) yading@10: yading@10: yading@10: =item B<abr> yading@10: yading@10: above-below (right eye above, left eye below) yading@10: yading@10: yading@10: =item B<ab2l> yading@10: yading@10: above-below with half height resolution yading@10: (left eye above, right eye below) yading@10: yading@10: yading@10: =item B<ab2r> yading@10: yading@10: above-below with half height resolution yading@10: (right eye above, left eye below) yading@10: yading@10: Default value is B<sbsl>. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<out> yading@10: yading@10: Set stereoscopic image format of output. yading@10: yading@10: Available values for output image formats are all the input formats as well as: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<arbg> yading@10: yading@10: anaglyph red/blue gray yading@10: (red filter on left eye, blue filter on right eye) yading@10: yading@10: yading@10: =item B<argg> yading@10: yading@10: anaglyph red/green gray yading@10: (red filter on left eye, green filter on right eye) yading@10: yading@10: yading@10: =item B<arcg> yading@10: yading@10: anaglyph red/cyan gray yading@10: (red filter on left eye, cyan filter on right eye) yading@10: yading@10: yading@10: =item B<arch> yading@10: yading@10: anaglyph red/cyan half colored yading@10: (red filter on left eye, cyan filter on right eye) yading@10: yading@10: yading@10: =item B<arcc> yading@10: yading@10: anaglyph red/cyan color yading@10: (red filter on left eye, cyan filter on right eye) yading@10: yading@10: yading@10: =item B<arcd> yading@10: yading@10: anaglyph red/cyan color optimized with the least squares projection of dubois yading@10: (red filter on left eye, cyan filter on right eye) yading@10: yading@10: yading@10: =item B<agmg> yading@10: yading@10: anaglyph green/magenta gray yading@10: (green filter on left eye, magenta filter on right eye) yading@10: yading@10: yading@10: =item B<agmh> yading@10: yading@10: anaglyph green/magenta half colored yading@10: (green filter on left eye, magenta filter on right eye) yading@10: yading@10: yading@10: =item B<agmc> yading@10: yading@10: anaglyph green/magenta colored yading@10: (green filter on left eye, magenta filter on right eye) yading@10: yading@10: yading@10: =item B<agmd> yading@10: yading@10: anaglyph green/magenta color optimized with the least squares projection of dubois yading@10: (green filter on left eye, magenta filter on right eye) yading@10: yading@10: yading@10: =item B<aybg> yading@10: yading@10: anaglyph yellow/blue gray yading@10: (yellow filter on left eye, blue filter on right eye) yading@10: yading@10: yading@10: =item B<aybh> yading@10: yading@10: anaglyph yellow/blue half colored yading@10: (yellow filter on left eye, blue filter on right eye) yading@10: yading@10: yading@10: =item B<aybc> yading@10: yading@10: anaglyph yellow/blue colored yading@10: (yellow filter on left eye, blue filter on right eye) yading@10: yading@10: yading@10: =item B<aybd> yading@10: yading@10: anaglyph yellow/blue color optimized with the least squares projection of dubois yading@10: (yellow filter on left eye, blue filter on right eye) yading@10: yading@10: yading@10: =item B<irl> yading@10: yading@10: interleaved rows (left eye has top row, right eye starts on next row) yading@10: yading@10: yading@10: =item B<irr> yading@10: yading@10: interleaved rows (right eye has top row, left eye starts on next row) yading@10: yading@10: yading@10: =item B<ml> yading@10: yading@10: mono output (left eye only) yading@10: yading@10: yading@10: =item B<mr> yading@10: yading@10: mono output (right eye only) yading@10: yading@10: =back yading@10: yading@10: yading@10: Default value is B<arcd>. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: yading@10: =head2 subtitles yading@10: yading@10: yading@10: Draw subtitles on top of input video using the libass library. yading@10: yading@10: To enable compilation of this filter you need to configure FFmpeg with yading@10: C<--enable-libass>. This filter also requires a build with libavcodec and yading@10: libavformat to convert the passed subtitles file to ASS (Advanced Substation yading@10: Alpha) subtitles format. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<filename, f> yading@10: yading@10: Set the filename of the subtitle file to read. It must be specified. yading@10: yading@10: yading@10: =item B<original_size> yading@10: yading@10: Specify the size of the original video, the video for which the ASS file yading@10: was composed. Due to a misdesign in ASS aspect ratio arithmetic, this is yading@10: necessary to correctly scale the fonts if the aspect ratio has been changed. yading@10: yading@10: yading@10: =item B<charenc> yading@10: yading@10: Set subtitles input character encoding. C<subtitles> filter only. Only yading@10: useful if not UTF-8. yading@10: yading@10: =back yading@10: yading@10: yading@10: If the first key is not specified, it is assumed that the first value yading@10: specifies the B<filename>. yading@10: yading@10: For example, to render the file F<sub.srt> on top of the input yading@10: video, use the command: yading@10: yading@10: subtitles=sub.srt yading@10: yading@10: yading@10: which is equivalent to: yading@10: yading@10: subtitles=filename=sub.srt yading@10: yading@10: yading@10: yading@10: =head2 super2xsai yading@10: yading@10: yading@10: Scale the input by 2x and smooth using the Super2xSaI (Scale and yading@10: Interpolate) pixel art scaling algorithm. yading@10: yading@10: Useful for enlarging pixel art images without reducing sharpness. yading@10: yading@10: yading@10: =head2 swapuv yading@10: yading@10: Swap U & V plane. yading@10: yading@10: yading@10: =head2 telecine yading@10: yading@10: yading@10: Apply telecine process to the video. yading@10: yading@10: This filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<first_field> yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<top, t> yading@10: yading@10: top field first yading@10: yading@10: =item B<bottom, b> yading@10: yading@10: bottom field first yading@10: The default value is C<top>. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<pattern> yading@10: yading@10: A string of numbers representing the pulldown pattern you wish to apply. yading@10: The default value is C<23>. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: Some typical patterns: yading@10: yading@10: NTSC output (30i): yading@10: 27.5p: 32222 yading@10: 24p: 23 (classic) yading@10: 24p: 2332 (preferred) yading@10: 20p: 33 yading@10: 18p: 334 yading@10: 16p: 3444 yading@10: yading@10: PAL output (25i): yading@10: 27.5p: 12222 yading@10: 24p: 222222222223 ("Euro pulldown") yading@10: 16.67p: 33 yading@10: 16p: 33333334 yading@10: yading@10: yading@10: yading@10: =head2 thumbnail yading@10: yading@10: Select the most representative frame in a given sequence of consecutive frames. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<n> yading@10: yading@10: Set the frames batch size to analyze; in a set of I<n> frames, the filter yading@10: will pick one of them, and then handle the next batch of I<n> frames until yading@10: the end. Default is C<100>. yading@10: yading@10: =back yading@10: yading@10: yading@10: Since the filter keeps track of the whole frames sequence, a bigger I<n> yading@10: value will result in a higher memory usage, so a high value is not recommended. yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Extract one picture each 50 frames: yading@10: yading@10: thumbnail=50 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Complete example of a thumbnail creation with B<ffmpeg>: yading@10: yading@10: ffmpeg -i in.avi -vf thumbnail,scale=300:200 -frames:v 1 out.png yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 tile yading@10: yading@10: yading@10: Tile several successive frames together. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<layout> yading@10: yading@10: Set the grid size (i.e. the number of lines and columns) in the form yading@10: "I<w>xI<h>". yading@10: yading@10: yading@10: =item B<nb_frames> yading@10: yading@10: Set the maximum number of frames to render in the given area. It must be less yading@10: than or equal to I<w>xI<h>. The default value is C<0>, meaning all yading@10: the area will be used. yading@10: yading@10: yading@10: =item B<margin> yading@10: yading@10: Set the outer border margin in pixels. yading@10: yading@10: yading@10: =item B<padding> yading@10: yading@10: Set the inner border thickness (i.e. the number of pixels between frames). For yading@10: more advanced padding options (such as having different values for the edges), yading@10: refer to the pad video filter. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Produce 8x8 PNG tiles of all keyframes (B<-skip_frame nokey>) in a movie: yading@10: yading@10: ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png yading@10: yading@10: The B<-vsync 0> is necessary to prevent B<ffmpeg> from yading@10: duplicating each output frame to accomodate the originally detected frame yading@10: rate. yading@10: yading@10: yading@10: =item * yading@10: yading@10: Display C<5> pictures in an area of C<3x2> frames, yading@10: with C<7> pixels between them, and C<2> pixels of initial margin, using yading@10: mixed flat and named options: yading@10: yading@10: tile=3x2:nb_frames=5:padding=7:margin=2 yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 tinterlace yading@10: yading@10: yading@10: Perform various types of temporal field interlacing. yading@10: yading@10: Frames are counted starting from 1, so the first input frame is yading@10: considered odd. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<mode> yading@10: yading@10: Specify the mode of the interlacing. This option can also be specified yading@10: as a value alone. See below for a list of values for this option. yading@10: yading@10: Available values are: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<merge, 0> yading@10: yading@10: Move odd frames into the upper field, even into the lower field, yading@10: generating a double height frame at half frame rate. yading@10: yading@10: yading@10: =item B<drop_odd, 1> yading@10: yading@10: Only output even frames, odd frames are dropped, generating a frame with yading@10: unchanged height at half frame rate. yading@10: yading@10: yading@10: =item B<drop_even, 2> yading@10: yading@10: Only output odd frames, even frames are dropped, generating a frame with yading@10: unchanged height at half frame rate. yading@10: yading@10: yading@10: =item B<pad, 3> yading@10: yading@10: Expand each frame to full height, but pad alternate lines with black, yading@10: generating a frame with double height at the same input frame rate. yading@10: yading@10: yading@10: =item B<interleave_top, 4> yading@10: yading@10: Interleave the upper field from odd frames with the lower field from yading@10: even frames, generating a frame with unchanged height at half frame rate. yading@10: yading@10: yading@10: =item B<interleave_bottom, 5> yading@10: yading@10: Interleave the lower field from odd frames with the upper field from yading@10: even frames, generating a frame with unchanged height at half frame rate. yading@10: yading@10: yading@10: =item B<interlacex2, 6> yading@10: yading@10: Double frame rate with unchanged height. Frames are inserted each yading@10: containing the second temporal field from the previous input frame and yading@10: the first temporal field from the next input frame. This mode relies on yading@10: the top_field_first flag. Useful for interlaced video displays with no yading@10: field synchronisation. yading@10: yading@10: =back yading@10: yading@10: yading@10: Numeric values are deprecated but are accepted for backward yading@10: compatibility reasons. yading@10: yading@10: Default mode is C<merge>. yading@10: yading@10: yading@10: =item B<flags> yading@10: yading@10: Specify flags influencing the filter process. yading@10: yading@10: Available value for I<flags> is: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<low_pass_filter, vlfp> yading@10: yading@10: Enable vertical low-pass filtering in the filter. yading@10: Vertical low-pass filtering is required when creating an interlaced yading@10: destination from a progressive source which contains high-frequency yading@10: vertical detail. Filtering will reduce interlace 'twitter' and Moire yading@10: patterning. yading@10: yading@10: Vertical low-pass filtering can only be enabled for B<mode> yading@10: I<interleave_top> and I<interleave_bottom>. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 transpose yading@10: yading@10: yading@10: Transpose rows with columns in the input video and optionally flip it. yading@10: yading@10: This filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<dir> yading@10: yading@10: The direction of the transpose. yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<0, 4, cclock_flip> yading@10: yading@10: Rotate by 90 degrees counterclockwise and vertically flip (default), that is: yading@10: yading@10: L.R L.l yading@10: . . -> . . yading@10: l.r R.r yading@10: yading@10: yading@10: yading@10: =item B<1, 5, clock> yading@10: yading@10: Rotate by 90 degrees clockwise, that is: yading@10: yading@10: L.R l.L yading@10: . . -> . . yading@10: l.r r.R yading@10: yading@10: yading@10: yading@10: =item B<2, 6, cclock> yading@10: yading@10: Rotate by 90 degrees counterclockwise, that is: yading@10: yading@10: L.R R.r yading@10: . . -> . . yading@10: l.r L.l yading@10: yading@10: yading@10: yading@10: =item B<3, 7, clock_flip> yading@10: yading@10: Rotate by 90 degrees clockwise and vertically flip, that is: yading@10: yading@10: L.R r.R yading@10: . . -> . . yading@10: l.r l.L yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: For values between 4-7, the transposition is only done if the input yading@10: video geometry is portrait and not landscape. These values are yading@10: deprecated, the C<passthrough> option should be used instead. yading@10: yading@10: yading@10: =item B<passthrough> yading@10: yading@10: Do not apply the transposition if the input geometry matches the one yading@10: specified by the specified value. It accepts the following values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<none> yading@10: yading@10: Always apply transposition. yading@10: yading@10: =item B<portrait> yading@10: yading@10: Preserve portrait geometry (when I<height> E<gt>= I<width>). yading@10: yading@10: =item B<landscape> yading@10: yading@10: Preserve landscape geometry (when I<width> E<gt>= I<height>). yading@10: yading@10: =back yading@10: yading@10: yading@10: Default value is C<none>. yading@10: yading@10: =back yading@10: yading@10: yading@10: For example to rotate by 90 degrees clockwise and preserve portrait yading@10: layout: yading@10: yading@10: transpose=dir=1:passthrough=portrait yading@10: yading@10: yading@10: The command above can also be specified as: yading@10: yading@10: transpose=1:portrait yading@10: yading@10: yading@10: yading@10: =head2 unsharp yading@10: yading@10: yading@10: Sharpen or blur the input video. yading@10: yading@10: It accepts the following parameters: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<luma_msize_x, lx> yading@10: yading@10: yading@10: =item B<chroma_msize_x, cx> yading@10: yading@10: Set the luma/chroma matrix horizontal size. It must be an odd integer yading@10: between 3 and 63, default value is 5. yading@10: yading@10: yading@10: =item B<luma_msize_y, ly> yading@10: yading@10: yading@10: =item B<chroma_msize_y, cy> yading@10: yading@10: Set the luma/chroma matrix vertical size. It must be an odd integer yading@10: between 3 and 63, default value is 5. yading@10: yading@10: yading@10: =item B<luma_amount, la> yading@10: yading@10: yading@10: =item B<chroma_amount, ca> yading@10: yading@10: Set the luma/chroma effect strength. It can be a float number, yading@10: reasonable values lay between -1.5 and 1.5. yading@10: yading@10: Negative values will blur the input video, while positive values will yading@10: sharpen it, a value of zero will disable the effect. yading@10: yading@10: Default value is 1.0 for B<luma_amount>, 0.0 for yading@10: B<chroma_amount>. yading@10: yading@10: =back yading@10: yading@10: yading@10: All parameters are optional and default to the yading@10: equivalent of the string '5:5:1.0:5:5:0.0'. yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Apply strong luma sharpen effect: yading@10: yading@10: unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Apply strong blur of both luma and chroma parameters: yading@10: yading@10: unsharp=7:7:-2:7:7:-2 yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 vflip yading@10: yading@10: yading@10: Flip the input video vertically. yading@10: yading@10: yading@10: ffmpeg -i in.avi -vf "vflip" out.avi yading@10: yading@10: yading@10: yading@10: yading@10: =head2 yadif yading@10: yading@10: yading@10: Deinterlace the input video ("yadif" means "yet another deinterlacing yading@10: filter"). yading@10: yading@10: This filter accepts the following options: yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<mode> yading@10: yading@10: The interlacing mode to adopt, accepts one of the following values: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<0, send_frame> yading@10: yading@10: output 1 frame for each frame yading@10: yading@10: =item B<1, send_field> yading@10: yading@10: output 1 frame for each field yading@10: yading@10: =item B<2, send_frame_nospatial> yading@10: yading@10: like C<send_frame> but skip spatial interlacing check yading@10: yading@10: =item B<3, send_field_nospatial> yading@10: yading@10: like C<send_field> but skip spatial interlacing check yading@10: yading@10: =back yading@10: yading@10: yading@10: Default value is C<send_frame>. yading@10: yading@10: yading@10: =item B<parity> yading@10: yading@10: The picture field parity assumed for the input interlaced video, accepts one of yading@10: the following values: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<0, tff> yading@10: yading@10: assume top field first yading@10: yading@10: =item B<1, bff> yading@10: yading@10: assume bottom field first yading@10: yading@10: =item B<-1, auto> yading@10: yading@10: enable automatic detection yading@10: yading@10: =back yading@10: yading@10: yading@10: Default value is C<auto>. yading@10: If interlacing is unknown or decoder does not export this information, yading@10: top field first will be assumed. yading@10: yading@10: yading@10: =item B<deint> yading@10: yading@10: Specify which frames to deinterlace. Accept one of the following yading@10: values: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<0, all> yading@10: yading@10: deinterlace all frames yading@10: yading@10: =item B<1, interlaced> yading@10: yading@10: only deinterlace frames marked as interlaced yading@10: yading@10: =back yading@10: yading@10: yading@10: Default value is C<all>. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: yading@10: =head1 VIDEO SOURCES yading@10: yading@10: yading@10: Below is a description of the currently available video sources. yading@10: yading@10: yading@10: =head2 buffer yading@10: yading@10: yading@10: Buffer video frames, and make them available to the filter chain. yading@10: yading@10: This source is mainly intended for a programmatic use, in particular yading@10: through the interface defined in F<libavfilter/vsrc_buffer.h>. yading@10: yading@10: This source accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<video_size> yading@10: yading@10: Specify the size (width and height) of the buffered video frames. yading@10: yading@10: yading@10: =item B<width> yading@10: yading@10: Input video width. yading@10: yading@10: yading@10: =item B<height> yading@10: yading@10: Input video height. yading@10: yading@10: yading@10: =item B<pix_fmt> yading@10: yading@10: A string representing the pixel format of the buffered video frames. yading@10: It may be a number corresponding to a pixel format, or a pixel format yading@10: name. yading@10: yading@10: yading@10: =item B<time_base> yading@10: yading@10: Specify the timebase assumed by the timestamps of the buffered frames. yading@10: yading@10: yading@10: =item B<frame_rate> yading@10: yading@10: Specify the frame rate expected for the video stream. yading@10: yading@10: yading@10: =item B<pixel_aspect, sar> yading@10: yading@10: Specify the sample aspect ratio assumed by the video frames. yading@10: yading@10: yading@10: =item B<sws_param> yading@10: yading@10: Specify the optional parameters to be used for the scale filter which yading@10: is automatically inserted when an input change is detected in the yading@10: input size or format. yading@10: yading@10: =back yading@10: yading@10: yading@10: For example: yading@10: yading@10: buffer=width=320:height=240:pix_fmt=yuv410p:time_base=1/24:sar=1 yading@10: yading@10: yading@10: will instruct the source to accept video frames with size 320x240 and yading@10: with format "yuv410p", assuming 1/24 as the timestamps timebase and yading@10: square pixels (1:1 sample aspect ratio). yading@10: Since the pixel format with name "yuv410p" corresponds to the number 6 yading@10: (check the enum AVPixelFormat definition in F<libavutil/pixfmt.h>), yading@10: this example corresponds to: yading@10: yading@10: buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1 yading@10: yading@10: yading@10: Alternatively, the options can be specified as a flat string, but this yading@10: syntax is deprecated: yading@10: yading@10: I<width>:I<height>:I<pix_fmt>:I<time_base.num>:I<time_base.den>:I<pixel_aspect.num>:I<pixel_aspect.den>[:I<sws_param>] yading@10: yading@10: yading@10: =head2 cellauto yading@10: yading@10: yading@10: Create a pattern generated by an elementary cellular automaton. yading@10: yading@10: The initial state of the cellular automaton can be defined through the yading@10: B<filename>, and B<pattern> options. If such options are yading@10: not specified an initial state is created randomly. yading@10: yading@10: At each new frame a new row in the video is filled with the result of yading@10: the cellular automaton next generation. The behavior when the whole yading@10: frame is filled is defined by the B<scroll> option. yading@10: yading@10: This source accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<filename, f> yading@10: yading@10: Read the initial cellular automaton state, i.e. the starting row, from yading@10: the specified file. yading@10: In the file, each non-whitespace character is considered an alive yading@10: cell, a newline will terminate the row, and further characters in the yading@10: file will be ignored. yading@10: yading@10: yading@10: =item B<pattern, p> yading@10: yading@10: Read the initial cellular automaton state, i.e. the starting row, from yading@10: the specified string. yading@10: yading@10: Each non-whitespace character in the string is considered an alive yading@10: cell, a newline will terminate the row, and further characters in the yading@10: string will be ignored. yading@10: yading@10: yading@10: =item B<rate, r> yading@10: yading@10: Set the video rate, that is the number of frames generated per second. yading@10: Default is 25. yading@10: yading@10: yading@10: =item B<random_fill_ratio, ratio> yading@10: yading@10: Set the random fill ratio for the initial cellular automaton row. It yading@10: is a floating point number value ranging from 0 to 1, defaults to yading@10: 1/PHI. yading@10: yading@10: This option is ignored when a file or a pattern is specified. yading@10: yading@10: yading@10: =item B<random_seed, seed> yading@10: yading@10: Set the seed for filling randomly the initial row, must be an integer yading@10: included between 0 and UINT32_MAX. If not specified, or if explicitly yading@10: set to -1, the filter will try to use a good random seed on a best yading@10: effort basis. yading@10: yading@10: yading@10: =item B<rule> yading@10: yading@10: Set the cellular automaton rule, it is a number ranging from 0 to 255. yading@10: Default value is 110. yading@10: yading@10: yading@10: =item B<size, s> yading@10: yading@10: Set the size of the output video. yading@10: yading@10: If B<filename> or B<pattern> is specified, the size is set yading@10: by default to the width of the specified initial state row, and the yading@10: height is set to I<width> * PHI. yading@10: yading@10: If B<size> is set, it must contain the width of the specified yading@10: pattern string, and the specified pattern will be centered in the yading@10: larger row. yading@10: yading@10: If a filename or a pattern string is not specified, the size value yading@10: defaults to "320x518" (used for a randomly generated initial state). yading@10: yading@10: yading@10: =item B<scroll> yading@10: yading@10: If set to 1, scroll the output upward when all the rows in the output yading@10: have been already filled. If set to 0, the new generated row will be yading@10: written over the top row just after the bottom row is filled. yading@10: Defaults to 1. yading@10: yading@10: yading@10: =item B<start_full, full> yading@10: yading@10: If set to 1, completely fill the output with generated rows before yading@10: outputting the first frame. yading@10: This is the default behavior, for disabling set the value to 0. yading@10: yading@10: yading@10: =item B<stitch> yading@10: yading@10: If set to 1, stitch the left and right row edges together. yading@10: This is the default behavior, for disabling set the value to 0. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Read the initial state from F<pattern>, and specify an output of yading@10: size 200x400. yading@10: yading@10: cellauto=f=pattern:s=200x400 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Generate a random initial row with a width of 200 cells, with a fill yading@10: ratio of 2/3: yading@10: yading@10: cellauto=ratio=2/3:s=200x200 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Create a pattern generated by rule 18 starting by a single alive cell yading@10: centered on an initial row with width 100: yading@10: yading@10: cellauto=p=@s=100x400:full=0:rule=18 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Specify a more elaborated initial pattern: yading@10: yading@10: cellauto=p='@@ @ @@':s=100x400:full=0:rule=18 yading@10: yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 mandelbrot yading@10: yading@10: yading@10: Generate a Mandelbrot set fractal, and progressively zoom towards the yading@10: point specified with I<start_x> and I<start_y>. yading@10: yading@10: This source accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<end_pts> yading@10: yading@10: Set the terminal pts value. Default value is 400. yading@10: yading@10: yading@10: =item B<end_scale> yading@10: yading@10: Set the terminal scale value. yading@10: Must be a floating point value. Default value is 0.3. yading@10: yading@10: yading@10: =item B<inner> yading@10: yading@10: Set the inner coloring mode, that is the algorithm used to draw the yading@10: Mandelbrot fractal internal region. yading@10: yading@10: It shall assume one of the following values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<black> yading@10: yading@10: Set black mode. yading@10: yading@10: =item B<convergence> yading@10: yading@10: Show time until convergence. yading@10: yading@10: =item B<mincol> yading@10: yading@10: Set color based on point closest to the origin of the iterations. yading@10: yading@10: =item B<period> yading@10: yading@10: Set period mode. yading@10: yading@10: =back yading@10: yading@10: yading@10: Default value is I<mincol>. yading@10: yading@10: yading@10: =item B<bailout> yading@10: yading@10: Set the bailout value. Default value is 10.0. yading@10: yading@10: yading@10: =item B<maxiter> yading@10: yading@10: Set the maximum of iterations performed by the rendering yading@10: algorithm. Default value is 7189. yading@10: yading@10: yading@10: =item B<outer> yading@10: yading@10: Set outer coloring mode. yading@10: It shall assume one of following values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<iteration_count> yading@10: yading@10: Set iteration cound mode. yading@10: yading@10: =item B<normalized_iteration_count> yading@10: yading@10: set normalized iteration count mode. yading@10: yading@10: =back yading@10: yading@10: Default value is I<normalized_iteration_count>. yading@10: yading@10: yading@10: =item B<rate, r> yading@10: yading@10: Set frame rate, expressed as number of frames per second. Default yading@10: value is "25". yading@10: yading@10: yading@10: =item B<size, s> yading@10: yading@10: Set frame size. Default value is "640x480". yading@10: yading@10: yading@10: =item B<start_scale> yading@10: yading@10: Set the initial scale value. Default value is 3.0. yading@10: yading@10: yading@10: =item B<start_x> yading@10: yading@10: Set the initial x position. Must be a floating point value between yading@10: -100 and 100. Default value is -0.743643887037158704752191506114774. yading@10: yading@10: yading@10: =item B<start_y> yading@10: yading@10: Set the initial y position. Must be a floating point value between yading@10: -100 and 100. Default value is -0.131825904205311970493132056385139. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 mptestsrc yading@10: yading@10: yading@10: Generate various test patterns, as generated by the MPlayer test filter. yading@10: yading@10: The size of the generated video is fixed, and is 256x256. yading@10: This source is useful in particular for testing encoding features. yading@10: yading@10: This source accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<rate, r> yading@10: yading@10: Specify the frame rate of the sourced video, as the number of frames yading@10: generated per second. It has to be a string in the format yading@10: I<frame_rate_num>/I<frame_rate_den>, an integer number, a float yading@10: number or a valid video frame rate abbreviation. The default value is yading@10: "25". yading@10: yading@10: yading@10: =item B<duration, d> yading@10: yading@10: Set the video duration of the sourced video. The accepted syntax is: yading@10: yading@10: [-]HH:MM:SS[.m...] yading@10: [-]S+[.m...] yading@10: yading@10: See also the function C<av_parse_time()>. yading@10: yading@10: If not specified, or the expressed duration is negative, the video is yading@10: supposed to be generated forever. yading@10: yading@10: yading@10: =item B<test, t> yading@10: yading@10: yading@10: Set the number or the name of the test to perform. Supported tests are: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<dc_luma> yading@10: yading@10: yading@10: =item B<dc_chroma> yading@10: yading@10: yading@10: =item B<freq_luma> yading@10: yading@10: yading@10: =item B<freq_chroma> yading@10: yading@10: yading@10: =item B<amp_luma> yading@10: yading@10: yading@10: =item B<amp_chroma> yading@10: yading@10: yading@10: =item B<cbp> yading@10: yading@10: yading@10: =item B<mv> yading@10: yading@10: yading@10: =item B<ring1> yading@10: yading@10: yading@10: =item B<ring2> yading@10: yading@10: yading@10: =item B<all> yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: Default value is "all", which will cycle through the list of all tests. yading@10: yading@10: =back yading@10: yading@10: yading@10: For example the following: yading@10: yading@10: testsrc=t=dc_luma yading@10: yading@10: yading@10: will generate a "dc_luma" test pattern. yading@10: yading@10: yading@10: =head2 frei0r_src yading@10: yading@10: yading@10: Provide a frei0r source. yading@10: yading@10: To enable compilation of this filter you need to install the frei0r yading@10: header and configure FFmpeg with C<--enable-frei0r>. yading@10: yading@10: This source accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<size> yading@10: yading@10: The size of the video to generate, may be a string of the form yading@10: I<width>xI<height> or a frame size abbreviation. yading@10: yading@10: yading@10: =item B<framerate> yading@10: yading@10: Framerate of the generated video, may be a string of the form yading@10: I<num>/I<den> or a frame rate abbreviation. yading@10: yading@10: yading@10: =item B<filter_name> yading@10: yading@10: The name to the frei0r source to load. For more information regarding frei0r and yading@10: how to set the parameters read the section frei0r in the description of yading@10: the video filters. yading@10: yading@10: yading@10: =item B<filter_params> yading@10: yading@10: A '|'-separated list of parameters to pass to the frei0r source. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: For example, to generate a frei0r partik0l source with size 200x200 yading@10: and frame rate 10 which is overlayed on the overlay filter main input: yading@10: yading@10: frei0r_src=size=200x200:framerate=10:filter_name=partik0l:filter_params=1234 [overlay]; [in][overlay] overlay yading@10: yading@10: yading@10: yading@10: =head2 life yading@10: yading@10: yading@10: Generate a life pattern. yading@10: yading@10: This source is based on a generalization of John Conway's life game. yading@10: yading@10: The sourced input represents a life grid, each pixel represents a cell yading@10: which can be in one of two possible states, alive or dead. Every cell yading@10: interacts with its eight neighbours, which are the cells that are yading@10: horizontally, vertically, or diagonally adjacent. yading@10: yading@10: At each interaction the grid evolves according to the adopted rule, yading@10: which specifies the number of neighbor alive cells which will make a yading@10: cell stay alive or born. The B<rule> option allows to specify yading@10: the rule to adopt. yading@10: yading@10: This source accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<filename, f> yading@10: yading@10: Set the file from which to read the initial grid state. In the file, yading@10: each non-whitespace character is considered an alive cell, and newline yading@10: is used to delimit the end of each row. yading@10: yading@10: If this option is not specified, the initial grid is generated yading@10: randomly. yading@10: yading@10: yading@10: =item B<rate, r> yading@10: yading@10: Set the video rate, that is the number of frames generated per second. yading@10: Default is 25. yading@10: yading@10: yading@10: =item B<random_fill_ratio, ratio> yading@10: yading@10: Set the random fill ratio for the initial random grid. It is a yading@10: floating point number value ranging from 0 to 1, defaults to 1/PHI. yading@10: It is ignored when a file is specified. yading@10: yading@10: yading@10: =item B<random_seed, seed> yading@10: yading@10: Set the seed for filling the initial random grid, must be an integer yading@10: included between 0 and UINT32_MAX. If not specified, or if explicitly yading@10: set to -1, the filter will try to use a good random seed on a best yading@10: effort basis. yading@10: yading@10: yading@10: =item B<rule> yading@10: yading@10: Set the life rule. yading@10: yading@10: A rule can be specified with a code of the kind "SI<NS>/BI<NB>", yading@10: where I<NS> and I<NB> are sequences of numbers in the range 0-8, yading@10: I<NS> specifies the number of alive neighbor cells which make a yading@10: live cell stay alive, and I<NB> the number of alive neighbor cells yading@10: which make a dead cell to become alive (i.e. to "born"). yading@10: "s" and "b" can be used in place of "S" and "B", respectively. yading@10: yading@10: Alternatively a rule can be specified by an 18-bits integer. The 9 yading@10: high order bits are used to encode the next cell state if it is alive yading@10: for each number of neighbor alive cells, the low order bits specify yading@10: the rule for "borning" new cells. Higher order bits encode for an yading@10: higher number of neighbor cells. yading@10: For example the number 6153 = C<(12E<lt>E<lt>9)+9> specifies a stay alive yading@10: rule of 12 and a born rule of 9, which corresponds to "S23/B03". yading@10: yading@10: Default value is "S23/B3", which is the original Conway's game of life yading@10: rule, and will keep a cell alive if it has 2 or 3 neighbor alive yading@10: cells, and will born a new cell if there are three alive cells around yading@10: a dead cell. yading@10: yading@10: yading@10: =item B<size, s> yading@10: yading@10: Set the size of the output video. yading@10: yading@10: If B<filename> is specified, the size is set by default to the yading@10: same size of the input file. If B<size> is set, it must contain yading@10: the size specified in the input file, and the initial grid defined in yading@10: that file is centered in the larger resulting area. yading@10: yading@10: If a filename is not specified, the size value defaults to "320x240" yading@10: (used for a randomly generated initial grid). yading@10: yading@10: yading@10: =item B<stitch> yading@10: yading@10: If set to 1, stitch the left and right grid edges together, and the yading@10: top and bottom edges also. Defaults to 1. yading@10: yading@10: yading@10: =item B<mold> yading@10: yading@10: Set cell mold speed. If set, a dead cell will go from B<death_color> to yading@10: B<mold_color> with a step of B<mold>. B<mold> can have a yading@10: value from 0 to 255. yading@10: yading@10: yading@10: =item B<life_color> yading@10: yading@10: Set the color of living (or new born) cells. yading@10: yading@10: yading@10: =item B<death_color> yading@10: yading@10: Set the color of dead cells. If B<mold> is set, this is the first color yading@10: used to represent a dead cell. yading@10: yading@10: yading@10: =item B<mold_color> yading@10: yading@10: Set mold color, for definitely dead and moldy cells. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Read a grid from F<pattern>, and center it on a grid of size yading@10: 300x300 pixels: yading@10: yading@10: life=f=pattern:s=300x300 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Generate a random grid of size 200x200, with a fill ratio of 2/3: yading@10: yading@10: life=ratio=2/3:s=200x200 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Specify a custom rule for evolving a randomly generated grid: yading@10: yading@10: life=rule=S14/B34 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Full example with slow death effect (mold) using B<ffplay>: yading@10: yading@10: ffplay -f lavfi life=s=300x200:mold=10:r=60:ratio=0.1:death_color=#C83232:life_color=#00ff00,scale=1200:800:flags=16 yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 color, nullsrc, rgbtestsrc, smptebars, smptehdbars, testsrc yading@10: yading@10: yading@10: The C<color> source provides an uniformly colored input. yading@10: yading@10: The C<nullsrc> source returns unprocessed video frames. It is yading@10: mainly useful to be employed in analysis / debugging tools, or as the yading@10: source for filters which ignore the input data. yading@10: yading@10: The C<rgbtestsrc> source generates an RGB test pattern useful for yading@10: detecting RGB vs BGR issues. You should see a red, green and blue yading@10: stripe from top to bottom. yading@10: yading@10: The C<smptebars> source generates a color bars pattern, based on yading@10: the SMPTE Engineering Guideline EG 1-1990. yading@10: yading@10: The C<smptehdbars> source generates a color bars pattern, based on yading@10: the SMPTE RP 219-2002. yading@10: yading@10: The C<testsrc> source generates a test video pattern, showing a yading@10: color pattern, a scrolling gradient and a timestamp. This is mainly yading@10: intended for testing purposes. yading@10: yading@10: The sources accept the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<color, c> yading@10: yading@10: Specify the color of the source, only used in the C<color> yading@10: source. It can be the name of a color (case insensitive match) or a yading@10: 0xRRGGBB[AA] sequence, possibly followed by an alpha specifier. The yading@10: default value is "black". yading@10: yading@10: yading@10: =item B<size, s> yading@10: yading@10: Specify the size of the sourced video, it may be a string of the form yading@10: I<width>xI<height>, or the name of a size abbreviation. The yading@10: default value is "320x240". yading@10: yading@10: yading@10: =item B<rate, r> yading@10: yading@10: Specify the frame rate of the sourced video, as the number of frames yading@10: generated per second. It has to be a string in the format yading@10: I<frame_rate_num>/I<frame_rate_den>, an integer number, a float yading@10: number or a valid video frame rate abbreviation. The default value is yading@10: "25". yading@10: yading@10: yading@10: =item B<sar> yading@10: yading@10: Set the sample aspect ratio of the sourced video. yading@10: yading@10: yading@10: =item B<duration, d> yading@10: yading@10: Set the video duration of the sourced video. The accepted syntax is: yading@10: yading@10: [-]HH[:MM[:SS[.m...]]] yading@10: [-]S+[.m...] yading@10: yading@10: See also the function C<av_parse_time()>. yading@10: yading@10: If not specified, or the expressed duration is negative, the video is yading@10: supposed to be generated forever. yading@10: yading@10: yading@10: =item B<decimals, n> yading@10: yading@10: Set the number of decimals to show in the timestamp, only used in the yading@10: C<testsrc> source. yading@10: yading@10: The displayed timestamp value will correspond to the original yading@10: timestamp value multiplied by the power of 10 of the specified yading@10: value. Default value is 0. yading@10: yading@10: =back yading@10: yading@10: yading@10: For example the following: yading@10: yading@10: testsrc=duration=5.3:size=qcif:rate=10 yading@10: yading@10: yading@10: will generate a video with a duration of 5.3 seconds, with size yading@10: 176x144 and a frame rate of 10 frames per second. yading@10: yading@10: The following graph description will generate a red source yading@10: with an opacity of 0.2, with size "qcif" and a frame rate of 10 yading@10: frames per second. yading@10: yading@10: color=c=red@0.2:s=qcif:r=10 yading@10: yading@10: yading@10: If the input content is to be ignored, C<nullsrc> can be used. The yading@10: following command generates noise in the luminance plane by employing yading@10: the C<geq> filter: yading@10: yading@10: nullsrc=s=256x256, geq=random(1)*255:128:128 yading@10: yading@10: yading@10: yading@10: yading@10: =head1 VIDEO SINKS yading@10: yading@10: yading@10: Below is a description of the currently available video sinks. yading@10: yading@10: yading@10: =head2 buffersink yading@10: yading@10: yading@10: Buffer video frames, and make them available to the end of the filter yading@10: graph. yading@10: yading@10: This sink is mainly intended for a programmatic use, in particular yading@10: through the interface defined in F<libavfilter/buffersink.h> yading@10: or the options system. yading@10: yading@10: It accepts a pointer to an AVBufferSinkContext structure, which yading@10: defines the incoming buffers' formats, to be passed as the opaque yading@10: parameter to C<avfilter_init_filter> for initialization. yading@10: yading@10: yading@10: =head2 nullsink yading@10: yading@10: yading@10: Null video sink, do absolutely nothing with the input video. It is yading@10: mainly useful as a template and to be employed in analysis / debugging yading@10: tools. yading@10: yading@10: yading@10: yading@10: =head1 MULTIMEDIA FILTERS yading@10: yading@10: yading@10: Below is a description of the currently available multimedia filters. yading@10: yading@10: yading@10: =head2 aperms, perms yading@10: yading@10: yading@10: Set read/write permissions for the output frames. yading@10: yading@10: These filters are mainly aimed at developers to test direct path in the yading@10: following filter in the filtergraph. yading@10: yading@10: The filters accept the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<mode> yading@10: yading@10: Select the permissions mode. yading@10: yading@10: It accepts the following values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<none> yading@10: yading@10: Do nothing. This is the default. yading@10: yading@10: =item B<ro> yading@10: yading@10: Set all the output frames read-only. yading@10: yading@10: =item B<rw> yading@10: yading@10: Set all the output frames directly writable. yading@10: yading@10: =item B<toggle> yading@10: yading@10: Make the frame read-only if writable, and writable if read-only. yading@10: yading@10: =item B<random> yading@10: yading@10: Set each output frame read-only or writable randomly. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<seed> yading@10: yading@10: Set the seed for the I<random> mode, must be an integer included between yading@10: C<0> and C<UINT32_MAX>. If not specified, or if explicitly set to yading@10: C<-1>, the filter will try to use a good random seed on a best effort yading@10: basis. yading@10: yading@10: =back yading@10: yading@10: yading@10: Note: in case of auto-inserted filter between the permission filter and the yading@10: following one, the permission might not be received as expected in that yading@10: following filter. Inserting a format or aformat filter before the yading@10: perms/aperms filter can avoid this problem. yading@10: yading@10: yading@10: =head2 aselect, select yading@10: yading@10: Select frames to pass in output. yading@10: yading@10: This filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<expr, e> yading@10: yading@10: Set expression, which is evaluated for each input frame. yading@10: yading@10: If the expression is evaluated to zero, the frame is discarded. yading@10: yading@10: If the evaluation result is negative or NaN, the frame is sent to the yading@10: first output; otherwise it is sent to the output with index yading@10: C<ceil(val)-1>, assuming that the input index starts from 0. yading@10: yading@10: For example a value of C<1.2> corresponds to the output with index yading@10: C<ceil(1.2)-1 = 2-1 = 1>, that is the second output. yading@10: yading@10: yading@10: =item B<outputs, n> yading@10: yading@10: Set the number of outputs. The output to which to send the selected yading@10: frame is based on the result of the evaluation. Default value is 1. yading@10: yading@10: =back yading@10: yading@10: yading@10: The expression can contain the following constants: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<n> yading@10: yading@10: the sequential number of the filtered frame, starting from 0 yading@10: yading@10: yading@10: =item B<selected_n> yading@10: yading@10: the sequential number of the selected frame, starting from 0 yading@10: yading@10: yading@10: =item B<prev_selected_n> yading@10: yading@10: the sequential number of the last selected frame, NAN if undefined yading@10: yading@10: yading@10: =item B<TB> yading@10: yading@10: timebase of the input timestamps yading@10: yading@10: yading@10: =item B<pts> yading@10: yading@10: the PTS (Presentation TimeStamp) of the filtered video frame, yading@10: expressed in I<TB> units, NAN if undefined yading@10: yading@10: yading@10: =item B<t> yading@10: yading@10: the PTS (Presentation TimeStamp) of the filtered video frame, yading@10: expressed in seconds, NAN if undefined yading@10: yading@10: yading@10: =item B<prev_pts> yading@10: yading@10: the PTS of the previously filtered video frame, NAN if undefined yading@10: yading@10: yading@10: =item B<prev_selected_pts> yading@10: yading@10: the PTS of the last previously filtered video frame, NAN if undefined yading@10: yading@10: yading@10: =item B<prev_selected_t> yading@10: yading@10: the PTS of the last previously selected video frame, NAN if undefined yading@10: yading@10: yading@10: =item B<start_pts> yading@10: yading@10: the PTS of the first video frame in the video, NAN if undefined yading@10: yading@10: yading@10: =item B<start_t> yading@10: yading@10: the time of the first video frame in the video, NAN if undefined yading@10: yading@10: yading@10: =item B<pict_type> I<(video only)> yading@10: yading@10: the type of the filtered frame, can assume one of the following yading@10: values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<I> yading@10: yading@10: yading@10: =item B<P> yading@10: yading@10: yading@10: =item B<B> yading@10: yading@10: yading@10: =item B<S> yading@10: yading@10: yading@10: =item B<SI> yading@10: yading@10: yading@10: =item B<SP> yading@10: yading@10: yading@10: =item B<BI> yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<interlace_type> I<(video only)> yading@10: yading@10: the frame interlace type, can assume one of the following values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<PROGRESSIVE> yading@10: yading@10: the frame is progressive (not interlaced) yading@10: yading@10: =item B<TOPFIRST> yading@10: yading@10: the frame is top-field-first yading@10: yading@10: =item B<BOTTOMFIRST> yading@10: yading@10: the frame is bottom-field-first yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =item B<consumed_sample_n> I<(audio only)> yading@10: yading@10: the number of selected samples before the current frame yading@10: yading@10: yading@10: =item B<samples_n> I<(audio only)> yading@10: yading@10: the number of samples in the current frame yading@10: yading@10: yading@10: =item B<sample_rate> I<(audio only)> yading@10: yading@10: the input sample rate yading@10: yading@10: yading@10: =item B<key> yading@10: yading@10: 1 if the filtered frame is a key-frame, 0 otherwise yading@10: yading@10: yading@10: =item B<pos> yading@10: yading@10: the position in the file of the filtered frame, -1 if the information yading@10: is not available (e.g. for synthetic video) yading@10: yading@10: yading@10: =item B<scene> I<(video only)> yading@10: yading@10: value between 0 and 1 to indicate a new scene; a low value reflects a low yading@10: probability for the current frame to introduce a new scene, while a higher yading@10: value means the current frame is more likely to be one (see the example below) yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: The default value of the select expression is "1". yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Select all frames in input: yading@10: yading@10: select yading@10: yading@10: yading@10: The example above is the same as: yading@10: yading@10: select=1 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Skip all frames: yading@10: yading@10: select=0 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Select only I-frames: yading@10: yading@10: select='eq(pict_type\,I)' yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Select one frame every 100: yading@10: yading@10: select='not(mod(n\,100))' yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Select only frames contained in the 10-20 time interval: yading@10: yading@10: select='gte(t\,10)*lte(t\,20)' yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Select only I frames contained in the 10-20 time interval: yading@10: yading@10: select='gte(t\,10)*lte(t\,20)*eq(pict_type\,I)' yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Select frames with a minimum distance of 10 seconds: yading@10: yading@10: select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)' yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Use aselect to select only audio frames with samples number E<gt> 100: yading@10: yading@10: aselect='gt(samples_n\,100)' yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Create a mosaic of the first scenes: yading@10: yading@10: ffmpeg -i video.avi -vf select='gt(scene\,0.4)',scale=160:120,tile -frames:v 1 preview.png yading@10: yading@10: yading@10: Comparing I<scene> against a value between 0.3 and 0.5 is generally a sane yading@10: choice. yading@10: yading@10: yading@10: =item * yading@10: yading@10: Send even and odd frames to separate outputs, and compose them: yading@10: yading@10: select=n=2:e='mod(n, 2)+1' [odd][even]; [odd] pad=h=2*ih [tmp]; [tmp][even] overlay=y=h yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 asendcmd, sendcmd yading@10: yading@10: yading@10: Send commands to filters in the filtergraph. yading@10: yading@10: These filters read commands to be sent to other filters in the yading@10: filtergraph. yading@10: yading@10: C<asendcmd> must be inserted between two audio filters, yading@10: C<sendcmd> must be inserted between two video filters, but apart yading@10: from that they act the same way. yading@10: yading@10: The specification of commands can be provided in the filter arguments yading@10: with the I<commands> option, or in a file specified by the yading@10: I<filename> option. yading@10: yading@10: These filters accept the following options: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<commands, c> yading@10: yading@10: Set the commands to be read and sent to the other filters. yading@10: yading@10: =item B<filename, f> yading@10: yading@10: Set the filename of the commands to be read and sent to the other yading@10: filters. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Commands syntax yading@10: yading@10: yading@10: A commands description consists of a sequence of interval yading@10: specifications, comprising a list of commands to be executed when a yading@10: particular event related to that interval occurs. The occurring event yading@10: is typically the current frame time entering or leaving a given time yading@10: interval. yading@10: yading@10: An interval is specified by the following syntax: yading@10: yading@10: <START>[-<END>] <COMMANDS>; yading@10: yading@10: yading@10: The time interval is specified by the I<START> and I<END> times. yading@10: I<END> is optional and defaults to the maximum time. yading@10: yading@10: The current frame time is considered within the specified interval if yading@10: it is included in the interval [I<START>, I<END>), that is when yading@10: the time is greater or equal to I<START> and is lesser than yading@10: I<END>. yading@10: yading@10: I<COMMANDS> consists of a sequence of one or more command yading@10: specifications, separated by ",", relating to that interval. The yading@10: syntax of a command specification is given by: yading@10: yading@10: [<FLAGS>] <TARGET> <COMMAND> <ARG> yading@10: yading@10: yading@10: I<FLAGS> is optional and specifies the type of events relating to yading@10: the time interval which enable sending the specified command, and must yading@10: be a non-null sequence of identifier flags separated by "+" or "|" and yading@10: enclosed between "[" and "]". yading@10: yading@10: The following flags are recognized: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<enter> yading@10: yading@10: The command is sent when the current frame timestamp enters the yading@10: specified interval. In other words, the command is sent when the yading@10: previous frame timestamp was not in the given interval, and the yading@10: current is. yading@10: yading@10: yading@10: =item B<leave> yading@10: yading@10: The command is sent when the current frame timestamp leaves the yading@10: specified interval. In other words, the command is sent when the yading@10: previous frame timestamp was in the given interval, and the yading@10: current is not. yading@10: yading@10: =back yading@10: yading@10: yading@10: If I<FLAGS> is not specified, a default value of C<[enter]> is yading@10: assumed. yading@10: yading@10: I<TARGET> specifies the target of the command, usually the name of yading@10: the filter class or a specific filter instance name. yading@10: yading@10: I<COMMAND> specifies the name of the command for the target filter. yading@10: yading@10: I<ARG> is optional and specifies the optional list of argument for yading@10: the given I<COMMAND>. yading@10: yading@10: Between one interval specification and another, whitespaces, or yading@10: sequences of characters starting with C<#> until the end of line, yading@10: are ignored and can be used to annotate comments. yading@10: yading@10: A simplified BNF description of the commands specification syntax yading@10: follows: yading@10: yading@10: <COMMAND_FLAG> ::= "enter" | "leave" yading@10: <COMMAND_FLAGS> ::= <COMMAND_FLAG> [(+|"|")<COMMAND_FLAG>] yading@10: <COMMAND> ::= ["[" <COMMAND_FLAGS> "]"] <TARGET> <COMMAND> [<ARG>] yading@10: <COMMANDS> ::= <COMMAND> [,<COMMANDS>] yading@10: <INTERVAL> ::= <START>[-<END>] <COMMANDS> yading@10: <INTERVALS> ::= <INTERVAL>[;<INTERVALS>] yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Specify audio tempo change at second 4: yading@10: yading@10: asendcmd=c='4.0 atempo tempo 1.5',atempo yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Specify a list of drawtext and hue commands in a file. yading@10: yading@10: # show text in the interval 5-10 yading@10: 5.0-10.0 [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=hello world', yading@10: [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text='; yading@10: yading@10: # desaturate the image in the interval 15-20 yading@10: 15.0-20.0 [enter] hue s 0, yading@10: [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=nocolor', yading@10: [leave] hue s 1, yading@10: [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=color'; yading@10: yading@10: # apply an exponential saturation fade-out effect, starting from time 25 yading@10: 25 [enter] hue s exp(25-t) yading@10: yading@10: yading@10: A filtergraph allowing to read and process the above command list yading@10: stored in a file F<test.cmd>, can be specified with: yading@10: yading@10: sendcmd=f=test.cmd,drawtext=fontfile=FreeSerif.ttf:text='',hue yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: yading@10: =head2 asetpts, setpts yading@10: yading@10: yading@10: Change the PTS (presentation timestamp) of the input frames. yading@10: yading@10: C<asetpts> works on audio frames, C<setpts> on video frames. yading@10: yading@10: This filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<expr> yading@10: yading@10: The expression which is evaluated for each frame to construct its timestamp. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: The expression is evaluated through the eval API and can contain the following yading@10: constants: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<FRAME_RATE> yading@10: yading@10: frame rate, only defined for constant frame-rate video yading@10: yading@10: yading@10: =item B<PTS> yading@10: yading@10: the presentation timestamp in input yading@10: yading@10: yading@10: =item B<N> yading@10: yading@10: the count of the input frame, starting from 0. yading@10: yading@10: yading@10: =item B<NB_CONSUMED_SAMPLES> yading@10: yading@10: the number of consumed samples, not including the current frame (only yading@10: audio) yading@10: yading@10: yading@10: =item B<NB_SAMPLES> yading@10: yading@10: the number of samples in the current frame (only audio) yading@10: yading@10: yading@10: =item B<SAMPLE_RATE> yading@10: yading@10: audio sample rate yading@10: yading@10: yading@10: =item B<STARTPTS> yading@10: yading@10: the PTS of the first frame yading@10: yading@10: yading@10: =item B<STARTT> yading@10: yading@10: the time in seconds of the first frame yading@10: yading@10: yading@10: =item B<INTERLACED> yading@10: yading@10: tell if the current frame is interlaced yading@10: yading@10: yading@10: =item B<T> yading@10: yading@10: the time in seconds of the current frame yading@10: yading@10: yading@10: =item B<TB> yading@10: yading@10: the time base yading@10: yading@10: yading@10: =item B<POS> yading@10: yading@10: original position in the file of the frame, or undefined if undefined yading@10: for the current frame yading@10: yading@10: yading@10: =item B<PREV_INPTS> yading@10: yading@10: previous input PTS yading@10: yading@10: yading@10: =item B<PREV_INT> yading@10: yading@10: previous input time in seconds yading@10: yading@10: yading@10: =item B<PREV_OUTPTS> yading@10: yading@10: previous output PTS yading@10: yading@10: yading@10: =item B<PREV_OUTT> yading@10: yading@10: previous output time in seconds yading@10: yading@10: yading@10: =item B<RTCTIME> yading@10: yading@10: wallclock (RTC) time in microseconds. This is deprecated, use time(0) yading@10: instead. yading@10: yading@10: yading@10: =item B<RTCSTART> yading@10: yading@10: wallclock (RTC) time at the start of the movie in microseconds yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Start counting PTS from zero yading@10: yading@10: setpts=PTS-STARTPTS yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Apply fast motion effect: yading@10: yading@10: setpts=0.5*PTS yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Apply slow motion effect: yading@10: yading@10: setpts=2.0*PTS yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Set fixed rate of 25 frames per second: yading@10: yading@10: setpts=N/(25*TB) yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Set fixed rate 25 fps with some jitter: yading@10: yading@10: setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))' yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Apply an offset of 10 seconds to the input PTS: yading@10: yading@10: setpts=PTS+10/TB yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Generate timestamps from a "live source" and rebase onto the current timebase: yading@10: yading@10: setpts='(RTCTIME - RTCSTART) / (TB * 1000000)' yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 ebur128 yading@10: yading@10: yading@10: EBU R128 scanner filter. This filter takes an audio stream as input and outputs yading@10: it unchanged. By default, it logs a message at a frequency of 10Hz with the yading@10: Momentary loudness (identified by C<M>), Short-term loudness (C<S>), yading@10: Integrated loudness (C<I>) and Loudness Range (C<LRA>). yading@10: yading@10: The filter also has a video output (see the I<video> option) with a real yading@10: time graph to observe the loudness evolution. The graphic contains the logged yading@10: message mentioned above, so it is not printed anymore when this option is set, yading@10: unless the verbose logging is set. The main graphing area contains the yading@10: short-term loudness (3 seconds of analysis), and the gauge on the right is for yading@10: the momentary loudness (400 milliseconds). yading@10: yading@10: More information about the Loudness Recommendation EBU R128 on yading@10: E<lt>B<http://tech.ebu.ch/loudness>E<gt>. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<video> yading@10: yading@10: Activate the video output. The audio stream is passed unchanged whether this yading@10: option is set or no. The video stream will be the first output stream if yading@10: activated. Default is C<0>. yading@10: yading@10: yading@10: =item B<size> yading@10: yading@10: Set the video size. This option is for video only. Default and minimum yading@10: resolution is C<640x480>. yading@10: yading@10: yading@10: =item B<meter> yading@10: yading@10: Set the EBU scale meter. Default is C<9>. Common values are C<9> and yading@10: C<18>, respectively for EBU scale meter +9 and EBU scale meter +18. Any yading@10: other integer value between this range is allowed. yading@10: yading@10: yading@10: =item B<metadata> yading@10: yading@10: Set metadata injection. If set to C<1>, the audio input will be segmented yading@10: into 100ms output frames, each of them containing various loudness information yading@10: in metadata. All the metadata keys are prefixed with C<lavfi.r128.>. yading@10: yading@10: Default is C<0>. yading@10: yading@10: yading@10: =item B<framelog> yading@10: yading@10: Force the frame logging level. yading@10: yading@10: Available values are: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<info> yading@10: yading@10: information logging level yading@10: yading@10: =item B<verbose> yading@10: yading@10: verbose logging level yading@10: yading@10: =back yading@10: yading@10: yading@10: By default, the logging level is set to I<info>. If the B<video> or yading@10: the B<metadata> options are set, it switches to I<verbose>. yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Real-time graph using B<ffplay>, with a EBU scale meter +18: yading@10: yading@10: ffplay -f lavfi -i "amovie=input.mp3,ebur128=video=1:meter=18 [out0][out1]" yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Run an analysis with B<ffmpeg>: yading@10: yading@10: ffmpeg -nostats -i input.mp3 -filter_complex ebur128 -f null - yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 settb, asettb yading@10: yading@10: yading@10: Set the timebase to use for the output frames timestamps. yading@10: It is mainly useful for testing timebase configuration. yading@10: yading@10: This filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<expr, tb> yading@10: yading@10: The expression which is evaluated into the output timebase. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: The value for B<tb> is an arithmetic expression representing a yading@10: rational. The expression can contain the constants "AVTB" (the default yading@10: timebase), "intb" (the input timebase) and "sr" (the sample rate, yading@10: audio only). Default value is "intb". yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Set the timebase to 1/25: yading@10: yading@10: settb=expr=1/25 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Set the timebase to 1/10: yading@10: yading@10: settb=expr=0.1 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Set the timebase to 1001/1000: yading@10: yading@10: settb=1+0.001 yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Set the timebase to 2*intb: yading@10: yading@10: settb=2*intb yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Set the default timebase value: yading@10: yading@10: settb=AVTB yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 concat yading@10: yading@10: yading@10: Concatenate audio and video streams, joining them together one after the yading@10: other. yading@10: yading@10: The filter works on segments of synchronized video and audio streams. All yading@10: segments must have the same number of streams of each type, and that will yading@10: also be the number of streams at output. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: yading@10: =item B<n> yading@10: yading@10: Set the number of segments. Default is 2. yading@10: yading@10: yading@10: =item B<v> yading@10: yading@10: Set the number of output video streams, that is also the number of video yading@10: streams in each segment. Default is 1. yading@10: yading@10: yading@10: =item B<a> yading@10: yading@10: Set the number of output audio streams, that is also the number of video yading@10: streams in each segment. Default is 0. yading@10: yading@10: yading@10: =item B<unsafe> yading@10: yading@10: Activate unsafe mode: do not fail if segments have a different format. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: The filter has I<v>+I<a> outputs: first I<v> video outputs, then yading@10: I<a> audio outputs. yading@10: yading@10: There are I<n>x(I<v>+I<a>) inputs: first the inputs for the first yading@10: segment, in the same order as the outputs, then the inputs for the second yading@10: segment, etc. yading@10: yading@10: Related streams do not always have exactly the same duration, for various yading@10: reasons including codec frame size or sloppy authoring. For that reason, yading@10: related synchronized streams (e.g. a video and its audio track) should be yading@10: concatenated at once. The concat filter will use the duration of the longest yading@10: stream in each segment (except the last one), and if necessary pad shorter yading@10: audio streams with silence. yading@10: yading@10: For this filter to work correctly, all segments must start at timestamp 0. yading@10: yading@10: All corresponding streams must have the same parameters in all segments; the yading@10: filtering system will automatically select a common pixel format for video yading@10: streams, and a common sample format, sample rate and channel layout for yading@10: audio streams, but other settings, such as resolution, must be converted yading@10: explicitly by the user. yading@10: yading@10: Different frame rates are acceptable but will result in variable frame rate yading@10: at output; be sure to configure the output file to handle it. yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Concatenate an opening, an episode and an ending, all in bilingual version yading@10: (video in stream 0, audio in streams 1 and 2): yading@10: yading@10: ffmpeg -i opening.mkv -i episode.mkv -i ending.mkv -filter_complex \ yading@10: '[0:0] [0:1] [0:2] [1:0] [1:1] [1:2] [2:0] [2:1] [2:2] yading@10: concat=n=3:v=1:a=2 [v] [a1] [a2]' \ yading@10: -map '[v]' -map '[a1]' -map '[a2]' output.mkv yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Concatenate two parts, handling audio and video separately, using the yading@10: (a)movie sources, and adjusting the resolution: yading@10: yading@10: movie=part1.mp4, scale=512:288 [v1] ; amovie=part1.mp4 [a1] ; yading@10: movie=part2.mp4, scale=512:288 [v2] ; amovie=part2.mp4 [a2] ; yading@10: [v1] [v2] concat [outv] ; [a1] [a2] concat=v=0:a=1 [outa] yading@10: yading@10: Note that a desync will happen at the stitch if the audio and video streams yading@10: do not have exactly the same duration in the first file. yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 showspectrum yading@10: yading@10: yading@10: Convert input audio to a video output, representing the audio frequency yading@10: spectrum. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<size, s> yading@10: yading@10: Specify the video size for the output. Default value is C<640x512>. yading@10: yading@10: yading@10: =item B<slide> yading@10: yading@10: Specify if the spectrum should slide along the window. Default value is yading@10: C<0>. yading@10: yading@10: yading@10: =item B<mode> yading@10: yading@10: Specify display mode. yading@10: yading@10: It accepts the following values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<combined> yading@10: yading@10: all channels are displayed in the same row yading@10: yading@10: =item B<separate> yading@10: yading@10: all channels are displayed in separate rows yading@10: yading@10: =back yading@10: yading@10: yading@10: Default value is B<combined>. yading@10: yading@10: yading@10: =item B<color> yading@10: yading@10: Specify display color mode. yading@10: yading@10: It accepts the following values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<channel> yading@10: yading@10: each channel is displayed in a separate color yading@10: yading@10: =item B<intensity> yading@10: yading@10: each channel is is displayed using the same color scheme yading@10: yading@10: =back yading@10: yading@10: yading@10: Default value is B<channel>. yading@10: yading@10: yading@10: =item B<scale> yading@10: yading@10: Specify scale used for calculating intensity color values. yading@10: yading@10: It accepts the following values: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<lin> yading@10: yading@10: linear yading@10: yading@10: =item B<sqrt> yading@10: yading@10: square root, default yading@10: yading@10: =item B<cbrt> yading@10: yading@10: cubic root yading@10: yading@10: =item B<log> yading@10: yading@10: logarithmic yading@10: yading@10: =back yading@10: yading@10: yading@10: Default value is B<sqrt>. yading@10: yading@10: yading@10: =item B<saturation> yading@10: yading@10: Set saturation modifier for displayed colors. Negative values provide yading@10: alternative color scheme. C<0> is no saturation at all. yading@10: Saturation must be in [-10.0, 10.0] range. yading@10: Default value is C<1>. yading@10: yading@10: =back yading@10: yading@10: yading@10: The usage is very similar to the showwaves filter; see the examples in that yading@10: section. yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Large window with logarithmic color scaling: yading@10: yading@10: showspectrum=s=1280x480:scale=log yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Complete example for a colored and sliding spectrum per channel using B<ffplay>: yading@10: yading@10: ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1]; yading@10: [a] showspectrum=mode=separate:color=intensity:slide=1:scale=cbrt [out0]' yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 showwaves yading@10: yading@10: yading@10: Convert input audio to a video output, representing the samples waves. yading@10: yading@10: The filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<size, s> yading@10: yading@10: Specify the video size for the output. Default value is "600x240". yading@10: yading@10: yading@10: =item B<mode> yading@10: yading@10: Set display mode. yading@10: yading@10: Available values are: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<point> yading@10: yading@10: Draw a point for each sample. yading@10: yading@10: yading@10: =item B<line> yading@10: yading@10: Draw a vertical line for each sample. yading@10: yading@10: =back yading@10: yading@10: yading@10: Default value is C<point>. yading@10: yading@10: yading@10: =item B<n> yading@10: yading@10: Set the number of samples which are printed on the same column. A yading@10: larger value will decrease the frame rate. Must be a positive yading@10: integer. This option can be set only if the value for I<rate> yading@10: is not explicitly specified. yading@10: yading@10: yading@10: =item B<rate, r> yading@10: yading@10: Set the (approximate) output frame rate. This is done by setting the yading@10: option I<n>. Default value is "25". yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Output the input file audio and the corresponding video representation yading@10: at the same time: yading@10: yading@10: amovie=a.mp3,asplit[out0],showwaves[out1] yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Create a synthetic signal and show it with showwaves, forcing a yading@10: frame rate of 30 frames per second: yading@10: yading@10: aevalsrc=sin(1*2*PI*t)*sin(880*2*PI*t):cos(2*PI*200*t),asplit[out0],showwaves=r=30[out1] yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: =head2 split, asplit yading@10: yading@10: yading@10: Split input into several identical outputs. yading@10: yading@10: C<asplit> works with audio input, C<split> with video. yading@10: yading@10: The filter accepts a single parameter which specifies the number of outputs. If yading@10: unspecified, it defaults to 2. yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Create two separate outputs from the same input: yading@10: yading@10: [in] split [out0][out1] yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: To create 3 or more outputs, you need to specify the number of yading@10: outputs, like in: yading@10: yading@10: [in] asplit=3 [out0][out1][out2] yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Create two separate outputs from the same input, one cropped and yading@10: one padded: yading@10: yading@10: [in] split [splitout1][splitout2]; yading@10: [splitout1] crop=100:100:0:0 [cropout]; yading@10: [splitout2] pad=200:200:100:100 [padout]; yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Create 5 copies of the input audio with B<ffmpeg>: yading@10: yading@10: ffmpeg -i INPUT -filter_complex asplit=5 OUTPUT yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: yading@10: =head1 MULTIMEDIA SOURCES yading@10: yading@10: yading@10: Below is a description of the currently available multimedia sources. yading@10: yading@10: yading@10: =head2 amovie yading@10: yading@10: yading@10: This is the same as movie source, except it selects an audio yading@10: stream by default. yading@10: yading@10: yading@10: yading@10: =head2 movie yading@10: yading@10: yading@10: Read audio and/or video stream(s) from a movie container. yading@10: yading@10: This filter accepts the following options: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item B<filename> yading@10: yading@10: The name of the resource to read (not necessarily a file but also a device or a yading@10: stream accessed through some protocol). yading@10: yading@10: yading@10: =item B<format_name, f> yading@10: yading@10: Specifies the format assumed for the movie to read, and can be either yading@10: the name of a container or an input device. If not specified the yading@10: format is guessed from I<movie_name> or by probing. yading@10: yading@10: yading@10: =item B<seek_point, sp> yading@10: yading@10: Specifies the seek point in seconds, the frames will be output yading@10: starting from this seek point, the parameter is evaluated with yading@10: C<av_strtod> so the numerical value may be suffixed by an IS yading@10: postfix. Default value is "0". yading@10: yading@10: yading@10: =item B<streams, s> yading@10: yading@10: Specifies the streams to read. Several streams can be specified, yading@10: separated by "+". The source will then have as many outputs, in the yading@10: same order. The syntax is explained in the ``Stream specifiers'' yading@10: section in the ffmpeg manual. Two special names, "dv" and "da" specify yading@10: respectively the default (best suited) video and audio stream. Default yading@10: is "dv", or "da" if the filter is called as "amovie". yading@10: yading@10: yading@10: =item B<stream_index, si> yading@10: yading@10: Specifies the index of the video stream to read. If the value is -1, yading@10: the best suited video stream will be automatically selected. Default yading@10: value is "-1". Deprecated. If the filter is called "amovie", it will select yading@10: audio instead of video. yading@10: yading@10: yading@10: =item B<loop> yading@10: yading@10: Specifies how many times to read the stream in sequence. yading@10: If the value is less than 1, the stream will be read again and again. yading@10: Default value is "1". yading@10: yading@10: Note that when the movie is looped the source timestamps are not yading@10: changed, so it will generate non monotonically increasing timestamps. yading@10: yading@10: =back yading@10: yading@10: yading@10: This filter allows to overlay a second video on top of main input of yading@10: a filtergraph as shown in this graph: yading@10: yading@10: input -----------> deltapts0 --> overlay --> output yading@10: ^ yading@10: | yading@10: movie --> scale--> deltapts1 -------+ yading@10: yading@10: yading@10: yading@10: =head3 Examples yading@10: yading@10: yading@10: yading@10: =over 4 yading@10: yading@10: yading@10: =item * yading@10: yading@10: Skip 3.2 seconds from the start of the avi file in.avi, and overlay it yading@10: on top of the input labelled as "in": yading@10: yading@10: movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [over]; yading@10: [in] setpts=PTS-STARTPTS [main]; yading@10: [main][over] overlay=16:16 [out] yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Read from a video4linux2 device, and overlay it on top of the input yading@10: labelled as "in": yading@10: yading@10: movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [over]; yading@10: [in] setpts=PTS-STARTPTS [main]; yading@10: [main][over] overlay=16:16 [out] yading@10: yading@10: yading@10: yading@10: =item * yading@10: yading@10: Read the first video stream and the audio stream with id 0x81 from yading@10: dvd.vob; the video is connected to the pad named "video" and the audio is yading@10: connected to the pad named "audio": yading@10: yading@10: movie=dvd.vob:s=v:0+#0x81 [video] [audio] yading@10: yading@10: yading@10: =back yading@10: yading@10: yading@10: yading@10: yading@10: =head1 SEE ALSO yading@10: yading@10: yading@10: yading@10: ffprobe(1), yading@10: ffmpeg(1), ffplay(1), ffserver(1), yading@10: ffmpeg-utils(1), ffmpeg-scaler(1), ffmpeg-resampler(1), yading@10: ffmpeg-codecs(1), ffmpeg-bitstream-filters(1), ffmpeg-formats(1), yading@10: ffmpeg-devices(1), ffmpeg-protocols(1), ffmpeg-filters(1) yading@10: yading@10: yading@10: =head1 AUTHORS yading@10: yading@10: yading@10: The FFmpeg developers. yading@10: yading@10: For details about the authorship, see the Git history of the project yading@10: (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command yading@10: B<git log> in the FFmpeg source directory, or browsing the yading@10: online repository at E<lt>B<http://source.ffmpeg.org>E<gt>. yading@10: yading@10: Maintainers for the specific components are listed in the file yading@10: F<MAINTAINERS> in the source code tree. yading@10: yading@10: yading@10: