]> git.sesse.net Git - ffmpeg/blob - doc/avtools-common-opts.texi
Merge commit 'ed16c2dbf47cdd7c48825b4da6e7036698e5dde1'
[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 @end table
83
84 @item -version
85 Show version.
86
87 @item -formats
88 Show available formats.
89
90 @item -codecs
91 Show all codecs known to libavcodec.
92
93 Note that the term 'codec' is used throughout this documentation as a shortcut
94 for what is more correctly called a media bitstream format.
95
96 @item -decoders
97 Show available decoders.
98
99 @item -encoders
100 Show all available encoders.
101
102 @item -bsfs
103 Show available bitstream filters.
104
105 @item -protocols
106 Show available protocols.
107
108 @item -filters
109 Show available libavfilter filters.
110
111 @item -pix_fmts
112 Show available pixel formats.
113
114 @item -sample_fmts
115 Show available sample formats.
116
117 @item -layouts
118 Show channel names and standard channel layouts.
119
120 @item -loglevel [repeat+]@var{loglevel} | -v [repeat+]@var{loglevel}
121 Set the logging level used by the library.
122 Adding "repeat+" indicates that repeated log output should not be compressed
123 to the first line and the "Last message repeated n times" line will be
124 omitted. "repeat" can also be used alone.
125 If "repeat" is used alone, and with no prior loglevel set, the default
126 loglevel will be used. If multiple loglevel parameters are given, using
127 'repeat' will not change the loglevel.
128 @var{loglevel} is a number or a string containing one of the following values:
129 @table @samp
130 @item quiet
131 Show nothing at all; be silent.
132 @item panic
133 Only show fatal errors which could lead the process to crash, such as
134 and assert failure. This is not currently used for anything.
135 @item fatal
136 Only show fatal errors. These are errors after which the process absolutely
137 cannot continue after.
138 @item error
139 Show all errors, including ones which can be recovered from.
140 @item warning
141 Show all warnings and errors. Any message related to possibly
142 incorrect or unexpected events will be shown.
143 @item info
144 Show informative messages during processing. This is in addition to
145 warnings and errors. This is the default value.
146 @item verbose
147 Same as @code{info}, except more verbose.
148 @item debug
149 Show everything, including debugging information.
150 @end table
151
152 By default the program logs to stderr, if coloring is supported by the
153 terminal, colors are used to mark errors and warnings. Log coloring
154 can be disabled setting the environment variable
155 @env{AV_LOG_FORCE_NOCOLOR} or @env{NO_COLOR}, or can be forced setting
156 the environment variable @env{AV_LOG_FORCE_COLOR}.
157 The use of the environment variable @env{NO_COLOR} is deprecated and
158 will be dropped in a following FFmpeg version.
159
160 @item -report
161 Dump full command line and console output to a file named
162 @code{@var{program}-@var{YYYYMMDD}-@var{HHMMSS}.log} in the current
163 directory.
164 This file can be useful for bug reports.
165 It also implies @code{-loglevel verbose}.
166
167 Setting the environment variable @code{FFREPORT} to any value has the
168 same effect. If the value is a ':'-separated key=value sequence, these
169 options will affect the report; options values must be escaped if they
170 contain special characters or the options delimiter ':' (see the
171 ``Quoting and escaping'' section in the ffmpeg-utils manual). The
172 following option is recognized:
173 @table @option
174 @item file
175 set the file name to use for the report; @code{%p} is expanded to the name
176 of the program, @code{%t} is expanded to a timestamp, @code{%%} is expanded
177 to a plain @code{%}
178 @end table
179
180 Errors in parsing the environment variable are not fatal, and will not
181 appear in the report.
182
183 @item -cpuflags flags (@emph{global})
184 Allows setting and clearing cpu flags. This option is intended
185 for testing. Do not use it unless you know what you're doing.
186 @example
187 ffmpeg -cpuflags -sse+mmx ...
188 ffmpeg -cpuflags mmx ...
189 ffmpeg -cpuflags 0 ...
190 @end example
191 Possible flags for this option are:
192 @table @samp
193 @item x86
194 @table @samp
195 @item mmx
196 @item mmxext
197 @item sse
198 @item sse2
199 @item sse2slow
200 @item sse3
201 @item sse3slow
202 @item ssse3
203 @item atom
204 @item sse4.1
205 @item sse4.2
206 @item avx
207 @item xop
208 @item fma4
209 @item 3dnow
210 @item 3dnowext
211 @item cmov
212 @end table
213 @item ARM
214 @table @samp
215 @item armv5te
216 @item armv6
217 @item armv6t2
218 @item vfp
219 @item vfpv3
220 @item neon
221 @end table
222 @item PowerPC
223 @table @samp
224 @item altivec
225 @end table
226 @item Specific Processors
227 @table @samp
228 @item pentium2
229 @item pentium3
230 @item pentium4
231 @item k6
232 @item k62
233 @item athlon
234 @item athlonxp
235 @item k8
236 @end table
237 @end table
238
239 @end table
240
241 @section AVOptions
242
243 These options are provided directly by the libavformat, libavdevice and
244 libavcodec libraries. To see the list of available AVOptions, use the
245 @option{-help} option. They are separated into two categories:
246 @table @option
247 @item generic
248 These options can be set for any container, codec or device. Generic options
249 are listed under AVFormatContext options for containers/devices and under
250 AVCodecContext options for codecs.
251 @item private
252 These options are specific to the given container, device or codec. Private
253 options are listed under their corresponding containers/devices/codecs.
254 @end table
255
256 For example to write an ID3v2.3 header instead of a default ID3v2.4 to
257 an MP3 file, use the @option{id3v2_version} private option of the MP3
258 muxer:
259 @example
260 ffmpeg -i input.flac -id3v2_version 3 out.mp3
261 @end example
262
263 All codec AVOptions are obviously per-stream, so the chapter on stream
264 specifiers applies to them
265
266 Note @option{-nooption} syntax cannot be used for boolean AVOptions,
267 use @option{-option 0}/@option{-option 1}.
268
269 Note2 old undocumented way of specifying per-stream AVOptions by prepending
270 v/a/s to the options name is now obsolete and will be removed soon.