]> git.sesse.net Git - ffmpeg/blob - doc/avtools-common-opts.texi
Merge commit '6647aa0426e73839b9b1d1c9d86188f469167531'
[ffmpeg] / doc / avtools-common-opts.texi
1 All the numerical options, if not specified otherwise, accept a string
2 representing a number as input, which may be followed by one of the SI
3 unit prefixes, for example: 'K', 'M', or 'G'.
4
5 If 'i' is appended to the SI unit prefix, the complete prefix will be
6 interpreted as a unit prefix for binary multiplies, which are based on
7 powers of 1024 instead of powers of 1000. Appending 'B' to the SI unit
8 prefix multiplies the value by 8. This allows using, for example:
9 'KB', 'MiB', 'G' and 'B' as number suffixes.
10
11 Options which do not take arguments are boolean options, and set the
12 corresponding value to true. They can be set to false by prefixing
13 the option name with "no". For example using "-nofoo"
14 will set the boolean option with name "foo" to false.
15
16 @anchor{Stream specifiers}
17 @section Stream specifiers
18 Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers
19 are used to precisely specify which stream(s) a given option belongs to.
20
21 A stream specifier is a string generally appended to the option name and
22 separated from it by a colon. E.g. @code{-codec:a:1 ac3} contains the
23 @code{a:1} stream specifier, which matches the second audio stream. Therefore, it
24 would select the ac3 codec for the second audio stream.
25
26 A stream specifier can match several streams, so that the option is applied to all
27 of them. E.g. the stream specifier in @code{-b:a 128k} matches all audio
28 streams.
29
30 An empty stream specifier matches all streams. For example, @code{-codec copy}
31 or @code{-codec: copy} would copy all the streams without reencoding.
32
33 Possible forms of stream specifiers are:
34 @table @option
35 @item @var{stream_index}
36 Matches the stream with this index. E.g. @code{-threads:1 4} would set the
37 thread count for the second stream to 4.
38 @item @var{stream_type}[:@var{stream_index}]
39 @var{stream_type} is one of following: 'v' for video, 'a' for audio, 's' for subtitle,
40 'd' for data, and 't' for attachments. If @var{stream_index} is given, then it matches
41 stream number @var{stream_index} of this type. Otherwise, it matches all
42 streams of this type.
43 @item p:@var{program_id}[:@var{stream_index}]
44 If @var{stream_index} is given, then it matches the stream with number @var{stream_index}
45 in the program with the id @var{program_id}. Otherwise, it matches all streams in the
46 program.
47 @item #@var{stream_id}
48 Matches the stream by a format-specific ID.
49 @end table
50
51 @section Generic options
52
53 These options are shared amongst the ff* tools.
54
55 @table @option
56
57 @item -L
58 Show license.
59
60 @item -h, -?, -help, --help [@var{arg}]
61 Show help. An optional parameter may be specified to print help about a specific
62 item.
63
64 Possible values of @var{arg} are:
65 @table @option
66 @item decoder=@var{decoder_name}
67 Print detailed information about the decoder named @var{decoder_name}. Use the
68 @option{-decoders} option to get a list of all decoders.
69
70 @item encoder=@var{encoder_name}
71 Print detailed information about the encoder named @var{encoder_name}. Use the
72 @option{-encoders} option to get a list of all encoders.
73
74 @item demuxer=@var{demuxer_name}
75 Print detailed information about the demuxer named @var{demuxer_name}. Use the
76 @option{-formats} option to get a list of all demuxers and muxers.
77
78 @item muxer=@var{muxer_name}
79 Print detailed information about the muxer named @var{muxer_name}. Use the
80 @option{-formats} option to get a list of all muxers and demuxers.
81
82 @item filter=@var{filter_name}
83 Print detailed information about the filter name @var{filter_name}. Use the
84 @option{-filters} option to get a list of all filters.
85
86 @end table
87
88 @item -version
89 Show version.
90
91 @item -formats
92 Show available formats.
93
94 @item -codecs
95 Show all codecs known to libavcodec.
96
97 Note that the term 'codec' is used throughout this documentation as a shortcut
98 for what is more correctly called a media bitstream format.
99
100 @item -decoders
101 Show available decoders.
102
103 @item -encoders
104 Show all available encoders.
105
106 @item -bsfs
107 Show available bitstream filters.
108
109 @item -protocols
110 Show available protocols.
111
112 @item -filters
113 Show available libavfilter filters.
114
115 @item -pix_fmts
116 Show available pixel formats.
117
118 @item -sample_fmts
119 Show available sample formats.
120
121 @item -layouts
122 Show channel names and standard channel layouts.
123
124 @item -loglevel [repeat+]@var{loglevel} | -v [repeat+]@var{loglevel}
125 Set the logging level used by the library.
126 Adding "repeat+" indicates that repeated log output should not be compressed
127 to the first line and the "Last message repeated n times" line will be
128 omitted. "repeat" can also be used alone.
129 If "repeat" is used alone, and with no prior loglevel set, the default
130 loglevel will be used. If multiple loglevel parameters are given, using
131 'repeat' will not change the loglevel.
132 @var{loglevel} is a number or a string containing one of the following values:
133 @table @samp
134 @item quiet
135 Show nothing at all; be silent.
136 @item panic
137 Only show fatal errors which could lead the process to crash, such as
138 and assert failure. This is not currently used for anything.
139 @item fatal
140 Only show fatal errors. These are errors after which the process absolutely
141 cannot continue after.
142 @item error
143 Show all errors, including ones which can be recovered from.
144 @item warning
145 Show all warnings and errors. Any message related to possibly
146 incorrect or unexpected events will be shown.
147 @item info
148 Show informative messages during processing. This is in addition to
149 warnings and errors. This is the default value.
150 @item verbose
151 Same as @code{info}, except more verbose.
152 @item debug
153 Show everything, including debugging information.
154 @end table
155
156 By default the program logs to stderr, if coloring is supported by the
157 terminal, colors are used to mark errors and warnings. Log coloring
158 can be disabled setting the environment variable
159 @env{AV_LOG_FORCE_NOCOLOR} or @env{NO_COLOR}, or can be forced setting
160 the environment variable @env{AV_LOG_FORCE_COLOR}.
161 The use of the environment variable @env{NO_COLOR} is deprecated and
162 will be dropped in a following FFmpeg version.
163
164 @item -report
165 Dump full command line and console output to a file named
166 @code{@var{program}-@var{YYYYMMDD}-@var{HHMMSS}.log} in the current
167 directory.
168 This file can be useful for bug reports.
169 It also implies @code{-loglevel verbose}.
170
171 Setting the environment variable @code{FFREPORT} to any value has the
172 same effect. If the value is a ':'-separated key=value sequence, these
173 options will affect the report; options values must be escaped if they
174 contain special characters or the options delimiter ':' (see the
175 ``Quoting and escaping'' section in the ffmpeg-utils manual). The
176 following option is recognized:
177 @table @option
178 @item file
179 set the file name to use for the report; @code{%p} is expanded to the name
180 of the program, @code{%t} is expanded to a timestamp, @code{%%} is expanded
181 to a plain @code{%}
182 @end table
183
184 Errors in parsing the environment variable are not fatal, and will not
185 appear in the report.
186
187 @item -cpuflags flags (@emph{global})
188 Allows setting and clearing cpu flags. This option is intended
189 for testing. Do not use it unless you know what you're doing.
190 @example
191 ffmpeg -cpuflags -sse+mmx ...
192 ffmpeg -cpuflags mmx ...
193 ffmpeg -cpuflags 0 ...
194 @end example
195 Possible flags for this option are:
196 @table @samp
197 @item x86
198 @table @samp
199 @item mmx
200 @item mmxext
201 @item sse
202 @item sse2
203 @item sse2slow
204 @item sse3
205 @item sse3slow
206 @item ssse3
207 @item atom
208 @item sse4.1
209 @item sse4.2
210 @item avx
211 @item xop
212 @item fma4
213 @item 3dnow
214 @item 3dnowext
215 @item cmov
216 @end table
217 @item ARM
218 @table @samp
219 @item armv5te
220 @item armv6
221 @item armv6t2
222 @item vfp
223 @item vfpv3
224 @item neon
225 @end table
226 @item PowerPC
227 @table @samp
228 @item altivec
229 @end table
230 @item Specific Processors
231 @table @samp
232 @item pentium2
233 @item pentium3
234 @item pentium4
235 @item k6
236 @item k62
237 @item athlon
238 @item athlonxp
239 @item k8
240 @end table
241 @end table
242
243 @item -opencl_options options (@emph{global})
244 Set OpenCL environment options. This option is only available when
245 FFmpeg has been compiled with @code{--enable-opencl}.
246
247 @var{options} must be a list of @var{key}=@var{value} option pairs
248 separated by ':'. See the ``OpenCL Options'' section in the
249 ffmpeg-utils manual for the list of supported options.
250 @end table
251
252 @section AVOptions
253
254 These options are provided directly by the libavformat, libavdevice and
255 libavcodec libraries. To see the list of available AVOptions, use the
256 @option{-help} option. They are separated into two categories:
257 @table @option
258 @item generic
259 These options can be set for any container, codec or device. Generic options
260 are listed under AVFormatContext options for containers/devices and under
261 AVCodecContext options for codecs.
262 @item private
263 These options are specific to the given container, device or codec. Private
264 options are listed under their corresponding containers/devices/codecs.
265 @end table
266
267 For example to write an ID3v2.3 header instead of a default ID3v2.4 to
268 an MP3 file, use the @option{id3v2_version} private option of the MP3
269 muxer:
270 @example
271 ffmpeg -i input.flac -id3v2_version 3 out.mp3
272 @end example
273
274 All codec AVOptions are obviously per-stream, so the chapter on stream
275 specifiers applies to them
276
277 Note @option{-nooption} syntax cannot be used for boolean AVOptions,
278 use @option{-option 0}/@option{-option 1}.
279
280 Note2 old undocumented way of specifying per-stream AVOptions by prepending
281 v/a/s to the options name is now obsolete and will be removed soon.