OSDN Git Service

[DOC] Update ffmpeg3.0.2's docs.
[csp-qt/common_source_project-fm7.git] / doc / ffmpeg-3.0.2 / fftools-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 multiples, 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' or 'V' for video, 'a' for audio, 's'
40 for subtitle, 'd' for data, and 't' for attachments. 'v' matches all video
41 streams, 'V' only matches video streams which are not attached pictures, video
42 thumbnails or cover arts.  If @var{stream_index} is given, then it matches
43 stream number @var{stream_index} of this type. Otherwise, it matches all
44 streams of this type.
45 @item p:@var{program_id}[:@var{stream_index}]
46 If @var{stream_index} is given, then it matches the stream with number @var{stream_index}
47 in the program with the id @var{program_id}. Otherwise, it matches all streams in the
48 program.
49 @item #@var{stream_id} or i:@var{stream_id}
50 Match the stream by stream id (e.g. PID in MPEG-TS container).
51 @item m:@var{key}[:@var{value}]
52 Matches streams with the metadata tag @var{key} having the specified value. If
53 @var{value} is not given, matches streams that contain the given tag with any
54 value.
55 @item u
56 Matches streams with usable configuration, the codec must be defined and the
57 essential information such as video dimension or audio sample rate must be present.
58
59 Note that in @command{ffmpeg}, matching by metadata will only work properly for
60 input files.
61 @end table
62
63 @section Generic options
64
65 These options are shared amongst the ff* tools.
66
67 @table @option
68
69 @item -L
70 Show license.
71
72 @item -h, -?, -help, --help [@var{arg}]
73 Show help. An optional parameter may be specified to print help about a specific
74 item. If no argument is specified, only basic (non advanced) tool
75 options are shown.
76
77 Possible values of @var{arg} are:
78 @table @option
79 @item long
80 Print advanced tool options in addition to the basic tool options.
81
82 @item full
83 Print complete list of options, including shared and private options
84 for encoders, decoders, demuxers, muxers, filters, etc.
85
86 @item decoder=@var{decoder_name}
87 Print detailed information about the decoder named @var{decoder_name}. Use the
88 @option{-decoders} option to get a list of all decoders.
89
90 @item encoder=@var{encoder_name}
91 Print detailed information about the encoder named @var{encoder_name}. Use the
92 @option{-encoders} option to get a list of all encoders.
93
94 @item demuxer=@var{demuxer_name}
95 Print detailed information about the demuxer named @var{demuxer_name}. Use the
96 @option{-formats} option to get a list of all demuxers and muxers.
97
98 @item muxer=@var{muxer_name}
99 Print detailed information about the muxer named @var{muxer_name}. Use the
100 @option{-formats} option to get a list of all muxers and demuxers.
101
102 @item filter=@var{filter_name}
103 Print detailed information about the filter name @var{filter_name}. Use the
104 @option{-filters} option to get a list of all filters.
105 @end table
106
107 @item -version
108 Show version.
109
110 @item -formats
111 Show available formats (including devices).
112
113 @item -devices
114 Show available devices.
115
116 @item -codecs
117 Show all codecs known to libavcodec.
118
119 Note that the term 'codec' is used throughout this documentation as a shortcut
120 for what is more correctly called a media bitstream format.
121
122 @item -decoders
123 Show available decoders.
124
125 @item -encoders
126 Show all available encoders.
127
128 @item -bsfs
129 Show available bitstream filters.
130
131 @item -protocols
132 Show available protocols.
133
134 @item -filters
135 Show available libavfilter filters.
136
137 @item -pix_fmts
138 Show available pixel formats.
139
140 @item -sample_fmts
141 Show available sample formats.
142
143 @item -layouts
144 Show channel names and standard channel layouts.
145
146 @item -colors
147 Show recognized color names.
148
149 @item -sources @var{device}[,@var{opt1}=@var{val1}[,@var{opt2}=@var{val2}]...]
150 Show autodetected sources of the intput device.
151 Some devices may provide system-dependent source names that cannot be autodetected.
152 The returned list cannot be assumed to be always complete.
153 @example
154 ffmpeg -sources pulse,server=192.168.0.4
155 @end example
156
157 @item -sinks @var{device}[,@var{opt1}=@var{val1}[,@var{opt2}=@var{val2}]...]
158 Show autodetected sinks of the output device.
159 Some devices may provide system-dependent sink names that cannot be autodetected.
160 The returned list cannot be assumed to be always complete.
161 @example
162 ffmpeg -sinks pulse,server=192.168.0.4
163 @end example
164
165 @item -loglevel [repeat+]@var{loglevel} | -v [repeat+]@var{loglevel}
166 Set the logging level used by the library.
167 Adding "repeat+" indicates that repeated log output should not be compressed
168 to the first line and the "Last message repeated n times" line will be
169 omitted. "repeat" can also be used alone.
170 If "repeat" is used alone, and with no prior loglevel set, the default
171 loglevel will be used. If multiple loglevel parameters are given, using
172 'repeat' will not change the loglevel.
173 @var{loglevel} is a string or a number containing one of the following values:
174 @table @samp
175 @item quiet, -8
176 Show nothing at all; be silent.
177 @item panic, 0
178 Only show fatal errors which could lead the process to crash, such as
179 and assert failure. This is not currently used for anything.
180 @item fatal, 8
181 Only show fatal errors. These are errors after which the process absolutely
182 cannot continue after.
183 @item error, 16
184 Show all errors, including ones which can be recovered from.
185 @item warning, 24
186 Show all warnings and errors. Any message related to possibly
187 incorrect or unexpected events will be shown.
188 @item info, 32
189 Show informative messages during processing. This is in addition to
190 warnings and errors. This is the default value.
191 @item verbose, 40
192 Same as @code{info}, except more verbose.
193 @item debug, 48
194 Show everything, including debugging information.
195 @item trace, 56
196 @end table
197
198 By default the program logs to stderr, if coloring is supported by the
199 terminal, colors are used to mark errors and warnings. Log coloring
200 can be disabled setting the environment variable
201 @env{AV_LOG_FORCE_NOCOLOR} or @env{NO_COLOR}, or can be forced setting
202 the environment variable @env{AV_LOG_FORCE_COLOR}.
203 The use of the environment variable @env{NO_COLOR} is deprecated and
204 will be dropped in a following FFmpeg version.
205
206 @item -report
207 Dump full command line and console output to a file named
208 @code{@var{program}-@var{YYYYMMDD}-@var{HHMMSS}.log} in the current
209 directory.
210 This file can be useful for bug reports.
211 It also implies @code{-loglevel verbose}.
212
213 Setting the environment variable @env{FFREPORT} to any value has the
214 same effect. If the value is a ':'-separated key=value sequence, these
215 options will affect the report; option values must be escaped if they
216 contain special characters or the options delimiter ':' (see the
217 ``Quoting and escaping'' section in the ffmpeg-utils manual).
218
219 The following options are recognized:
220 @table @option
221 @item file
222 set the file name to use for the report; @code{%p} is expanded to the name
223 of the program, @code{%t} is expanded to a timestamp, @code{%%} is expanded
224 to a plain @code{%}
225 @item level
226 set the log verbosity level using a numerical value (see @code{-loglevel}).
227 @end table
228
229 For example, to output a report to a file named @file{ffreport.log}
230 using a log level of @code{32} (alias for log level @code{info}):
231
232 @example
233 FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output
234 @end example
235
236 Errors in parsing the environment variable are not fatal, and will not
237 appear in the report.
238
239 @item -hide_banner
240 Suppress printing banner.
241
242 All FFmpeg tools will normally show a copyright notice, build options
243 and library versions. This option can be used to suppress printing
244 this information.
245
246 @item -cpuflags flags (@emph{global})
247 Allows setting and clearing cpu flags. This option is intended
248 for testing. Do not use it unless you know what you're doing.
249 @example
250 ffmpeg -cpuflags -sse+mmx ...
251 ffmpeg -cpuflags mmx ...
252 ffmpeg -cpuflags 0 ...
253 @end example
254 Possible flags for this option are:
255 @table @samp
256 @item x86
257 @table @samp
258 @item mmx
259 @item mmxext
260 @item sse
261 @item sse2
262 @item sse2slow
263 @item sse3
264 @item sse3slow
265 @item ssse3
266 @item atom
267 @item sse4.1
268 @item sse4.2
269 @item avx
270 @item avx2
271 @item xop
272 @item fma3
273 @item fma4
274 @item 3dnow
275 @item 3dnowext
276 @item bmi1
277 @item bmi2
278 @item cmov
279 @end table
280 @item ARM
281 @table @samp
282 @item armv5te
283 @item armv6
284 @item armv6t2
285 @item vfp
286 @item vfpv3
287 @item neon
288 @item setend
289 @end table
290 @item AArch64
291 @table @samp
292 @item armv8
293 @item vfp
294 @item neon
295 @end table
296 @item PowerPC
297 @table @samp
298 @item altivec
299 @end table
300 @item Specific Processors
301 @table @samp
302 @item pentium2
303 @item pentium3
304 @item pentium4
305 @item k6
306 @item k62
307 @item athlon
308 @item athlonxp
309 @item k8
310 @end table
311 @end table
312
313 @item -opencl_bench
314 This option is used to benchmark all available OpenCL devices and print the
315 results. This option is only available when FFmpeg has been compiled with
316 @code{--enable-opencl}.
317
318 When FFmpeg is configured with @code{--enable-opencl}, the options for the
319 global OpenCL context are set via @option{-opencl_options}. See the
320 "OpenCL Options" section in the ffmpeg-utils manual for the complete list of
321 supported options. Amongst others, these options include the ability to select
322 a specific platform and device to run the OpenCL code on. By default, FFmpeg
323 will run on the first device of the first platform. While the options for the
324 global OpenCL context provide flexibility to the user in selecting the OpenCL
325 device of their choice, most users would probably want to select the fastest
326 OpenCL device for their system.
327
328 This option assists the selection of the most efficient configuration by
329 identifying the appropriate device for the user's system. The built-in
330 benchmark is run on all the OpenCL devices and the performance is measured for
331 each device. The devices in the results list are sorted based on their
332 performance with the fastest device listed first. The user can subsequently
333 invoke @command{ffmpeg} using the device deemed most appropriate via
334 @option{-opencl_options} to obtain the best performance for the OpenCL
335 accelerated code.
336
337 Typical usage to use the fastest OpenCL device involve the following steps.
338
339 Run the command:
340 @example
341 ffmpeg -opencl_bench
342 @end example
343 Note down the platform ID (@var{pidx}) and device ID (@var{didx}) of the first
344 i.e. fastest device in the list.
345 Select the platform and device using the command:
346 @example
347 ffmpeg -opencl_options platform_idx=@var{pidx}:device_idx=@var{didx} ...
348 @end example
349
350 @item -opencl_options options (@emph{global})
351 Set OpenCL environment options. This option is only available when
352 FFmpeg has been compiled with @code{--enable-opencl}.
353
354 @var{options} must be a list of @var{key}=@var{value} option pairs
355 separated by ':'. See the ``OpenCL Options'' section in the
356 ffmpeg-utils manual for the list of supported options.
357 @end table
358
359 @section AVOptions
360
361 These options are provided directly by the libavformat, libavdevice and
362 libavcodec libraries. To see the list of available AVOptions, use the
363 @option{-help} option. They are separated into two categories:
364 @table @option
365 @item generic
366 These options can be set for any container, codec or device. Generic options
367 are listed under AVFormatContext options for containers/devices and under
368 AVCodecContext options for codecs.
369 @item private
370 These options are specific to the given container, device or codec. Private
371 options are listed under their corresponding containers/devices/codecs.
372 @end table
373
374 For example to write an ID3v2.3 header instead of a default ID3v2.4 to
375 an MP3 file, use the @option{id3v2_version} private option of the MP3
376 muxer:
377 @example
378 ffmpeg -i input.flac -id3v2_version 3 out.mp3
379 @end example
380
381 All codec AVOptions are per-stream, and thus a stream specifier
382 should be attached to them.
383
384 Note: the @option{-nooption} syntax cannot be used for boolean
385 AVOptions, use @option{-option 0}/@option{-option 1}.
386
387 Note: the old undocumented way of specifying per-stream AVOptions by
388 prepending v/a/s to the options name is now obsolete and will be
389 removed soon.