4 This section documents the syntax and formats employed by the FFmpeg
7 @anchor{quoting_and_escaping}
8 @section Quoting and escaping
10 FFmpeg adopts the following quoting and escaping mechanism, unless
11 explicitly specified. The following rules are applied:
15 @code{'} and @code{\} are special characters (respectively used for
16 quoting and escaping). In addition to them, there might be other
17 special characters depending on the specific syntax where the escaping
18 and quoting are employed.
21 A special character is escaped by prefixing it with a '\'.
24 All characters enclosed between '' are included literally in the
25 parsed string. The quote character @code{'} itself cannot be quoted,
26 so you may need to close the quote and escape it.
29 Leading and trailing whitespaces, unless escaped or quoted, are
30 removed from the parsed string.
33 Note that you may need to add a second level of escaping when using
34 the command line or a script, which depends on the syntax of the
35 adopted shell language.
37 The function @code{av_get_token} defined in
38 @file{libavutil/avstring.h} can be used to parse a token quoted or
39 escaped according to the rules defined above.
41 The tool @file{tools/ffescape} in the FFmpeg source tree can be used
42 to automatically quote or escape a string in a script.
48 Escape the string @code{Crime d'Amour} containing the @code{'} special
55 The string above contains a quote, so the @code{'} needs to be escaped
62 Include leading or trailing whitespaces using quoting:
64 ' this string starts and ends with whitespaces '
68 Escaping and quoting can be mixed together:
70 ' The string '\'string\'' is a string '
74 To include a literal @code{\} you can use either escaping or quoting:
76 'c:\foo' can be written as c:\\foo
83 The accepted syntax is:
85 [(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...]]])|(HHMMSS[.m...]]]))[Z]
89 If the value is "now" it takes the current time.
91 Time is local time unless Z is appended, in which case it is
93 If the year-month-day part is not specified it takes the current
96 @anchor{time duration syntax}
97 @section Time duration
99 The accepted syntax is:
105 @var{HH} expresses the number of hours, @var{MM} the number a of minutes
106 and @var{SS} the number of seconds.
108 @anchor{video size syntax}
110 Specify the size of the sourced video, it may be a string of the form
111 @var{width}x@var{height}, or the name of a size abbreviation.
113 The following abbreviations are recognized:
203 @anchor{video rate syntax}
206 Specify the frame rate of a video, expressed as the number of frames
207 generated per second. It has to be a string in the format
208 @var{frame_rate_num}/@var{frame_rate_den}, an integer number, a float
209 number or a valid video frame rate abbreviation.
211 The following abbreviations are recognized:
231 @anchor{ratio syntax}
234 A ratio can be expressed as an expression, or in the form
235 @var{numerator}:@var{denominator}.
237 Note that a ratio with infinite (1/0) or negative value is
238 considered valid, so you should check on the returned value if you
239 want to exclude those values.
241 The undefined value can be expressed using the "0:0" string.
243 @anchor{color syntax}
246 It can be the name of a color (case insensitive match) or a
247 [0x|#]RRGGBB[AA] sequence, possibly followed by "@@" and a string
248 representing the alpha component.
250 The alpha component may be a string composed by "0x" followed by an
251 hexadecimal number or a decimal number between 0.0 and 1.0, which
252 represents the opacity value (0x00/0.0 means completely transparent,
253 0xff/1.0 completely opaque).
254 If the alpha component is not specified then 0xff is assumed.
256 The string "random" will result in a random color.