This section documents the syntax and formats employed by the FFmpeg libraries and tools.
FFmpeg adopts the following quoting and escaping mechanism, unless explicitly specified. The following rules are applied:
'
and \
are special characters (respectively used for
quoting and escaping). In addition to them, there might be other
special characters depending on the specific syntax where the escaping
and quoting are employed.
'
itself cannot be quoted,
so you may need to close the quote and escape it.
Note that you may need to add a second level of escaping when using the command line or a script, which depends on the syntax of the adopted shell language.
The function av_get_token
defined in
‘libavutil/avstring.h’ can be used to parse a token quoted or
escaped according to the rules defined above.
The tool ‘tools/ffescape’ in the FFmpeg source tree can be used to automatically quote or escape a string in a script.
Crime d'Amour
containing the '
special
character:
Crime d\'Amour |
'
needs to be escaped
when quoting it:
'Crime d'\''Amour' |
' this string starts and ends with whitespaces ' |
' The string '\'string\'' is a string ' |
\
you can use either escaping or quoting:
'c:\foo' can be written as c:\\foo |
The accepted syntax is:
[(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...]]])|(HHMMSS[.m...]]]))[Z] now |
If the value is "now" it takes the current time.
Time is local time unless Z is appended, in which case it is interpreted as UTC. If the year-month-day part is not specified it takes the current year-month-day.
The accepted syntax is:
[-]HH:MM:SS[.m...] [-]S+[.m...] |
HH expresses the number of hours, MM the number a of minutes and SS the number of seconds.
Specify the size of the sourced video, it may be a string of the form widthxheight, or the name of a size abbreviation.
The following abbreviations are recognized:
128x96
176x144
352x288
704x576
1408x1152
160x120
320x240
640x480
800x600
1024x768
1600x1200
2048x1536
1280x1024
2560x2048
5120x4096
852x480
1366x768
1600x1024
1920x1200
2560x1600
3200x2048
3840x2400
6400x4096
7680x4800
320x200
640x350
852x480
1280x720
1920x1080
Specify the frame rate of a video, expressed as the number of frames generated per second. It has to be a string in the format frame_rate_num/frame_rate_den, an integer number, a float number or a valid video frame rate abbreviation.
The following abbreviations are recognized:
30000/1001
25/1
30000/1
25/1
30000/1
25/1
24/1
24000/1
A ratio can be expressed as an expression, or in the form numerator:denominator.
Note that a ratio with infinite (1/0) or negative value is considered valid, so you should check on the returned value if you want to exclude those values.
The undefined value can be expressed using the "0:0" string.
It can be the name of a color (case insensitive match) or a [0x|#]RRGGBB[AA] sequence, possibly followed by "@" and a string representing the alpha component.
The alpha component may be a string composed by "0x" followed by an hexadecimal number or a decimal number between 0.0 and 1.0, which represents the opacity value (0x00/0.0 means completely transparent, 0xff/1.0 completely opaque). If the alpha component is not specified then 0xff is assumed.
The string "random" will result in a random color.