1@chapter Syntax
2@c man begin SYNTAX
3
4This section documents the syntax and formats employed by the FFmpeg
5libraries and tools.
6
7@anchor{quoting_and_escaping}
8@section Quoting and escaping
9
10FFmpeg adopts the following quoting and escaping mechanism, unless
11explicitly specified. The following rules are applied:
12
13@itemize
14@item
15@code{'} and @code{\} are special characters (respectively used for
16quoting and escaping). In addition to them, there might be other
17special characters depending on the specific syntax where the escaping
18and quoting are employed.
19
20@item
21A special character is escaped by prefixing it with a '\'.
22
23@item
24All characters enclosed between '' are included literally in the
25parsed string. The quote character @code{'} itself cannot be quoted,
26so you may need to close the quote and escape it.
27
28@item
29Leading and trailing whitespaces, unless escaped or quoted, are
30removed from the parsed string.
31@end itemize
32
33Note that you may need to add a second level of escaping when using
34the command line or a script, which depends on the syntax of the
35adopted shell language.
36
37The function @code{av_get_token} defined in
38@file{libavutil/avstring.h} can be used to parse a token quoted or
39escaped according to the rules defined above.
40
41The tool @file{tools/ffescape} in the FFmpeg source tree can be used
42to automatically quote or escape a string in a script.
43
44@subsection Examples
45
46@itemize
47@item
48Escape the string @code{Crime d'Amour} containing the @code{'} special
49character:
50@example
51Crime d\'Amour
52@end example
53
54@item
55The string above contains a quote, so the @code{'} needs to be escaped
56when quoting it:
57@example
58'Crime d'\''Amour'
59@end example
60
61@item
62Include leading or trailing whitespaces using quoting:
63@example
64'  this string starts and ends with whitespaces  '
65@end example
66
67@item
68Escaping and quoting can be mixed together:
69@example
70' The string '\'string\'' is a string '
71@end example
72
73@item
74To include a literal @code{\} you can use either escaping or quoting:
75@example
76'c:\foo' can be written as c:\\foo
77@end example
78@end itemize
79
80@anchor{date syntax}
81@section Date
82
83The accepted syntax is:
84@example
85[(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...]]])|(HHMMSS[.m...]]]))[Z]
86now
87@end example
88
89If the value is "now" it takes the current time.
90
91Time is local time unless Z is appended, in which case it is
92interpreted as UTC.
93If the year-month-day part is not specified it takes the current
94year-month-day.
95
96@anchor{time duration syntax}
97@section Time duration
98
99There are two accepted syntaxes for expressing time duration.
100
101@example
102[-][@var{HH}:]@var{MM}:@var{SS}[.@var{m}...]
103@end example
104
105@var{HH} expresses the number of hours, @var{MM} the number of minutes
106for a maximum of 2 digits, and @var{SS} the number of seconds for a
107maximum of 2 digits. The @var{m} at the end expresses decimal value for
108@var{SS}.
109
110@emph{or}
111
112@example
113[-]@var{S}+[.@var{m}...]
114@end example
115
116@var{S} expresses the number of seconds, with the optional decimal part
117@var{m}.
118
119In both expressions, the optional @samp{-} indicates negative duration.
120
121@subsection Examples
122
123The following examples are all valid time duration:
124
125@table @samp
126@item 55
12755 seconds
128
129@item 12:03:45
13012 hours, 03 minutes and 45 seconds
131
132@item 23.189
13323.189 seconds
134@end table
135
136@anchor{video size syntax}
137@section Video size
138Specify the size of the sourced video, it may be a string of the form
139@var{width}x@var{height}, or the name of a size abbreviation.
140
141The following abbreviations are recognized:
142@table @samp
143@item ntsc
144720x480
145@item pal
146720x576
147@item qntsc
148352x240
149@item qpal
150352x288
151@item sntsc
152640x480
153@item spal
154768x576
155@item film
156352x240
157@item ntsc-film
158352x240
159@item sqcif
160128x96
161@item qcif
162176x144
163@item cif
164352x288
165@item 4cif
166704x576
167@item 16cif
1681408x1152
169@item qqvga
170160x120
171@item qvga
172320x240
173@item vga
174640x480
175@item svga
176800x600
177@item xga
1781024x768
179@item uxga
1801600x1200
181@item qxga
1822048x1536
183@item sxga
1841280x1024
185@item qsxga
1862560x2048
187@item hsxga
1885120x4096
189@item wvga
190852x480
191@item wxga
1921366x768
193@item wsxga
1941600x1024
195@item wuxga
1961920x1200
197@item woxga
1982560x1600
199@item wqsxga
2003200x2048
201@item wquxga
2023840x2400
203@item whsxga
2046400x4096
205@item whuxga
2067680x4800
207@item cga
208320x200
209@item ega
210640x350
211@item hd480
212852x480
213@item hd720
2141280x720
215@item hd1080
2161920x1080
217@item 2k
2182048x1080
219@item 2kflat
2201998x1080
221@item 2kscope
2222048x858
223@item 4k
2244096x2160
225@item 4kflat
2263996x2160
227@item 4kscope
2284096x1716
229@item nhd
230640x360
231@item hqvga
232240x160
233@item wqvga
234400x240
235@item fwqvga
236432x240
237@item hvga
238480x320
239@item qhd
240960x540
241@end table
242
243@anchor{video rate syntax}
244@section Video rate
245
246Specify the frame rate of a video, expressed as the number of frames
247generated per second. It has to be a string in the format
248@var{frame_rate_num}/@var{frame_rate_den}, an integer number, a float
249number or a valid video frame rate abbreviation.
250
251The following abbreviations are recognized:
252@table @samp
253@item ntsc
25430000/1001
255@item pal
25625/1
257@item qntsc
25830000/1001
259@item qpal
26025/1
261@item sntsc
26230000/1001
263@item spal
26425/1
265@item film
26624/1
267@item ntsc-film
26824000/1001
269@end table
270
271@anchor{ratio syntax}
272@section Ratio
273
274A ratio can be expressed as an expression, or in the form
275@var{numerator}:@var{denominator}.
276
277Note that a ratio with infinite (1/0) or negative value is
278considered valid, so you should check on the returned value if you
279want to exclude those values.
280
281The undefined value can be expressed using the "0:0" string.
282
283@anchor{color syntax}
284@section Color
285
286It can be the name of a color as defined below (case insensitive match) or a
287@code{[0x|#]RRGGBB[AA]} sequence, possibly followed by @@ and a string
288representing the alpha component.
289
290The alpha component may be a string composed by "0x" followed by an
291hexadecimal number or a decimal number between 0.0 and 1.0, which
292represents the opacity value (@samp{0x00} or @samp{0.0} means completely
293transparent, @samp{0xff} or @samp{1.0} completely opaque). If the alpha
294component is not specified then @samp{0xff} is assumed.
295
296The string @samp{random} will result in a random color.
297
298The following names of colors are recognized:
299@table @samp
300@item AliceBlue
3010xF0F8FF
302@item AntiqueWhite
3030xFAEBD7
304@item Aqua
3050x00FFFF
306@item Aquamarine
3070x7FFFD4
308@item Azure
3090xF0FFFF
310@item Beige
3110xF5F5DC
312@item Bisque
3130xFFE4C4
314@item Black
3150x000000
316@item BlanchedAlmond
3170xFFEBCD
318@item Blue
3190x0000FF
320@item BlueViolet
3210x8A2BE2
322@item Brown
3230xA52A2A
324@item BurlyWood
3250xDEB887
326@item CadetBlue
3270x5F9EA0
328@item Chartreuse
3290x7FFF00
330@item Chocolate
3310xD2691E
332@item Coral
3330xFF7F50
334@item CornflowerBlue
3350x6495ED
336@item Cornsilk
3370xFFF8DC
338@item Crimson
3390xDC143C
340@item Cyan
3410x00FFFF
342@item DarkBlue
3430x00008B
344@item DarkCyan
3450x008B8B
346@item DarkGoldenRod
3470xB8860B
348@item DarkGray
3490xA9A9A9
350@item DarkGreen
3510x006400
352@item DarkKhaki
3530xBDB76B
354@item DarkMagenta
3550x8B008B
356@item DarkOliveGreen
3570x556B2F
358@item Darkorange
3590xFF8C00
360@item DarkOrchid
3610x9932CC
362@item DarkRed
3630x8B0000
364@item DarkSalmon
3650xE9967A
366@item DarkSeaGreen
3670x8FBC8F
368@item DarkSlateBlue
3690x483D8B
370@item DarkSlateGray
3710x2F4F4F
372@item DarkTurquoise
3730x00CED1
374@item DarkViolet
3750x9400D3
376@item DeepPink
3770xFF1493
378@item DeepSkyBlue
3790x00BFFF
380@item DimGray
3810x696969
382@item DodgerBlue
3830x1E90FF
384@item FireBrick
3850xB22222
386@item FloralWhite
3870xFFFAF0
388@item ForestGreen
3890x228B22
390@item Fuchsia
3910xFF00FF
392@item Gainsboro
3930xDCDCDC
394@item GhostWhite
3950xF8F8FF
396@item Gold
3970xFFD700
398@item GoldenRod
3990xDAA520
400@item Gray
4010x808080
402@item Green
4030x008000
404@item GreenYellow
4050xADFF2F
406@item HoneyDew
4070xF0FFF0
408@item HotPink
4090xFF69B4
410@item IndianRed
4110xCD5C5C
412@item Indigo
4130x4B0082
414@item Ivory
4150xFFFFF0
416@item Khaki
4170xF0E68C
418@item Lavender
4190xE6E6FA
420@item LavenderBlush
4210xFFF0F5
422@item LawnGreen
4230x7CFC00
424@item LemonChiffon
4250xFFFACD
426@item LightBlue
4270xADD8E6
428@item LightCoral
4290xF08080
430@item LightCyan
4310xE0FFFF
432@item LightGoldenRodYellow
4330xFAFAD2
434@item LightGreen
4350x90EE90
436@item LightGrey
4370xD3D3D3
438@item LightPink
4390xFFB6C1
440@item LightSalmon
4410xFFA07A
442@item LightSeaGreen
4430x20B2AA
444@item LightSkyBlue
4450x87CEFA
446@item LightSlateGray
4470x778899
448@item LightSteelBlue
4490xB0C4DE
450@item LightYellow
4510xFFFFE0
452@item Lime
4530x00FF00
454@item LimeGreen
4550x32CD32
456@item Linen
4570xFAF0E6
458@item Magenta
4590xFF00FF
460@item Maroon
4610x800000
462@item MediumAquaMarine
4630x66CDAA
464@item MediumBlue
4650x0000CD
466@item MediumOrchid
4670xBA55D3
468@item MediumPurple
4690x9370D8
470@item MediumSeaGreen
4710x3CB371
472@item MediumSlateBlue
4730x7B68EE
474@item MediumSpringGreen
4750x00FA9A
476@item MediumTurquoise
4770x48D1CC
478@item MediumVioletRed
4790xC71585
480@item MidnightBlue
4810x191970
482@item MintCream
4830xF5FFFA
484@item MistyRose
4850xFFE4E1
486@item Moccasin
4870xFFE4B5
488@item NavajoWhite
4890xFFDEAD
490@item Navy
4910x000080
492@item OldLace
4930xFDF5E6
494@item Olive
4950x808000
496@item OliveDrab
4970x6B8E23
498@item Orange
4990xFFA500
500@item OrangeRed
5010xFF4500
502@item Orchid
5030xDA70D6
504@item PaleGoldenRod
5050xEEE8AA
506@item PaleGreen
5070x98FB98
508@item PaleTurquoise
5090xAFEEEE
510@item PaleVioletRed
5110xD87093
512@item PapayaWhip
5130xFFEFD5
514@item PeachPuff
5150xFFDAB9
516@item Peru
5170xCD853F
518@item Pink
5190xFFC0CB
520@item Plum
5210xDDA0DD
522@item PowderBlue
5230xB0E0E6
524@item Purple
5250x800080
526@item Red
5270xFF0000
528@item RosyBrown
5290xBC8F8F
530@item RoyalBlue
5310x4169E1
532@item SaddleBrown
5330x8B4513
534@item Salmon
5350xFA8072
536@item SandyBrown
5370xF4A460
538@item SeaGreen
5390x2E8B57
540@item SeaShell
5410xFFF5EE
542@item Sienna
5430xA0522D
544@item Silver
5450xC0C0C0
546@item SkyBlue
5470x87CEEB
548@item SlateBlue
5490x6A5ACD
550@item SlateGray
5510x708090
552@item Snow
5530xFFFAFA
554@item SpringGreen
5550x00FF7F
556@item SteelBlue
5570x4682B4
558@item Tan
5590xD2B48C
560@item Teal
5610x008080
562@item Thistle
5630xD8BFD8
564@item Tomato
5650xFF6347
566@item Turquoise
5670x40E0D0
568@item Violet
5690xEE82EE
570@item Wheat
5710xF5DEB3
572@item White
5730xFFFFFF
574@item WhiteSmoke
5750xF5F5F5
576@item Yellow
5770xFFFF00
578@item YellowGreen
5790x9ACD32
580@end table
581
582@anchor{channel layout syntax}
583@section Channel Layout
584
585A channel layout specifies the spatial disposition of the channels in
586a multi-channel audio stream. To specify a channel layout, FFmpeg
587makes use of a special syntax.
588
589Individual channels are identified by an id, as given by the table
590below:
591@table @samp
592@item FL
593front left
594@item FR
595front right
596@item FC
597front center
598@item LFE
599low frequency
600@item BL
601back left
602@item BR
603back right
604@item FLC
605front left-of-center
606@item FRC
607front right-of-center
608@item BC
609back center
610@item SL
611side left
612@item SR
613side right
614@item TC
615top center
616@item TFL
617top front left
618@item TFC
619top front center
620@item TFR
621top front right
622@item TBL
623top back left
624@item TBC
625top back center
626@item TBR
627top back right
628@item DL
629downmix left
630@item DR
631downmix right
632@item WL
633wide left
634@item WR
635wide right
636@item SDL
637surround direct left
638@item SDR
639surround direct right
640@item LFE2
641low frequency 2
642@end table
643
644Standard channel layout compositions can be specified by using the
645following identifiers:
646@table @samp
647@item mono
648FC
649@item stereo
650FL+FR
651@item 2.1
652FL+FR+LFE
653@item 3.0
654FL+FR+FC
655@item 3.0(back)
656FL+FR+BC
657@item 4.0
658FL+FR+FC+BC
659@item quad
660FL+FR+BL+BR
661@item quad(side)
662FL+FR+SL+SR
663@item 3.1
664FL+FR+FC+LFE
665@item 5.0
666FL+FR+FC+BL+BR
667@item 5.0(side)
668FL+FR+FC+SL+SR
669@item 4.1
670FL+FR+FC+LFE+BC
671@item 5.1
672FL+FR+FC+LFE+BL+BR
673@item 5.1(side)
674FL+FR+FC+LFE+SL+SR
675@item 6.0
676FL+FR+FC+BC+SL+SR
677@item 6.0(front)
678FL+FR+FLC+FRC+SL+SR
679@item hexagonal
680FL+FR+FC+BL+BR+BC
681@item 6.1
682FL+FR+FC+LFE+BC+SL+SR
683@item 6.1
684FL+FR+FC+LFE+BL+BR+BC
685@item 6.1(front)
686FL+FR+LFE+FLC+FRC+SL+SR
687@item 7.0
688FL+FR+FC+BL+BR+SL+SR
689@item 7.0(front)
690FL+FR+FC+FLC+FRC+SL+SR
691@item 7.1
692FL+FR+FC+LFE+BL+BR+SL+SR
693@item 7.1(wide)
694FL+FR+FC+LFE+BL+BR+FLC+FRC
695@item 7.1(wide-side)
696FL+FR+FC+LFE+FLC+FRC+SL+SR
697@item octagonal
698FL+FR+FC+BL+BR+BC+SL+SR
699@item downmix
700DL+DR
701@end table
702
703A custom channel layout can be specified as a sequence of terms, separated by
704'+' or '|'. Each term can be:
705@itemize
706@item
707the name of a standard channel layout (e.g. @samp{mono},
708@samp{stereo}, @samp{4.0}, @samp{quad}, @samp{5.0}, etc.)
709
710@item
711the name of a single channel (e.g. @samp{FL}, @samp{FR}, @samp{FC}, @samp{LFE}, etc.)
712
713@item
714a number of channels, in decimal, optionally followed by 'c', yielding
715the default channel layout for that number of channels (see the
716function @code{av_get_default_channel_layout})
717
718@item
719a channel layout mask, in hexadecimal starting with "0x" (see the
720@code{AV_CH_*} macros in @file{libavutil/channel_layout.h}.
721@end itemize
722
723Starting from libavutil version 53 the trailing character "c" to
724specify a number of channels will be required, while a channel layout
725mask could also be specified as a decimal number (if and only if not
726followed by "c").
727
728See also the function @code{av_get_channel_layout} defined in
729@file{libavutil/channel_layout.h}.
730@c man end SYNTAX
731
732@chapter Expression Evaluation
733@c man begin EXPRESSION EVALUATION
734
735When evaluating an arithmetic expression, FFmpeg uses an internal
736formula evaluator, implemented through the @file{libavutil/eval.h}
737interface.
738
739An expression may contain unary, binary operators, constants, and
740functions.
741
742Two expressions @var{expr1} and @var{expr2} can be combined to form
743another expression "@var{expr1};@var{expr2}".
744@var{expr1} and @var{expr2} are evaluated in turn, and the new
745expression evaluates to the value of @var{expr2}.
746
747The following binary operators are available: @code{+}, @code{-},
748@code{*}, @code{/}, @code{^}.
749
750The following unary operators are available: @code{+}, @code{-}.
751
752The following functions are available:
753@table @option
754@item abs(x)
755Compute absolute value of @var{x}.
756
757@item acos(x)
758Compute arccosine of @var{x}.
759
760@item asin(x)
761Compute arcsine of @var{x}.
762
763@item atan(x)
764Compute arctangent of @var{x}.
765
766@item between(x, min, max)
767Return 1 if @var{x} is greater than or equal to @var{min} and lesser than or
768equal to @var{max}, 0 otherwise.
769
770@item bitand(x, y)
771@item bitor(x, y)
772Compute bitwise and/or operation on @var{x} and @var{y}.
773
774The results of the evaluation of @var{x} and @var{y} are converted to
775integers before executing the bitwise operation.
776
777Note that both the conversion to integer and the conversion back to
778floating point can lose precision. Beware of unexpected results for
779large numbers (usually 2^53 and larger).
780
781@item ceil(expr)
782Round the value of expression @var{expr} upwards to the nearest
783integer. For example, "ceil(1.5)" is "2.0".
784
785@item cos(x)
786Compute cosine of @var{x}.
787
788@item cosh(x)
789Compute hyperbolic cosine of @var{x}.
790
791@item eq(x, y)
792Return 1 if @var{x} and @var{y} are equivalent, 0 otherwise.
793
794@item exp(x)
795Compute exponential of @var{x} (with base @code{e}, the Euler's number).
796
797@item floor(expr)
798Round the value of expression @var{expr} downwards to the nearest
799integer. For example, "floor(-1.5)" is "-2.0".
800
801@item gauss(x)
802Compute Gauss function of @var{x}, corresponding to
803@code{exp(-x*x/2) / sqrt(2*PI)}.
804
805@item gcd(x, y)
806Return the greatest common divisor of @var{x} and @var{y}. If both @var{x} and
807@var{y} are 0 or either or both are less than zero then behavior is undefined.
808
809@item gt(x, y)
810Return 1 if @var{x} is greater than @var{y}, 0 otherwise.
811
812@item gte(x, y)
813Return 1 if @var{x} is greater than or equal to @var{y}, 0 otherwise.
814
815@item hypot(x, y)
816This function is similar to the C function with the same name; it returns
817"sqrt(@var{x}*@var{x} + @var{y}*@var{y})", the length of the hypotenuse of a
818right triangle with sides of length @var{x} and @var{y}, or the distance of the
819point (@var{x}, @var{y}) from the origin.
820
821@item if(x, y)
822Evaluate @var{x}, and if the result is non-zero return the result of
823the evaluation of @var{y}, return 0 otherwise.
824
825@item if(x, y, z)
826Evaluate @var{x}, and if the result is non-zero return the evaluation
827result of @var{y}, otherwise the evaluation result of @var{z}.
828
829@item ifnot(x, y)
830Evaluate @var{x}, and if the result is zero return the result of the
831evaluation of @var{y}, return 0 otherwise.
832
833@item ifnot(x, y, z)
834Evaluate @var{x}, and if the result is zero return the evaluation
835result of @var{y}, otherwise the evaluation result of @var{z}.
836
837@item isinf(x)
838Return 1.0 if @var{x} is +/-INFINITY, 0.0 otherwise.
839
840@item isnan(x)
841Return 1.0 if @var{x} is NAN, 0.0 otherwise.
842
843@item ld(var)
844Allow to load the value of the internal variable with number
845@var{var}, which was previously stored with st(@var{var}, @var{expr}).
846The function returns the loaded value.
847
848@item log(x)
849Compute natural logarithm of @var{x}.
850
851@item lt(x, y)
852Return 1 if @var{x} is lesser than @var{y}, 0 otherwise.
853
854@item lte(x, y)
855Return 1 if @var{x} is lesser than or equal to @var{y}, 0 otherwise.
856
857@item max(x, y)
858Return the maximum between @var{x} and @var{y}.
859
860@item min(x, y)
861Return the maximum between @var{x} and @var{y}.
862
863@item mod(x, y)
864Compute the remainder of division of @var{x} by @var{y}.
865
866@item not(expr)
867Return 1.0 if @var{expr} is zero, 0.0 otherwise.
868
869@item pow(x, y)
870Compute the power of @var{x} elevated @var{y}, it is equivalent to
871"(@var{x})^(@var{y})".
872
873@item print(t)
874@item print(t, l)
875Print the value of expression @var{t} with loglevel @var{l}. If
876@var{l} is not specified then a default log level is used.
877Returns the value of the expression printed.
878
879Prints t with loglevel l
880
881@item random(x)
882Return a pseudo random value between 0.0 and 1.0. @var{x} is the index of the
883internal variable which will be used to save the seed/state.
884
885@item root(expr, max)
886Find an input value for which the function represented by @var{expr}
887with argument @var{ld(0)} is 0 in the interval 0..@var{max}.
888
889The expression in @var{expr} must denote a continuous function or the
890result is undefined.
891
892@var{ld(0)} is used to represent the function input value, which means
893that the given expression will be evaluated multiple times with
894various input values that the expression can access through
895@code{ld(0)}. When the expression evaluates to 0 then the
896corresponding input value will be returned.
897
898@item sin(x)
899Compute sine of @var{x}.
900
901@item sinh(x)
902Compute hyperbolic sine of @var{x}.
903
904@item sqrt(expr)
905Compute the square root of @var{expr}. This is equivalent to
906"(@var{expr})^.5".
907
908@item squish(x)
909Compute expression @code{1/(1 + exp(4*x))}.
910
911@item st(var, expr)
912Allow to store the value of the expression @var{expr} in an internal
913variable. @var{var} specifies the number of the variable where to
914store the value, and it is a value ranging from 0 to 9. The function
915returns the value stored in the internal variable.
916Note, Variables are currently not shared between expressions.
917
918@item tan(x)
919Compute tangent of @var{x}.
920
921@item tanh(x)
922Compute hyperbolic tangent of @var{x}.
923
924@item taylor(expr, x)
925@item taylor(expr, x, id)
926Evaluate a Taylor series at @var{x}, given an expression representing
927the @code{ld(id)}-th derivative of a function at 0.
928
929When the series does not converge the result is undefined.
930
931@var{ld(id)} is used to represent the derivative order in @var{expr},
932which means that the given expression will be evaluated multiple times
933with various input values that the expression can access through
934@code{ld(id)}. If @var{id} is not specified then 0 is assumed.
935
936Note, when you have the derivatives at y instead of 0,
937@code{taylor(expr, x-y)} can be used.
938
939@item time(0)
940Return the current (wallclock) time in seconds.
941
942@item trunc(expr)
943Round the value of expression @var{expr} towards zero to the nearest
944integer. For example, "trunc(-1.5)" is "-1.0".
945
946@item while(cond, expr)
947Evaluate expression @var{expr} while the expression @var{cond} is
948non-zero, and returns the value of the last @var{expr} evaluation, or
949NAN if @var{cond} was always false.
950@end table
951
952The following constants are available:
953@table @option
954@item PI
955area of the unit disc, approximately 3.14
956@item E
957exp(1) (Euler's number), approximately 2.718
958@item PHI
959golden ratio (1+sqrt(5))/2, approximately 1.618
960@end table
961
962Assuming that an expression is considered "true" if it has a non-zero
963value, note that:
964
965@code{*} works like AND
966
967@code{+} works like OR
968
969For example the construct:
970@example
971if (A AND B) then C
972@end example
973is equivalent to:
974@example
975if(A*B, C)
976@end example
977
978In your C code, you can extend the list of unary and binary functions,
979and define recognized constants, so that they are available for your
980expressions.
981
982The evaluator also recognizes the International System unit prefixes.
983If 'i' is appended after the prefix, binary prefixes are used, which
984are based on powers of 1024 instead of powers of 1000.
985The 'B' postfix multiplies the value by 8, and can be appended after a
986unit prefix or used alone. This allows using for example 'KB', 'MiB',
987'G' and 'B' as number postfix.
988
989The list of available International System prefixes follows, with
990indication of the corresponding powers of 10 and of 2.
991@table @option
992@item y
99310^-24 / 2^-80
994@item z
99510^-21 / 2^-70
996@item a
99710^-18 / 2^-60
998@item f
99910^-15 / 2^-50
1000@item p
100110^-12 / 2^-40
1002@item n
100310^-9 / 2^-30
1004@item u
100510^-6 / 2^-20
1006@item m
100710^-3 / 2^-10
1008@item c
100910^-2
1010@item d
101110^-1
1012@item h
101310^2
1014@item k
101510^3 / 2^10
1016@item K
101710^3 / 2^10
1018@item M
101910^6 / 2^20
1020@item G
102110^9 / 2^30
1022@item T
102310^12 / 2^40
1024@item P
102510^15 / 2^40
1026@item E
102710^18 / 2^50
1028@item Z
102910^21 / 2^60
1030@item Y
103110^24 / 2^70
1032@end table
1033
1034@c man end EXPRESSION EVALUATION
1035
1036@chapter OpenCL Options
1037@c man begin OPENCL OPTIONS
1038
1039When FFmpeg is configured with @code{--enable-opencl}, it is possible
1040to set the options for the global OpenCL context.
1041
1042The list of supported options follows:
1043
1044@table @option
1045@item build_options
1046Set build options used to compile the registered kernels.
1047
1048See reference "OpenCL Specification Version: 1.2 chapter 5.6.4".
1049
1050@item platform_idx
1051Select the index of the platform to run OpenCL code.
1052
1053The specified index must be one of the indexes in the device list
1054which can be obtained with @code{ffmpeg -opencl_bench} or @code{av_opencl_get_device_list()}.
1055
1056@item device_idx
1057Select the index of the device used to run OpenCL code.
1058
1059The specified index must be one of the indexes in the device list which
1060can be obtained with @code{ffmpeg -opencl_bench} or @code{av_opencl_get_device_list()}.
1061
1062@end table
1063
1064@c man end OPENCL OPTIONS
1065