1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.8, https://www.gnu.org/software/texinfo/ -->
<head>
<meta charset="utf-8">
<title>
FFmpeg Utilities Documentation
</title>
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="style.min.css">
</head>
<body>
<div class="container">
<h1>
FFmpeg Utilities Documentation
</h1>
<div align="center">
</div>
<a name="SEC_Top"></a>
<div class="Contents_element" id="SEC_Contents">
<h2 class="contents-heading">Table of Contents</h2>
<div class="contents">
<ul class="no-bullet">
<li><a id="toc-Description" href="#Description">1 Description</a></li>
<li><a id="toc-Syntax" href="#Syntax">2 Syntax</a>
<ul class="no-bullet">
<li><a id="toc-Quoting-and-escaping" href="#Quoting-and-escaping">2.1 Quoting and escaping</a>
<ul class="no-bullet">
<li><a id="toc-Examples" href="#Examples">2.1.1 Examples</a></li>
</ul></li>
<li><a id="toc-Date" href="#Date">2.2 Date</a></li>
<li><a id="toc-Time-duration" href="#Time-duration">2.3 Time duration</a>
<ul class="no-bullet">
<li><a id="toc-Examples-1" href="#Examples-1">2.3.1 Examples</a></li>
</ul></li>
<li><a id="toc-Video-size" href="#Video-size">2.4 Video size</a></li>
<li><a id="toc-Video-rate" href="#Video-rate">2.5 Video rate</a></li>
<li><a id="toc-Ratio" href="#Ratio">2.6 Ratio</a></li>
<li><a id="toc-Color" href="#Color">2.7 Color</a></li>
<li><a id="toc-Channel-Layout" href="#Channel-Layout">2.8 Channel Layout</a></li>
</ul></li>
<li><a id="toc-Expression-Evaluation" href="#Expression-Evaluation">3 Expression Evaluation</a></li>
<li><a id="toc-See-Also" href="#See-Also">4 See Also</a></li>
<li><a id="toc-Authors" href="#Authors">5 Authors</a></li>
</ul>
</div>
</div>
<a name="Description"></a>
<h2 class="chapter">1 Description<span class="pull-right"><a class="anchor hidden-xs" href="#Description" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Description" aria-hidden="true">TOC</a></span></h2>
<p>This document describes some generic features and utilities provided
by the libavutil library.
</p>
<a name="Syntax"></a>
<h2 class="chapter">2 Syntax<span class="pull-right"><a class="anchor hidden-xs" href="#Syntax" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Syntax" aria-hidden="true">TOC</a></span></h2>
<p>This section documents the syntax and formats employed by the FFmpeg
libraries and tools.
</p>
<span id="quoting_005fand_005fescaping"></span><a name="Quoting-and-escaping"></a>
<h3 class="section">2.1 Quoting and escaping<span class="pull-right"><a class="anchor hidden-xs" href="#Quoting-and-escaping" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Quoting-and-escaping" aria-hidden="true">TOC</a></span></h3>
<p>FFmpeg adopts the following quoting and escaping mechanism, unless
explicitly specified. The following rules are applied:
</p>
<ul>
<li> ‘<samp>'</samp>’ and ‘<samp>\</samp>’ 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.
</li><li> A special character is escaped by prefixing it with a ‘<samp>\</samp>’.
</li><li> All characters enclosed between ‘<samp>''</samp>’ are included literally in the
parsed string. The quote character ‘<samp>'</samp>’ itself cannot be quoted,
so you may need to close the quote and escape it.
</li><li> Leading and trailing whitespaces, unless escaped or quoted, are
removed from the parsed string.
</li></ul>
<p>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.
</p>
<p>The function <code>av_get_token</code> defined in
<samp>libavutil/avstring.h</samp> can be used to parse a token quoted or
escaped according to the rules defined above.
</p>
<p>The tool <samp>tools/ffescape</samp> in the FFmpeg source tree can be used
to automatically quote or escape a string in a script.
</p>
<a name="Examples"></a>
<h4 class="subsection">2.1.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples" aria-hidden="true">TOC</a></span></h4>
<ul>
<li> Escape the string <code>Crime d'Amour</code> containing the <code>'</code> special
character:
<div class="example">
<pre class="example">Crime d\'Amour
</pre></div>
</li><li> The string above contains a quote, so the <code>'</code> needs to be escaped
when quoting it:
<div class="example">
<pre class="example">'Crime d'\''Amour'
</pre></div>
</li><li> Include leading or trailing whitespaces using quoting:
<div class="example">
<pre class="example">' this string starts and ends with whitespaces '
</pre></div>
</li><li> Escaping and quoting can be mixed together:
<div class="example">
<pre class="example">' The string '\'string\'' is a string '
</pre></div>
</li><li> To include a literal ‘<samp>\</samp>’ you can use either escaping or quoting:
<div class="example">
<pre class="example">'c:\foo' can be written as c:\\foo
</pre></div>
</li></ul>
<span id="date-syntax"></span><a name="Date"></a>
<h3 class="section">2.2 Date<span class="pull-right"><a class="anchor hidden-xs" href="#Date" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Date" aria-hidden="true">TOC</a></span></h3>
<p>The accepted syntax is:
</p><div class="example">
<pre class="example">[(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...]]])|(HHMMSS[.m...]]]))[Z]
now
</pre></div>
<p>If the value is "now" it takes the current time.
</p>
<p>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.
</p>
<span id="time-duration-syntax"></span><a name="Time-duration"></a>
<h3 class="section">2.3 Time duration<span class="pull-right"><a class="anchor hidden-xs" href="#Time-duration" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Time-duration" aria-hidden="true">TOC</a></span></h3>
<p>There are two accepted syntaxes for expressing time duration.
</p>
<div class="example">
<pre class="example">[-][<var>HH</var>:]<var>MM</var>:<var>SS</var>[.<var>m</var>...]
</pre></div>
<p><var>HH</var> expresses the number of hours, <var>MM</var> the number of minutes
for a maximum of 2 digits, and <var>SS</var> the number of seconds for a
maximum of 2 digits. The <var>m</var> at the end expresses decimal value for
<var>SS</var>.
</p>
<p><em>or</em>
</p>
<div class="example">
<pre class="example">[-]<var>S</var>+[.<var>m</var>...][s|ms|us]
</pre></div>
<p><var>S</var> expresses the number of seconds, with the optional decimal part
<var>m</var>. The optional literal suffixes ‘<samp>s</samp>’, ‘<samp>ms</samp>’ or ‘<samp>us</samp>’
indicate to interpret the value as seconds, milliseconds or microseconds,
respectively.
</p>
<p>In both expressions, the optional ‘<samp>-</samp>’ indicates negative duration.
</p>
<a name="Examples-1"></a>
<h4 class="subsection">2.3.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-1" aria-hidden="true">TOC</a></span></h4>
<p>The following examples are all valid time duration:
</p>
<dl compact="compact">
<dt><span>‘<samp>55</samp>’</span></dt>
<dd><p>55 seconds
</p>
</dd>
<dt><span>‘<samp>0.2</samp>’</span></dt>
<dd><p>0.2 seconds
</p>
</dd>
<dt><span>‘<samp>200ms</samp>’</span></dt>
<dd><p>200 milliseconds, that’s 0.2s
</p>
</dd>
<dt><span>‘<samp>200000us</samp>’</span></dt>
<dd><p>200000 microseconds, that’s 0.2s
</p>
</dd>
<dt><span>‘<samp>12:03:45</samp>’</span></dt>
<dd><p>12 hours, 03 minutes and 45 seconds
</p>
</dd>
<dt><span>‘<samp>23.189</samp>’</span></dt>
<dd><p>23.189 seconds
</p></dd>
</dl>
<span id="video-size-syntax"></span><a name="Video-size"></a>
<h3 class="section">2.4 Video size<span class="pull-right"><a class="anchor hidden-xs" href="#Video-size" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-size" aria-hidden="true">TOC</a></span></h3>
<p>Specify the size of the sourced video, it may be a string of the form
<var>width</var>x<var>height</var>, or the name of a size abbreviation.
</p>
<p>The following abbreviations are recognized:
</p><dl compact="compact">
<dt><span>‘<samp>ntsc</samp>’</span></dt>
<dd><p>720x480
</p></dd>
<dt><span>‘<samp>pal</samp>’</span></dt>
<dd><p>720x576
</p></dd>
<dt><span>‘<samp>qntsc</samp>’</span></dt>
<dd><p>352x240
</p></dd>
<dt><span>‘<samp>qpal</samp>’</span></dt>
<dd><p>352x288
</p></dd>
<dt><span>‘<samp>sntsc</samp>’</span></dt>
<dd><p>640x480
</p></dd>
<dt><span>‘<samp>spal</samp>’</span></dt>
<dd><p>768x576
</p></dd>
<dt><span>‘<samp>film</samp>’</span></dt>
<dd><p>352x240
</p></dd>
<dt><span>‘<samp>ntsc-film</samp>’</span></dt>
<dd><p>352x240
</p></dd>
<dt><span>‘<samp>sqcif</samp>’</span></dt>
<dd><p>128x96
</p></dd>
<dt><span>‘<samp>qcif</samp>’</span></dt>
<dd><p>176x144
</p></dd>
<dt><span>‘<samp>cif</samp>’</span></dt>
<dd><p>352x288
</p></dd>
<dt><span>‘<samp>4cif</samp>’</span></dt>
<dd><p>704x576
</p></dd>
<dt><span>‘<samp>16cif</samp>’</span></dt>
<dd><p>1408x1152
</p></dd>
<dt><span>‘<samp>qqvga</samp>’</span></dt>
<dd><p>160x120
</p></dd>
<dt><span>‘<samp>qvga</samp>’</span></dt>
<dd><p>320x240
</p></dd>
<dt><span>‘<samp>vga</samp>’</span></dt>
<dd><p>640x480
</p></dd>
<dt><span>‘<samp>svga</samp>’</span></dt>
<dd><p>800x600
</p></dd>
<dt><span>‘<samp>xga</samp>’</span></dt>
<dd><p>1024x768
</p></dd>
<dt><span>‘<samp>uxga</samp>’</span></dt>
<dd><p>1600x1200
</p></dd>
<dt><span>‘<samp>qxga</samp>’</span></dt>
<dd><p>2048x1536
</p></dd>
<dt><span>‘<samp>sxga</samp>’</span></dt>
<dd><p>1280x1024
</p></dd>
<dt><span>‘<samp>qsxga</samp>’</span></dt>
<dd><p>2560x2048
</p></dd>
<dt><span>‘<samp>hsxga</samp>’</span></dt>
<dd><p>5120x4096
</p></dd>
<dt><span>‘<samp>wvga</samp>’</span></dt>
<dd><p>852x480
</p></dd>
<dt><span>‘<samp>wxga</samp>’</span></dt>
<dd><p>1366x768
</p></dd>
<dt><span>‘<samp>wsxga</samp>’</span></dt>
<dd><p>1600x1024
</p></dd>
<dt><span>‘<samp>wuxga</samp>’</span></dt>
<dd><p>1920x1200
</p></dd>
<dt><span>‘<samp>woxga</samp>’</span></dt>
<dd><p>2560x1600
</p></dd>
<dt><span>‘<samp>wqsxga</samp>’</span></dt>
<dd><p>3200x2048
</p></dd>
<dt><span>‘<samp>wquxga</samp>’</span></dt>
<dd><p>3840x2400
</p></dd>
<dt><span>‘<samp>whsxga</samp>’</span></dt>
<dd><p>6400x4096
</p></dd>
<dt><span>‘<samp>whuxga</samp>’</span></dt>
<dd><p>7680x4800
</p></dd>
<dt><span>‘<samp>cga</samp>’</span></dt>
<dd><p>320x200
</p></dd>
<dt><span>‘<samp>ega</samp>’</span></dt>
<dd><p>640x350
</p></dd>
<dt><span>‘<samp>hd480</samp>’</span></dt>
<dd><p>852x480
</p></dd>
<dt><span>‘<samp>hd720</samp>’</span></dt>
<dd><p>1280x720
</p></dd>
<dt><span>‘<samp>hd1080</samp>’</span></dt>
<dd><p>1920x1080
</p></dd>
<dt><span>‘<samp>2k</samp>’</span></dt>
<dd><p>2048x1080
</p></dd>
<dt><span>‘<samp>2kflat</samp>’</span></dt>
<dd><p>1998x1080
</p></dd>
<dt><span>‘<samp>2kscope</samp>’</span></dt>
<dd><p>2048x858
</p></dd>
<dt><span>‘<samp>4k</samp>’</span></dt>
<dd><p>4096x2160
</p></dd>
<dt><span>‘<samp>4kflat</samp>’</span></dt>
<dd><p>3996x2160
</p></dd>
<dt><span>‘<samp>4kscope</samp>’</span></dt>
<dd><p>4096x1716
</p></dd>
<dt><span>‘<samp>nhd</samp>’</span></dt>
<dd><p>640x360
</p></dd>
<dt><span>‘<samp>hqvga</samp>’</span></dt>
<dd><p>240x160
</p></dd>
<dt><span>‘<samp>wqvga</samp>’</span></dt>
<dd><p>400x240
</p></dd>
<dt><span>‘<samp>fwqvga</samp>’</span></dt>
<dd><p>432x240
</p></dd>
<dt><span>‘<samp>hvga</samp>’</span></dt>
<dd><p>480x320
</p></dd>
<dt><span>‘<samp>qhd</samp>’</span></dt>
<dd><p>960x540
</p></dd>
<dt><span>‘<samp>2kdci</samp>’</span></dt>
<dd><p>2048x1080
</p></dd>
<dt><span>‘<samp>4kdci</samp>’</span></dt>
<dd><p>4096x2160
</p></dd>
<dt><span>‘<samp>uhd2160</samp>’</span></dt>
<dd><p>3840x2160
</p></dd>
<dt><span>‘<samp>uhd4320</samp>’</span></dt>
<dd><p>7680x4320
</p></dd>
</dl>
<span id="video-rate-syntax"></span><a name="Video-rate"></a>
<h3 class="section">2.5 Video rate<span class="pull-right"><a class="anchor hidden-xs" href="#Video-rate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-rate" aria-hidden="true">TOC</a></span></h3>
<p>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
<var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a float
number or a valid video frame rate abbreviation.
</p>
<p>The following abbreviations are recognized:
</p><dl compact="compact">
<dt><span>‘<samp>ntsc</samp>’</span></dt>
<dd><p>30000/1001
</p></dd>
<dt><span>‘<samp>pal</samp>’</span></dt>
<dd><p>25/1
</p></dd>
<dt><span>‘<samp>qntsc</samp>’</span></dt>
<dd><p>30000/1001
</p></dd>
<dt><span>‘<samp>qpal</samp>’</span></dt>
<dd><p>25/1
</p></dd>
<dt><span>‘<samp>sntsc</samp>’</span></dt>
<dd><p>30000/1001
</p></dd>
<dt><span>‘<samp>spal</samp>’</span></dt>
<dd><p>25/1
</p></dd>
<dt><span>‘<samp>film</samp>’</span></dt>
<dd><p>24/1
</p></dd>
<dt><span>‘<samp>ntsc-film</samp>’</span></dt>
<dd><p>24000/1001
</p></dd>
</dl>
<span id="ratio-syntax"></span><a name="Ratio"></a>
<h3 class="section">2.6 Ratio<span class="pull-right"><a class="anchor hidden-xs" href="#Ratio" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Ratio" aria-hidden="true">TOC</a></span></h3>
<p>A ratio can be expressed as an expression, or in the form
<var>numerator</var>:<var>denominator</var>.
</p>
<p>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.
</p>
<p>The undefined value can be expressed using the "0:0" string.
</p>
<span id="color-syntax"></span><a name="Color"></a>
<h3 class="section">2.7 Color<span class="pull-right"><a class="anchor hidden-xs" href="#Color" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Color" aria-hidden="true">TOC</a></span></h3>
<p>It can be the name of a color as defined below (case insensitive match) or a
<code>[0x|#]RRGGBB[AA]</code> sequence, possibly followed by @ and a string
representing the alpha component.
</p>
<p>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 (‘<samp>0x00</samp>’ or ‘<samp>0.0</samp>’ means completely
transparent, ‘<samp>0xff</samp>’ or ‘<samp>1.0</samp>’ completely opaque). If the alpha
component is not specified then ‘<samp>0xff</samp>’ is assumed.
</p>
<p>The string ‘<samp>random</samp>’ will result in a random color.
</p>
<p>The following names of colors are recognized:
</p><dl compact="compact">
<dt><span>‘<samp>AliceBlue</samp>’</span></dt>
<dd><p>0xF0F8FF
</p></dd>
<dt><span>‘<samp>AntiqueWhite</samp>’</span></dt>
<dd><p>0xFAEBD7
</p></dd>
<dt><span>‘<samp>Aqua</samp>’</span></dt>
<dd><p>0x00FFFF
</p></dd>
<dt><span>‘<samp>Aquamarine</samp>’</span></dt>
<dd><p>0x7FFFD4
</p></dd>
<dt><span>‘<samp>Azure</samp>’</span></dt>
<dd><p>0xF0FFFF
</p></dd>
<dt><span>‘<samp>Beige</samp>’</span></dt>
<dd><p>0xF5F5DC
</p></dd>
<dt><span>‘<samp>Bisque</samp>’</span></dt>
<dd><p>0xFFE4C4
</p></dd>
<dt><span>‘<samp>Black</samp>’</span></dt>
<dd><p>0x000000
</p></dd>
<dt><span>‘<samp>BlanchedAlmond</samp>’</span></dt>
<dd><p>0xFFEBCD
</p></dd>
<dt><span>‘<samp>Blue</samp>’</span></dt>
<dd><p>0x0000FF
</p></dd>
<dt><span>‘<samp>BlueViolet</samp>’</span></dt>
<dd><p>0x8A2BE2
</p></dd>
<dt><span>‘<samp>Brown</samp>’</span></dt>
<dd><p>0xA52A2A
</p></dd>
<dt><span>‘<samp>BurlyWood</samp>’</span></dt>
<dd><p>0xDEB887
</p></dd>
<dt><span>‘<samp>CadetBlue</samp>’</span></dt>
<dd><p>0x5F9EA0
</p></dd>
<dt><span>‘<samp>Chartreuse</samp>’</span></dt>
<dd><p>0x7FFF00
</p></dd>
<dt><span>‘<samp>Chocolate</samp>’</span></dt>
<dd><p>0xD2691E
</p></dd>
<dt><span>‘<samp>Coral</samp>’</span></dt>
<dd><p>0xFF7F50
</p></dd>
<dt><span>‘<samp>CornflowerBlue</samp>’</span></dt>
<dd><p>0x6495ED
</p></dd>
<dt><span>‘<samp>Cornsilk</samp>’</span></dt>
<dd><p>0xFFF8DC
</p></dd>
<dt><span>‘<samp>Crimson</samp>’</span></dt>
<dd><p>0xDC143C
</p></dd>
<dt><span>‘<samp>Cyan</samp>’</span></dt>
<dd><p>0x00FFFF
</p></dd>
<dt><span>‘<samp>DarkBlue</samp>’</span></dt>
<dd><p>0x00008B
</p></dd>
<dt><span>‘<samp>DarkCyan</samp>’</span></dt>
<dd><p>0x008B8B
</p></dd>
<dt><span>‘<samp>DarkGoldenRod</samp>’</span></dt>
<dd><p>0xB8860B
</p></dd>
<dt><span>‘<samp>DarkGray</samp>’</span></dt>
<dd><p>0xA9A9A9
</p></dd>
<dt><span>‘<samp>DarkGreen</samp>’</span></dt>
<dd><p>0x006400
</p></dd>
<dt><span>‘<samp>DarkKhaki</samp>’</span></dt>
<dd><p>0xBDB76B
</p></dd>
<dt><span>‘<samp>DarkMagenta</samp>’</span></dt>
<dd><p>0x8B008B
</p></dd>
<dt><span>‘<samp>DarkOliveGreen</samp>’</span></dt>
<dd><p>0x556B2F
</p></dd>
<dt><span>‘<samp>Darkorange</samp>’</span></dt>
<dd><p>0xFF8C00
</p></dd>
<dt><span>‘<samp>DarkOrchid</samp>’</span></dt>
<dd><p>0x9932CC
</p></dd>
<dt><span>‘<samp>DarkRed</samp>’</span></dt>
<dd><p>0x8B0000
</p></dd>
<dt><span>‘<samp>DarkSalmon</samp>’</span></dt>
<dd><p>0xE9967A
</p></dd>
<dt><span>‘<samp>DarkSeaGreen</samp>’</span></dt>
<dd><p>0x8FBC8F
</p></dd>
<dt><span>‘<samp>DarkSlateBlue</samp>’</span></dt>
<dd><p>0x483D8B
</p></dd>
<dt><span>‘<samp>DarkSlateGray</samp>’</span></dt>
<dd><p>0x2F4F4F
</p></dd>
<dt><span>‘<samp>DarkTurquoise</samp>’</span></dt>
<dd><p>0x00CED1
</p></dd>
<dt><span>‘<samp>DarkViolet</samp>’</span></dt>
<dd><p>0x9400D3
</p></dd>
<dt><span>‘<samp>DeepPink</samp>’</span></dt>
<dd><p>0xFF1493
</p></dd>
<dt><span>‘<samp>DeepSkyBlue</samp>’</span></dt>
<dd><p>0x00BFFF
</p></dd>
<dt><span>‘<samp>DimGray</samp>’</span></dt>
<dd><p>0x696969
</p></dd>
<dt><span>‘<samp>DodgerBlue</samp>’</span></dt>
<dd><p>0x1E90FF
</p></dd>
<dt><span>‘<samp>FireBrick</samp>’</span></dt>
<dd><p>0xB22222
</p></dd>
<dt><span>‘<samp>FloralWhite</samp>’</span></dt>
<dd><p>0xFFFAF0
</p></dd>
<dt><span>‘<samp>ForestGreen</samp>’</span></dt>
<dd><p>0x228B22
</p></dd>
<dt><span>‘<samp>Fuchsia</samp>’</span></dt>
<dd><p>0xFF00FF
</p></dd>
<dt><span>‘<samp>Gainsboro</samp>’</span></dt>
<dd><p>0xDCDCDC
</p></dd>
<dt><span>‘<samp>GhostWhite</samp>’</span></dt>
<dd><p>0xF8F8FF
</p></dd>
<dt><span>‘<samp>Gold</samp>’</span></dt>
<dd><p>0xFFD700
</p></dd>
<dt><span>‘<samp>GoldenRod</samp>’</span></dt>
<dd><p>0xDAA520
</p></dd>
<dt><span>‘<samp>Gray</samp>’</span></dt>
<dd><p>0x808080
</p></dd>
<dt><span>‘<samp>Green</samp>’</span></dt>
<dd><p>0x008000
</p></dd>
<dt><span>‘<samp>GreenYellow</samp>’</span></dt>
<dd><p>0xADFF2F
</p></dd>
<dt><span>‘<samp>HoneyDew</samp>’</span></dt>
<dd><p>0xF0FFF0
</p></dd>
<dt><span>‘<samp>HotPink</samp>’</span></dt>
<dd><p>0xFF69B4
</p></dd>
<dt><span>‘<samp>IndianRed</samp>’</span></dt>
<dd><p>0xCD5C5C
</p></dd>
<dt><span>‘<samp>Indigo</samp>’</span></dt>
<dd><p>0x4B0082
</p></dd>
<dt><span>‘<samp>Ivory</samp>’</span></dt>
<dd><p>0xFFFFF0
</p></dd>
<dt><span>‘<samp>Khaki</samp>’</span></dt>
<dd><p>0xF0E68C
</p></dd>
<dt><span>‘<samp>Lavender</samp>’</span></dt>
<dd><p>0xE6E6FA
</p></dd>
<dt><span>‘<samp>LavenderBlush</samp>’</span></dt>
<dd><p>0xFFF0F5
</p></dd>
<dt><span>‘<samp>LawnGreen</samp>’</span></dt>
<dd><p>0x7CFC00
</p></dd>
<dt><span>‘<samp>LemonChiffon</samp>’</span></dt>
<dd><p>0xFFFACD
</p></dd>
<dt><span>‘<samp>LightBlue</samp>’</span></dt>
<dd><p>0xADD8E6
</p></dd>
<dt><span>‘<samp>LightCoral</samp>’</span></dt>
<dd><p>0xF08080
</p></dd>
<dt><span>‘<samp>LightCyan</samp>’</span></dt>
<dd><p>0xE0FFFF
</p></dd>
<dt><span>‘<samp>LightGoldenRodYellow</samp>’</span></dt>
<dd><p>0xFAFAD2
</p></dd>
<dt><span>‘<samp>LightGreen</samp>’</span></dt>
<dd><p>0x90EE90
</p></dd>
<dt><span>‘<samp>LightGrey</samp>’</span></dt>
<dd><p>0xD3D3D3
</p></dd>
<dt><span>‘<samp>LightPink</samp>’</span></dt>
<dd><p>0xFFB6C1
</p></dd>
<dt><span>‘<samp>LightSalmon</samp>’</span></dt>
<dd><p>0xFFA07A
</p></dd>
<dt><span>‘<samp>LightSeaGreen</samp>’</span></dt>
<dd><p>0x20B2AA
</p></dd>
<dt><span>‘<samp>LightSkyBlue</samp>’</span></dt>
<dd><p>0x87CEFA
</p></dd>
<dt><span>‘<samp>LightSlateGray</samp>’</span></dt>
<dd><p>0x778899
</p></dd>
<dt><span>‘<samp>LightSteelBlue</samp>’</span></dt>
<dd><p>0xB0C4DE
</p></dd>
<dt><span>‘<samp>LightYellow</samp>’</span></dt>
<dd><p>0xFFFFE0
</p></dd>
<dt><span>‘<samp>Lime</samp>’</span></dt>
<dd><p>0x00FF00
</p></dd>
<dt><span>‘<samp>LimeGreen</samp>’</span></dt>
<dd><p>0x32CD32
</p></dd>
<dt><span>‘<samp>Linen</samp>’</span></dt>
<dd><p>0xFAF0E6
</p></dd>
<dt><span>‘<samp>Magenta</samp>’</span></dt>
<dd><p>0xFF00FF
</p></dd>
<dt><span>‘<samp>Maroon</samp>’</span></dt>
<dd><p>0x800000
</p></dd>
<dt><span>‘<samp>MediumAquaMarine</samp>’</span></dt>
<dd><p>0x66CDAA
</p></dd>
<dt><span>‘<samp>MediumBlue</samp>’</span></dt>
<dd><p>0x0000CD
</p></dd>
<dt><span>‘<samp>MediumOrchid</samp>’</span></dt>
<dd><p>0xBA55D3
</p></dd>
<dt><span>‘<samp>MediumPurple</samp>’</span></dt>
<dd><p>0x9370D8
</p></dd>
<dt><span>‘<samp>MediumSeaGreen</samp>’</span></dt>
<dd><p>0x3CB371
</p></dd>
<dt><span>‘<samp>MediumSlateBlue</samp>’</span></dt>
<dd><p>0x7B68EE
</p></dd>
<dt><span>‘<samp>MediumSpringGreen</samp>’</span></dt>
<dd><p>0x00FA9A
</p></dd>
<dt><span>‘<samp>MediumTurquoise</samp>’</span></dt>
<dd><p>0x48D1CC
</p></dd>
<dt><span>‘<samp>MediumVioletRed</samp>’</span></dt>
<dd><p>0xC71585
</p></dd>
<dt><span>‘<samp>MidnightBlue</samp>’</span></dt>
<dd><p>0x191970
</p></dd>
<dt><span>‘<samp>MintCream</samp>’</span></dt>
<dd><p>0xF5FFFA
</p></dd>
<dt><span>‘<samp>MistyRose</samp>’</span></dt>
<dd><p>0xFFE4E1
</p></dd>
<dt><span>‘<samp>Moccasin</samp>’</span></dt>
<dd><p>0xFFE4B5
</p></dd>
<dt><span>‘<samp>NavajoWhite</samp>’</span></dt>
<dd><p>0xFFDEAD
</p></dd>
<dt><span>‘<samp>Navy</samp>’</span></dt>
<dd><p>0x000080
</p></dd>
<dt><span>‘<samp>OldLace</samp>’</span></dt>
<dd><p>0xFDF5E6
</p></dd>
<dt><span>‘<samp>Olive</samp>’</span></dt>
<dd><p>0x808000
</p></dd>
<dt><span>‘<samp>OliveDrab</samp>’</span></dt>
<dd><p>0x6B8E23
</p></dd>
<dt><span>‘<samp>Orange</samp>’</span></dt>
<dd><p>0xFFA500
</p></dd>
<dt><span>‘<samp>OrangeRed</samp>’</span></dt>
<dd><p>0xFF4500
</p></dd>
<dt><span>‘<samp>Orchid</samp>’</span></dt>
<dd><p>0xDA70D6
</p></dd>
<dt><span>‘<samp>PaleGoldenRod</samp>’</span></dt>
<dd><p>0xEEE8AA
</p></dd>
<dt><span>‘<samp>PaleGreen</samp>’</span></dt>
<dd><p>0x98FB98
</p></dd>
<dt><span>‘<samp>PaleTurquoise</samp>’</span></dt>
<dd><p>0xAFEEEE
</p></dd>
<dt><span>‘<samp>PaleVioletRed</samp>’</span></dt>
<dd><p>0xD87093
</p></dd>
<dt><span>‘<samp>PapayaWhip</samp>’</span></dt>
<dd><p>0xFFEFD5
</p></dd>
<dt><span>‘<samp>PeachPuff</samp>’</span></dt>
<dd><p>0xFFDAB9
</p></dd>
<dt><span>‘<samp>Peru</samp>’</span></dt>
<dd><p>0xCD853F
</p></dd>
<dt><span>‘<samp>Pink</samp>’</span></dt>
<dd><p>0xFFC0CB
</p></dd>
<dt><span>‘<samp>Plum</samp>’</span></dt>
<dd><p>0xDDA0DD
</p></dd>
<dt><span>‘<samp>PowderBlue</samp>’</span></dt>
<dd><p>0xB0E0E6
</p></dd>
<dt><span>‘<samp>Purple</samp>’</span></dt>
<dd><p>0x800080
</p></dd>
<dt><span>‘<samp>Red</samp>’</span></dt>
<dd><p>0xFF0000
</p></dd>
<dt><span>‘<samp>RosyBrown</samp>’</span></dt>
<dd><p>0xBC8F8F
</p></dd>
<dt><span>‘<samp>RoyalBlue</samp>’</span></dt>
<dd><p>0x4169E1
</p></dd>
<dt><span>‘<samp>SaddleBrown</samp>’</span></dt>
<dd><p>0x8B4513
</p></dd>
<dt><span>‘<samp>Salmon</samp>’</span></dt>
<dd><p>0xFA8072
</p></dd>
<dt><span>‘<samp>SandyBrown</samp>’</span></dt>
<dd><p>0xF4A460
</p></dd>
<dt><span>‘<samp>SeaGreen</samp>’</span></dt>
<dd><p>0x2E8B57
</p></dd>
<dt><span>‘<samp>SeaShell</samp>’</span></dt>
<dd><p>0xFFF5EE
</p></dd>
<dt><span>‘<samp>Sienna</samp>’</span></dt>
<dd><p>0xA0522D
</p></dd>
<dt><span>‘<samp>Silver</samp>’</span></dt>
<dd><p>0xC0C0C0
</p></dd>
<dt><span>‘<samp>SkyBlue</samp>’</span></dt>
<dd><p>0x87CEEB
</p></dd>
<dt><span>‘<samp>SlateBlue</samp>’</span></dt>
<dd><p>0x6A5ACD
</p></dd>
<dt><span>‘<samp>SlateGray</samp>’</span></dt>
<dd><p>0x708090
</p></dd>
<dt><span>‘<samp>Snow</samp>’</span></dt>
<dd><p>0xFFFAFA
</p></dd>
<dt><span>‘<samp>SpringGreen</samp>’</span></dt>
<dd><p>0x00FF7F
</p></dd>
<dt><span>‘<samp>SteelBlue</samp>’</span></dt>
<dd><p>0x4682B4
</p></dd>
<dt><span>‘<samp>Tan</samp>’</span></dt>
<dd><p>0xD2B48C
</p></dd>
<dt><span>‘<samp>Teal</samp>’</span></dt>
<dd><p>0x008080
</p></dd>
<dt><span>‘<samp>Thistle</samp>’</span></dt>
<dd><p>0xD8BFD8
</p></dd>
<dt><span>‘<samp>Tomato</samp>’</span></dt>
<dd><p>0xFF6347
</p></dd>
<dt><span>‘<samp>Turquoise</samp>’</span></dt>
<dd><p>0x40E0D0
</p></dd>
<dt><span>‘<samp>Violet</samp>’</span></dt>
<dd><p>0xEE82EE
</p></dd>
<dt><span>‘<samp>Wheat</samp>’</span></dt>
<dd><p>0xF5DEB3
</p></dd>
<dt><span>‘<samp>White</samp>’</span></dt>
<dd><p>0xFFFFFF
</p></dd>
<dt><span>‘<samp>WhiteSmoke</samp>’</span></dt>
<dd><p>0xF5F5F5
</p></dd>
<dt><span>‘<samp>Yellow</samp>’</span></dt>
<dd><p>0xFFFF00
</p></dd>
<dt><span>‘<samp>YellowGreen</samp>’</span></dt>
<dd><p>0x9ACD32
</p></dd>
</dl>
<span id="channel-layout-syntax"></span><a name="Channel-Layout"></a>
<h3 class="section">2.8 Channel Layout<span class="pull-right"><a class="anchor hidden-xs" href="#Channel-Layout" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Channel-Layout" aria-hidden="true">TOC</a></span></h3>
<p>A channel layout specifies the spatial disposition of the channels in
a multi-channel audio stream. To specify a channel layout, FFmpeg
makes use of a special syntax.
</p>
<p>Individual channels are identified by an id, as given by the table
below:
</p><dl compact="compact">
<dt><span>‘<samp>FL</samp>’</span></dt>
<dd><p>front left
</p></dd>
<dt><span>‘<samp>FR</samp>’</span></dt>
<dd><p>front right
</p></dd>
<dt><span>‘<samp>FC</samp>’</span></dt>
<dd><p>front center
</p></dd>
<dt><span>‘<samp>LFE</samp>’</span></dt>
<dd><p>low frequency
</p></dd>
<dt><span>‘<samp>BL</samp>’</span></dt>
<dd><p>back left
</p></dd>
<dt><span>‘<samp>BR</samp>’</span></dt>
<dd><p>back right
</p></dd>
<dt><span>‘<samp>FLC</samp>’</span></dt>
<dd><p>front left-of-center
</p></dd>
<dt><span>‘<samp>FRC</samp>’</span></dt>
<dd><p>front right-of-center
</p></dd>
<dt><span>‘<samp>BC</samp>’</span></dt>
<dd><p>back center
</p></dd>
<dt><span>‘<samp>SL</samp>’</span></dt>
<dd><p>side left
</p></dd>
<dt><span>‘<samp>SR</samp>’</span></dt>
<dd><p>side right
</p></dd>
<dt><span>‘<samp>TC</samp>’</span></dt>
<dd><p>top center
</p></dd>
<dt><span>‘<samp>TFL</samp>’</span></dt>
<dd><p>top front left
</p></dd>
<dt><span>‘<samp>TFC</samp>’</span></dt>
<dd><p>top front center
</p></dd>
<dt><span>‘<samp>TFR</samp>’</span></dt>
<dd><p>top front right
</p></dd>
<dt><span>‘<samp>TBL</samp>’</span></dt>
<dd><p>top back left
</p></dd>
<dt><span>‘<samp>TBC</samp>’</span></dt>
<dd><p>top back center
</p></dd>
<dt><span>‘<samp>TBR</samp>’</span></dt>
<dd><p>top back right
</p></dd>
<dt><span>‘<samp>DL</samp>’</span></dt>
<dd><p>downmix left
</p></dd>
<dt><span>‘<samp>DR</samp>’</span></dt>
<dd><p>downmix right
</p></dd>
<dt><span>‘<samp>WL</samp>’</span></dt>
<dd><p>wide left
</p></dd>
<dt><span>‘<samp>WR</samp>’</span></dt>
<dd><p>wide right
</p></dd>
<dt><span>‘<samp>SDL</samp>’</span></dt>
<dd><p>surround direct left
</p></dd>
<dt><span>‘<samp>SDR</samp>’</span></dt>
<dd><p>surround direct right
</p></dd>
<dt><span>‘<samp>LFE2</samp>’</span></dt>
<dd><p>low frequency 2
</p></dd>
</dl>
<p>Standard channel layout compositions can be specified by using the
following identifiers:
</p><dl compact="compact">
<dt><span>‘<samp>mono</samp>’</span></dt>
<dd><p>FC
</p></dd>
<dt><span>‘<samp>stereo</samp>’</span></dt>
<dd><p>FL+FR
</p></dd>
<dt><span>‘<samp>2.1</samp>’</span></dt>
<dd><p>FL+FR+LFE
</p></dd>
<dt><span>‘<samp>3.0</samp>’</span></dt>
<dd><p>FL+FR+FC
</p></dd>
<dt><span>‘<samp>3.0(back)</samp>’</span></dt>
<dd><p>FL+FR+BC
</p></dd>
<dt><span>‘<samp>4.0</samp>’</span></dt>
<dd><p>FL+FR+FC+BC
</p></dd>
<dt><span>‘<samp>quad</samp>’</span></dt>
<dd><p>FL+FR+BL+BR
</p></dd>
<dt><span>‘<samp>quad(side)</samp>’</span></dt>
<dd><p>FL+FR+SL+SR
</p></dd>
<dt><span>‘<samp>3.1</samp>’</span></dt>
<dd><p>FL+FR+FC+LFE
</p></dd>
<dt><span>‘<samp>5.0</samp>’</span></dt>
<dd><p>FL+FR+FC+BL+BR
</p></dd>
<dt><span>‘<samp>5.0(side)</samp>’</span></dt>
<dd><p>FL+FR+FC+SL+SR
</p></dd>
<dt><span>‘<samp>4.1</samp>’</span></dt>
<dd><p>FL+FR+FC+LFE+BC
</p></dd>
<dt><span>‘<samp>5.1</samp>’</span></dt>
<dd><p>FL+FR+FC+LFE+BL+BR
</p></dd>
<dt><span>‘<samp>5.1(side)</samp>’</span></dt>
<dd><p>FL+FR+FC+LFE+SL+SR
</p></dd>
<dt><span>‘<samp>6.0</samp>’</span></dt>
<dd><p>FL+FR+FC+BC+SL+SR
</p></dd>
<dt><span>‘<samp>6.0(front)</samp>’</span></dt>
<dd><p>FL+FR+FLC+FRC+SL+SR
</p></dd>
<dt><span>‘<samp>hexagonal</samp>’</span></dt>
<dd><p>FL+FR+FC+BL+BR+BC
</p></dd>
<dt><span>‘<samp>6.1</samp>’</span></dt>
<dd><p>FL+FR+FC+LFE+BC+SL+SR
</p></dd>
<dt><span>‘<samp>6.1</samp>’</span></dt>
<dd><p>FL+FR+FC+LFE+BL+BR+BC
</p></dd>
<dt><span>‘<samp>6.1(front)</samp>’</span></dt>
<dd><p>FL+FR+LFE+FLC+FRC+SL+SR
</p></dd>
<dt><span>‘<samp>7.0</samp>’</span></dt>
<dd><p>FL+FR+FC+BL+BR+SL+SR
</p></dd>
<dt><span>‘<samp>7.0(front)</samp>’</span></dt>
<dd><p>FL+FR+FC+FLC+FRC+SL+SR
</p></dd>
<dt><span>‘<samp>7.1</samp>’</span></dt>
<dd><p>FL+FR+FC+LFE+BL+BR+SL+SR
</p></dd>
<dt><span>‘<samp>7.1(wide)</samp>’</span></dt>
<dd><p>FL+FR+FC+LFE+BL+BR+FLC+FRC
</p></dd>
<dt><span>‘<samp>7.1(wide-side)</samp>’</span></dt>
<dd><p>FL+FR+FC+LFE+FLC+FRC+SL+SR
</p></dd>
<dt><span>‘<samp>7.1(top)</samp>’</span></dt>
<dd><p>FL+FR+FC+LFE+BL+BR+TFL+TFR
</p></dd>
<dt><span>‘<samp>octagonal</samp>’</span></dt>
<dd><p>FL+FR+FC+BL+BR+BC+SL+SR
</p></dd>
<dt><span>‘<samp>cube</samp>’</span></dt>
<dd><p>FL+FR+BL+BR+TFL+TFR+TBL+TBR
</p></dd>
<dt><span>‘<samp>hexadecagonal</samp>’</span></dt>
<dd><p>FL+FR+FC+BL+BR+BC+SL+SR+WL+WR+TBL+TBR+TBC+TFC+TFL+TFR
</p></dd>
<dt><span>‘<samp>downmix</samp>’</span></dt>
<dd><p>DL+DR
</p></dd>
<dt><span>‘<samp>22.2</samp>’</span></dt>
<dd><p>FL+FR+FC+LFE+BL+BR+FLC+FRC+BC+SL+SR+TC+TFL+TFC+TFR+TBL+TBC+TBR+LFE2+TSL+TSR+BFC+BFL+BFR
</p></dd>
</dl>
<p>A custom channel layout can be specified as a sequence of terms, separated by ’+’.
Each term can be:
</p><ul>
<li> the name of a single channel (e.g. ‘<samp>FL</samp>’, ‘<samp>FR</samp>’, ‘<samp>FC</samp>’, ‘<samp>LFE</samp>’, etc.),
each optionally containing a custom name after a ’@’, (e.g. ‘<samp>FL@Left</samp>’,
‘<samp>FR@Right</samp>’, ‘<samp>FC@Center</samp>’, ‘<samp>LFE@Low_Frequency</samp>’, etc.)
</li></ul>
<p>A standard channel layout can be specified by the following:
</p><ul>
<li> the name of a single channel (e.g. ‘<samp>FL</samp>’, ‘<samp>FR</samp>’, ‘<samp>FC</samp>’, ‘<samp>LFE</samp>’, etc.)
</li><li> the name of a standard channel layout (e.g. ‘<samp>mono</samp>’,
‘<samp>stereo</samp>’, ‘<samp>4.0</samp>’, ‘<samp>quad</samp>’, ‘<samp>5.0</samp>’, etc.)
</li><li> a number of channels, in decimal, followed by ’c’, yielding the default channel
layout for that number of channels (see the function
<code>av_channel_layout_default</code>). Note that not all channel counts have a
default layout.
</li><li> a number of channels, in decimal, followed by ’C’, yielding an unknown channel
layout with the specified number of channels. Note that not all channel layout
specification strings support unknown channel layouts.
</li><li> a channel layout mask, in hexadecimal starting with "0x" (see the
<code>AV_CH_*</code> macros in <samp>libavutil/channel_layout.h</samp>.
</li></ul>
<p>Before libavutil version 53 the trailing character "c" to specify a number of
channels was optional, but now it is required, while a channel layout mask can
also be specified as a decimal number (if and only if not followed by "c" or "C").
</p>
<p>See also the function <code>av_channel_layout_from_string</code> defined in
<samp>libavutil/channel_layout.h</samp>.
</p>
<a name="Expression-Evaluation"></a>
<h2 class="chapter">3 Expression Evaluation<span class="pull-right"><a class="anchor hidden-xs" href="#Expression-Evaluation" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Expression-Evaluation" aria-hidden="true">TOC</a></span></h2>
<p>When evaluating an arithmetic expression, FFmpeg uses an internal
formula evaluator, implemented through the <samp>libavutil/eval.h</samp>
interface.
</p>
<p>An expression may contain unary, binary operators, constants, and
functions.
</p>
<p>Two expressions <var>expr1</var> and <var>expr2</var> can be combined to form
another expression "<var>expr1</var>;<var>expr2</var>".
<var>expr1</var> and <var>expr2</var> are evaluated in turn, and the new
expression evaluates to the value of <var>expr2</var>.
</p>
<p>The following binary operators are available: <code>+</code>, <code>-</code>,
<code>*</code>, <code>/</code>, <code>^</code>.
</p>
<p>The following unary operators are available: <code>+</code>, <code>-</code>.
</p>
<p>The following functions are available:
</p><dl compact="compact">
<dt><span><samp>abs(x)</samp></span></dt>
<dd><p>Compute absolute value of <var>x</var>.
</p>
</dd>
<dt><span><samp>acos(x)</samp></span></dt>
<dd><p>Compute arccosine of <var>x</var>.
</p>
</dd>
<dt><span><samp>asin(x)</samp></span></dt>
<dd><p>Compute arcsine of <var>x</var>.
</p>
</dd>
<dt><span><samp>atan(x)</samp></span></dt>
<dd><p>Compute arctangent of <var>x</var>.
</p>
</dd>
<dt><span><samp>atan2(x, y)</samp></span></dt>
<dd><p>Compute principal value of the arc tangent of <var>y</var>/<var>x</var>.
</p>
</dd>
<dt><span><samp>between(x, min, max)</samp></span></dt>
<dd><p>Return 1 if <var>x</var> is greater than or equal to <var>min</var> and lesser than or
equal to <var>max</var>, 0 otherwise.
</p>
</dd>
<dt><span><samp>bitand(x, y)</samp></span></dt>
<dt><span><samp>bitor(x, y)</samp></span></dt>
<dd><p>Compute bitwise and/or operation on <var>x</var> and <var>y</var>.
</p>
<p>The results of the evaluation of <var>x</var> and <var>y</var> are converted to
integers before executing the bitwise operation.
</p>
<p>Note that both the conversion to integer and the conversion back to
floating point can lose precision. Beware of unexpected results for
large numbers (usually 2^53 and larger).
</p>
</dd>
<dt><span><samp>ceil(expr)</samp></span></dt>
<dd><p>Round the value of expression <var>expr</var> upwards to the nearest
integer. For example, "ceil(1.5)" is "2.0".
</p>
</dd>
<dt><span><samp>clip(x, min, max)</samp></span></dt>
<dd><p>Return the value of <var>x</var> clipped between <var>min</var> and <var>max</var>.
</p>
</dd>
<dt><span><samp>cos(x)</samp></span></dt>
<dd><p>Compute cosine of <var>x</var>.
</p>
</dd>
<dt><span><samp>cosh(x)</samp></span></dt>
<dd><p>Compute hyperbolic cosine of <var>x</var>.
</p>
</dd>
<dt><span><samp>eq(x, y)</samp></span></dt>
<dd><p>Return 1 if <var>x</var> and <var>y</var> are equivalent, 0 otherwise.
</p>
</dd>
<dt><span><samp>exp(x)</samp></span></dt>
<dd><p>Compute exponential of <var>x</var> (with base <code>e</code>, the Euler’s number).
</p>
</dd>
<dt><span><samp>floor(expr)</samp></span></dt>
<dd><p>Round the value of expression <var>expr</var> downwards to the nearest
integer. For example, "floor(-1.5)" is "-2.0".
</p>
</dd>
<dt><span><samp>gauss(x)</samp></span></dt>
<dd><p>Compute Gauss function of <var>x</var>, corresponding to
<code>exp(-x*x/2) / sqrt(2*PI)</code>.
</p>
</dd>
<dt><span><samp>gcd(x, y)</samp></span></dt>
<dd><p>Return the greatest common divisor of <var>x</var> and <var>y</var>. If both <var>x</var> and
<var>y</var> are 0 or either or both are less than zero then behavior is undefined.
</p>
</dd>
<dt><span><samp>gt(x, y)</samp></span></dt>
<dd><p>Return 1 if <var>x</var> is greater than <var>y</var>, 0 otherwise.
</p>
</dd>
<dt><span><samp>gte(x, y)</samp></span></dt>
<dd><p>Return 1 if <var>x</var> is greater than or equal to <var>y</var>, 0 otherwise.
</p>
</dd>
<dt><span><samp>hypot(x, y)</samp></span></dt>
<dd><p>This function is similar to the C function with the same name; it returns
"sqrt(<var>x</var>*<var>x</var> + <var>y</var>*<var>y</var>)", the length of the hypotenuse of a
right triangle with sides of length <var>x</var> and <var>y</var>, or the distance of the
point (<var>x</var>, <var>y</var>) from the origin.
</p>
</dd>
<dt><span><samp>if(x, y)</samp></span></dt>
<dd><p>Evaluate <var>x</var>, and if the result is non-zero return the result of
the evaluation of <var>y</var>, return 0 otherwise.
</p>
</dd>
<dt><span><samp>if(x, y, z)</samp></span></dt>
<dd><p>Evaluate <var>x</var>, and if the result is non-zero return the evaluation
result of <var>y</var>, otherwise the evaluation result of <var>z</var>.
</p>
</dd>
<dt><span><samp>ifnot(x, y)</samp></span></dt>
<dd><p>Evaluate <var>x</var>, and if the result is zero return the result of the
evaluation of <var>y</var>, return 0 otherwise.
</p>
</dd>
<dt><span><samp>ifnot(x, y, z)</samp></span></dt>
<dd><p>Evaluate <var>x</var>, and if the result is zero return the evaluation
result of <var>y</var>, otherwise the evaluation result of <var>z</var>.
</p>
</dd>
<dt><span><samp>isinf(x)</samp></span></dt>
<dd><p>Return 1.0 if <var>x</var> is +/-INFINITY, 0.0 otherwise.
</p>
</dd>
<dt><span><samp>isnan(x)</samp></span></dt>
<dd><p>Return 1.0 if <var>x</var> is NAN, 0.0 otherwise.
</p>
</dd>
<dt><span><samp>ld(var)</samp></span></dt>
<dd><p>Load the value of the internal variable with number
<var>var</var>, which was previously stored with st(<var>var</var>, <var>expr</var>).
The function returns the loaded value.
</p>
</dd>
<dt><span><samp>lerp(x, y, z)</samp></span></dt>
<dd><p>Return linear interpolation between <var>x</var> and <var>y</var> by amount of <var>z</var>.
</p>
</dd>
<dt><span><samp>log(x)</samp></span></dt>
<dd><p>Compute natural logarithm of <var>x</var>.
</p>
</dd>
<dt><span><samp>lt(x, y)</samp></span></dt>
<dd><p>Return 1 if <var>x</var> is lesser than <var>y</var>, 0 otherwise.
</p>
</dd>
<dt><span><samp>lte(x, y)</samp></span></dt>
<dd><p>Return 1 if <var>x</var> is lesser than or equal to <var>y</var>, 0 otherwise.
</p>
</dd>
<dt><span><samp>max(x, y)</samp></span></dt>
<dd><p>Return the maximum between <var>x</var> and <var>y</var>.
</p>
</dd>
<dt><span><samp>min(x, y)</samp></span></dt>
<dd><p>Return the minimum between <var>x</var> and <var>y</var>.
</p>
</dd>
<dt><span><samp>mod(x, y)</samp></span></dt>
<dd><p>Compute the remainder of division of <var>x</var> by <var>y</var>.
</p>
</dd>
<dt><span><samp>not(expr)</samp></span></dt>
<dd><p>Return 1.0 if <var>expr</var> is zero, 0.0 otherwise.
</p>
</dd>
<dt><span><samp>pow(x, y)</samp></span></dt>
<dd><p>Compute the power of <var>x</var> elevated <var>y</var>, it is equivalent to
"(<var>x</var>)^(<var>y</var>)".
</p>
</dd>
<dt><span><samp>print(t)</samp></span></dt>
<dt><span><samp>print(t, l)</samp></span></dt>
<dd><p>Print the value of expression <var>t</var> with loglevel <var>l</var>. If
<var>l</var> is not specified then a default log level is used.
Returns the value of the expression printed.
</p>
<p>Prints t with loglevel l
</p>
</dd>
<dt><span><samp>random(x)</samp></span></dt>
<dd><p>Return a pseudo random value between 0.0 and 1.0. <var>x</var> is the index of the
internal variable which will be used to save the seed/state.
</p>
</dd>
<dt><span><samp>root(expr, max)</samp></span></dt>
<dd><p>Find an input value for which the function represented by <var>expr</var>
with argument <var>ld(0)</var> is 0 in the interval 0..<var>max</var>.
</p>
<p>The expression in <var>expr</var> must denote a continuous function or the
result is undefined.
</p>
<p><var>ld(0)</var> is used to represent the function input value, which means
that the given expression will be evaluated multiple times with
various input values that the expression can access through
<code>ld(0)</code>. When the expression evaluates to 0 then the
corresponding input value will be returned.
</p>
</dd>
<dt><span><samp>round(expr)</samp></span></dt>
<dd><p>Round the value of expression <var>expr</var> to the nearest integer. For example, "round(1.5)" is "2.0".
</p>
</dd>
<dt><span><samp>sgn(x)</samp></span></dt>
<dd><p>Compute sign of <var>x</var>.
</p>
</dd>
<dt><span><samp>sin(x)</samp></span></dt>
<dd><p>Compute sine of <var>x</var>.
</p>
</dd>
<dt><span><samp>sinh(x)</samp></span></dt>
<dd><p>Compute hyperbolic sine of <var>x</var>.
</p>
</dd>
<dt><span><samp>sqrt(expr)</samp></span></dt>
<dd><p>Compute the square root of <var>expr</var>. This is equivalent to
"(<var>expr</var>)^.5".
</p>
</dd>
<dt><span><samp>squish(x)</samp></span></dt>
<dd><p>Compute expression <code>1/(1 + exp(4*x))</code>.
</p>
</dd>
<dt><span><samp>st(var, expr)</samp></span></dt>
<dd><p>Store the value of the expression <var>expr</var> in an internal
variable. <var>var</var> specifies the number of the variable where to
store the value, and it is a value ranging from 0 to 9. The function
returns the value stored in the internal variable.
Note, Variables are currently not shared between expressions.
</p>
</dd>
<dt><span><samp>tan(x)</samp></span></dt>
<dd><p>Compute tangent of <var>x</var>.
</p>
</dd>
<dt><span><samp>tanh(x)</samp></span></dt>
<dd><p>Compute hyperbolic tangent of <var>x</var>.
</p>
</dd>
<dt><span><samp>taylor(expr, x)</samp></span></dt>
<dt><span><samp>taylor(expr, x, id)</samp></span></dt>
<dd><p>Evaluate a Taylor series at <var>x</var>, given an expression representing
the <code>ld(id)</code>-th derivative of a function at 0.
</p>
<p>When the series does not converge the result is undefined.
</p>
<p><var>ld(id)</var> is used to represent the derivative order in <var>expr</var>,
which means that the given expression will be evaluated multiple times
with various input values that the expression can access through
<code>ld(id)</code>. If <var>id</var> is not specified then 0 is assumed.
</p>
<p>Note, when you have the derivatives at y instead of 0,
<code>taylor(expr, x-y)</code> can be used.
</p>
</dd>
<dt><span><samp>time(0)</samp></span></dt>
<dd><p>Return the current (wallclock) time in seconds.
</p>
</dd>
<dt><span><samp>trunc(expr)</samp></span></dt>
<dd><p>Round the value of expression <var>expr</var> towards zero to the nearest
integer. For example, "trunc(-1.5)" is "-1.0".
</p>
</dd>
<dt><span><samp>while(cond, expr)</samp></span></dt>
<dd><p>Evaluate expression <var>expr</var> while the expression <var>cond</var> is
non-zero, and returns the value of the last <var>expr</var> evaluation, or
NAN if <var>cond</var> was always false.
</p></dd>
</dl>
<p>The following constants are available:
</p><dl compact="compact">
<dt><span><samp>PI</samp></span></dt>
<dd><p>area of the unit disc, approximately 3.14
</p></dd>
<dt><span><samp>E</samp></span></dt>
<dd><p>exp(1) (Euler’s number), approximately 2.718
</p></dd>
<dt><span><samp>PHI</samp></span></dt>
<dd><p>golden ratio (1+sqrt(5))/2, approximately 1.618
</p></dd>
</dl>
<p>Assuming that an expression is considered "true" if it has a non-zero
value, note that:
</p>
<p><code>*</code> works like AND
</p>
<p><code>+</code> works like OR
</p>
<p>For example the construct:
</p><div class="example">
<pre class="example">if (A AND B) then C
</pre></div>
<p>is equivalent to:
</p><div class="example">
<pre class="example">if(A*B, C)
</pre></div>
<p>In your C code, you can extend the list of unary and binary functions,
and define recognized constants, so that they are available for your
expressions.
</p>
<p>The evaluator also recognizes the International System unit prefixes.
If ’i’ is appended after the prefix, binary prefixes are used, which
are based on powers of 1024 instead of powers of 1000.
The ’B’ postfix multiplies the value by 8, and can be appended after a
unit prefix or used alone. This allows using for example ’KB’, ’MiB’,
’G’ and ’B’ as number postfix.
</p>
<p>The list of available International System prefixes follows, with
indication of the corresponding powers of 10 and of 2.
</p><dl compact="compact">
<dt><span><samp>y</samp></span></dt>
<dd><p>10^-24 / 2^-80
</p></dd>
<dt><span><samp>z</samp></span></dt>
<dd><p>10^-21 / 2^-70
</p></dd>
<dt><span><samp>a</samp></span></dt>
<dd><p>10^-18 / 2^-60
</p></dd>
<dt><span><samp>f</samp></span></dt>
<dd><p>10^-15 / 2^-50
</p></dd>
<dt><span><samp>p</samp></span></dt>
<dd><p>10^-12 / 2^-40
</p></dd>
<dt><span><samp>n</samp></span></dt>
<dd><p>10^-9 / 2^-30
</p></dd>
<dt><span><samp>u</samp></span></dt>
<dd><p>10^-6 / 2^-20
</p></dd>
<dt><span><samp>m</samp></span></dt>
<dd><p>10^-3 / 2^-10
</p></dd>
<dt><span><samp>c</samp></span></dt>
<dd><p>10^-2
</p></dd>
<dt><span><samp>d</samp></span></dt>
<dd><p>10^-1
</p></dd>
<dt><span><samp>h</samp></span></dt>
<dd><p>10^2
</p></dd>
<dt><span><samp>k</samp></span></dt>
<dd><p>10^3 / 2^10
</p></dd>
<dt><span><samp>K</samp></span></dt>
<dd><p>10^3 / 2^10
</p></dd>
<dt><span><samp>M</samp></span></dt>
<dd><p>10^6 / 2^20
</p></dd>
<dt><span><samp>G</samp></span></dt>
<dd><p>10^9 / 2^30
</p></dd>
<dt><span><samp>T</samp></span></dt>
<dd><p>10^12 / 2^40
</p></dd>
<dt><span><samp>P</samp></span></dt>
<dd><p>10^15 / 2^50
</p></dd>
<dt><span><samp>E</samp></span></dt>
<dd><p>10^18 / 2^60
</p></dd>
<dt><span><samp>Z</samp></span></dt>
<dd><p>10^21 / 2^70
</p></dd>
<dt><span><samp>Y</samp></span></dt>
<dd><p>10^24 / 2^80
</p></dd>
</dl>
<a name="See-Also"></a>
<h2 class="chapter">4 See Also<span class="pull-right"><a class="anchor hidden-xs" href="#See-Also" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-See-Also" aria-hidden="true">TOC</a></span></h2>
<p><a href="ffmpeg.html">ffmpeg</a>, <a href="ffplay.html">ffplay</a>, <a href="ffprobe.html">ffprobe</a>,
<a href="libavutil.html">libavutil</a>
</p>
<a name="Authors"></a>
<h2 class="chapter">5 Authors<span class="pull-right"><a class="anchor hidden-xs" href="#Authors" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Authors" aria-hidden="true">TOC</a></span></h2>
<p>The FFmpeg developers.
</p>
<p>For details about the authorship, see the Git history of the project
(git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
<code>git log</code> in the FFmpeg source directory, or browsing the
online repository at <a href="http://source.ffmpeg.org">http://source.ffmpeg.org</a>.
</p>
<p>Maintainers for the specific components are listed in the file
<samp>MAINTAINERS</samp> in the source code tree.
</p>
<p style="font-size: small;">
This document was generated using <a href="https://www.gnu.org/software/texinfo/"><em>makeinfo</em></a>.
</p>
</div>
</body>
</html>
|