ffmpeg-utils.pod 22.6 KB
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 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882
=encoding utf8

=head1 NAME

ffmpeg-utils - FFmpeg utilities

=head1 DESCRIPTION


This document describes some generic features and utilities provided
by the libavutil library.



=head1 SYNTAX


This section documents the syntax and formats employed by the FFmpeg
libraries and tools.



=head2 Quoting and escaping


FFmpeg adopts the following quoting and escaping mechanism, unless
explicitly specified. The following rules are applied:


=over 4


=item *

B<'> and B<\> 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.


=item *

A special character is escaped by prefixing it with a B<\>.


=item *

All characters enclosed between B<''> are included literally in the
parsed string. The quote character B<'> itself cannot be quoted,
so you may need to close the quote and escape it.


=item *

Leading and trailing whitespaces, unless escaped or quoted, are
removed from the parsed string.

=back


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 C<av_get_token> defined in
F<libavutil/avstring.h> can be used to parse a token quoted or
escaped according to the rules defined above.

The tool F<tools/ffescape> in the FFmpeg source tree can be used
to automatically quote or escape a string in a script.


=head3 Examples



=over 4


=item *

Escape the string C<Crime d'Amour> containing the C<'> special
character:
	
	Crime d\'Amour



=item *

The string above contains a quote, so the C<'> needs to be escaped
when quoting it:
	
	'Crime d'\''Amour'



=item *

Include leading or trailing whitespaces using quoting:
	
	'  this string starts and ends with whitespaces  '



=item *

Escaping and quoting can be mixed together:
	
	' The string '\'string\'' is a string '



=item *

To include a literal B<\> you can use either escaping or quoting:
	
	'c:\foo' can be written as c:\\foo


=back




=head2 Date


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.



=head2 Time duration


There are two accepted syntaxes for expressing time duration.

	
	[-][<HH>:]<MM>:<SS>[.<m>...]


I<HH> expresses the number of hours, I<MM> the number of minutes
for a maximum of 2 digits, and I<SS> the number of seconds for a
maximum of 2 digits. The I<m> at the end expresses decimal value for
I<SS>.

I<or>

	
	[-]<S>+[.<m>...][s|ms|us]


I<S> expresses the number of seconds, with the optional decimal part
I<m>.  The optional literal suffixes B<s>, B<ms> or B<us>
indicate to interpret the value as seconds, milliseconds or microseconds,
respectively.

In both expressions, the optional B<-> indicates negative duration.


=head3 Examples


The following examples are all valid time duration:


=over 4


=item B<55>

55 seconds


=item B<0.2>

0.2 seconds


=item B<200ms>

200 milliseconds, that's 0.2s


=item B<200000us>

200000 microseconds, that's 0.2s


=item B<12:03:45>

12 hours, 03 minutes and 45 seconds


=item B<23.189>

23.189 seconds

=back




=head2 Video size

Specify the size of the sourced video, it may be a string of the form
I<width>xI<height>, or the name of a size abbreviation.

The following abbreviations are recognized:

=over 4


=item B<ntsc>

720x480

=item B<pal>

720x576

=item B<qntsc>

352x240

=item B<qpal>

352x288

=item B<sntsc>

640x480

=item B<spal>

768x576

=item B<film>

352x240

=item B<ntsc-film>

352x240

=item B<sqcif>

128x96

=item B<qcif>

176x144

=item B<cif>

352x288

=item B<4cif>

704x576

=item B<16cif>

1408x1152

=item B<qqvga>

160x120

=item B<qvga>

320x240

=item B<vga>

640x480

=item B<svga>

800x600

=item B<xga>

1024x768

=item B<uxga>

1600x1200

=item B<qxga>

2048x1536

=item B<sxga>

1280x1024

=item B<qsxga>

2560x2048

=item B<hsxga>

5120x4096

=item B<wvga>

852x480

=item B<wxga>

1366x768

=item B<wsxga>

1600x1024

=item B<wuxga>

1920x1200

=item B<woxga>

2560x1600

=item B<wqsxga>

3200x2048

=item B<wquxga>

3840x2400

=item B<whsxga>

6400x4096

=item B<whuxga>

7680x4800

=item B<cga>

320x200

=item B<ega>

640x350

=item B<hd480>

852x480

=item B<hd720>

1280x720

=item B<hd1080>

1920x1080

=item B<2k>

2048x1080

=item B<2kflat>

1998x1080

=item B<2kscope>

2048x858

=item B<4k>

4096x2160

=item B<4kflat>

3996x2160

=item B<4kscope>

4096x1716

=item B<nhd>

640x360

=item B<hqvga>

240x160

=item B<wqvga>

400x240

=item B<fwqvga>

432x240

=item B<hvga>

480x320

=item B<qhd>

960x540

=item B<2kdci>

2048x1080

=item B<4kdci>

4096x2160

=item B<uhd2160>

3840x2160

=item B<uhd4320>

7680x4320

=back




=head2 Video rate


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
I<frame_rate_num>/I<frame_rate_den>, an integer number, a float
number or a valid video frame rate abbreviation.

The following abbreviations are recognized:

=over 4


=item B<ntsc>

30000/1001

=item B<pal>

25/1

=item B<qntsc>

30000/1001

=item B<qpal>

25/1

=item B<sntsc>

30000/1001

=item B<spal>

25/1

=item B<film>

24/1

=item B<ntsc-film>

24000/1001

=back




=head2 Ratio


A ratio can be expressed as an expression, or in the form
I<numerator>:I<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.



=head2 Color


It can be the name of a color as defined below (case insensitive match) or a
C<[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 (B<0x00> or B<0.0> means completely
transparent, B<0xff> or B<1.0> completely opaque). If the alpha
component is not specified then B<0xff> is assumed.

The string B<random> will result in a random color.

The following names of colors are recognized:

=over 4


=item B<AliceBlue>

0xF0F8FF

=item B<AntiqueWhite>

0xFAEBD7

=item B<Aqua>

0x00FFFF

=item B<Aquamarine>

0x7FFFD4

=item B<Azure>

0xF0FFFF

=item B<Beige>

0xF5F5DC

=item B<Bisque>

0xFFE4C4

=item B<Black>

0x000000

=item B<BlanchedAlmond>

0xFFEBCD

=item B<Blue>

0x0000FF

=item B<BlueViolet>

0x8A2BE2

=item B<Brown>

0xA52A2A

=item B<BurlyWood>

0xDEB887

=item B<CadetBlue>

0x5F9EA0

=item B<Chartreuse>

0x7FFF00

=item B<Chocolate>

0xD2691E

=item B<Coral>

0xFF7F50

=item B<CornflowerBlue>

0x6495ED

=item B<Cornsilk>

0xFFF8DC

=item B<Crimson>

0xDC143C

=item B<Cyan>

0x00FFFF

=item B<DarkBlue>

0x00008B

=item B<DarkCyan>

0x008B8B

=item B<DarkGoldenRod>

0xB8860B

=item B<DarkGray>

0xA9A9A9

=item B<DarkGreen>

0x006400

=item B<DarkKhaki>

0xBDB76B

=item B<DarkMagenta>

0x8B008B

=item B<DarkOliveGreen>

0x556B2F

=item B<Darkorange>

0xFF8C00

=item B<DarkOrchid>

0x9932CC

=item B<DarkRed>

0x8B0000

=item B<DarkSalmon>

0xE9967A

=item B<DarkSeaGreen>

0x8FBC8F

=item B<DarkSlateBlue>

0x483D8B

=item B<DarkSlateGray>

0x2F4F4F

=item B<DarkTurquoise>

0x00CED1

=item B<DarkViolet>

0x9400D3

=item B<DeepPink>

0xFF1493

=item B<DeepSkyBlue>

0x00BFFF

=item B<DimGray>

0x696969

=item B<DodgerBlue>

0x1E90FF

=item B<FireBrick>

0xB22222

=item B<FloralWhite>

0xFFFAF0

=item B<ForestGreen>

0x228B22

=item B<Fuchsia>

0xFF00FF

=item B<Gainsboro>

0xDCDCDC

=item B<GhostWhite>

0xF8F8FF

=item B<Gold>

0xFFD700

=item B<GoldenRod>

0xDAA520

=item B<Gray>

0x808080

=item B<Green>

0x008000

=item B<GreenYellow>

0xADFF2F

=item B<HoneyDew>

0xF0FFF0

=item B<HotPink>

0xFF69B4

=item B<IndianRed>

0xCD5C5C

=item B<Indigo>

0x4B0082

=item B<Ivory>

0xFFFFF0

=item B<Khaki>

0xF0E68C

=item B<Lavender>

0xE6E6FA

=item B<LavenderBlush>

0xFFF0F5

=item B<LawnGreen>

0x7CFC00

=item B<LemonChiffon>

0xFFFACD

=item B<LightBlue>

0xADD8E6

=item B<LightCoral>

0xF08080

=item B<LightCyan>

0xE0FFFF

=item B<LightGoldenRodYellow>

0xFAFAD2

=item B<LightGreen>

0x90EE90

=item B<LightGrey>

0xD3D3D3

=item B<LightPink>

0xFFB6C1

=item B<LightSalmon>

0xFFA07A

=item B<LightSeaGreen>

0x20B2AA

=item B<LightSkyBlue>

0x87CEFA

=item B<LightSlateGray>

0x778899

=item B<LightSteelBlue>

0xB0C4DE

=item B<LightYellow>

0xFFFFE0

=item B<Lime>

0x00FF00

=item B<LimeGreen>

0x32CD32

=item B<Linen>

0xFAF0E6

=item B<Magenta>

0xFF00FF

=item B<Maroon>

0x800000

=item B<MediumAquaMarine>

0x66CDAA

=item B<MediumBlue>

0x0000CD

=item B<MediumOrchid>

0xBA55D3

=item B<MediumPurple>

0x9370D8

=item B<MediumSeaGreen>

0x3CB371

=item B<MediumSlateBlue>

0x7B68EE

=item B<MediumSpringGreen>

0x00FA9A

=item B<MediumTurquoise>

0x48D1CC

=item B<MediumVioletRed>

0xC71585

=item B<MidnightBlue>

0x191970

=item B<MintCream>

0xF5FFFA

=item B<MistyRose>

0xFFE4E1

=item B<Moccasin>

0xFFE4B5

=item B<NavajoWhite>

0xFFDEAD

=item B<Navy>

0x000080

=item B<OldLace>

0xFDF5E6

=item B<Olive>

0x808000

=item B<OliveDrab>

0x6B8E23

=item B<Orange>

0xFFA500

=item B<OrangeRed>

0xFF4500

=item B<Orchid>

0xDA70D6

=item B<PaleGoldenRod>

0xEEE8AA

=item B<PaleGreen>

0x98FB98

=item B<PaleTurquoise>

0xAFEEEE

=item B<PaleVioletRed>

0xD87093

=item B<PapayaWhip>

0xFFEFD5

=item B<PeachPuff>

0xFFDAB9

=item B<Peru>

0xCD853F

=item B<Pink>

0xFFC0CB

=item B<Plum>

0xDDA0DD

=item B<PowderBlue>

0xB0E0E6

=item B<Purple>

0x800080

=item B<Red>

0xFF0000

=item B<RosyBrown>

0xBC8F8F

=item B<RoyalBlue>

0x4169E1

=item B<SaddleBrown>

0x8B4513

=item B<Salmon>

0xFA8072

=item B<SandyBrown>

0xF4A460

=item B<SeaGreen>

0x2E8B57

=item B<SeaShell>

0xFFF5EE

=item B<Sienna>

0xA0522D

=item B<Silver>

0xC0C0C0

=item B<SkyBlue>

0x87CEEB

=item B<SlateBlue>

0x6A5ACD

=item B<SlateGray>

0x708090

=item B<Snow>

0xFFFAFA

=item B<SpringGreen>

0x00FF7F

=item B<SteelBlue>

0x4682B4

=item B<Tan>

0xD2B48C

=item B<Teal>

0x008080

=item B<Thistle>

0xD8BFD8

=item B<Tomato>

0xFF6347

=item B<Turquoise>

0x40E0D0

=item B<Violet>

0xEE82EE

=item B<Wheat>

0xF5DEB3

=item B<White>

0xFFFFFF

=item B<WhiteSmoke>

0xF5F5F5

=item B<Yellow>

0xFFFF00

=item B<YellowGreen>

0x9ACD32

=back




=head2 Channel Layout


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.

Individual channels are identified by an id, as given by the table
below:

=over 4


=item B<FL>

front left

=item B<FR>

front right

=item B<FC>

front center

=item B<LFE>

low frequency

=item B<BL>

back left

=item B<BR>

back right

=item B<FLC>

front left-of-center

=item B<FRC>

front right-of-center

=item B<BC>

back center

=item B<SL>

side left

=item B<SR>

side right

=item B<TC>

top center

=item B<TFL>

top front left

=item B<TFC>

top front center

=item B<TFR>

top front right

=item B<TBL>

top back left

=item B<TBC>

top back center

=item B<TBR>

top back right

=item B<DL>

downmix left

=item B<DR>

downmix right

=item B<WL>

wide left

=item B<WR>

wide right

=item B<SDL>

surround direct left

=item B<SDR>

surround direct right

=item B<LFE2>

low frequency 2

=back


Standard channel layout compositions can be specified by using the
following identifiers:

=over 4


=item B<mono>

FC

=item B<stereo>

FL+FR

=item B<2.1>

FL+FR+LFE

=item B<3.0>

FL+FR+FC

=item B<3.0(back)>

FL+FR+BC

=item B<4.0>

FL+FR+FC+BC

=item B<quad>

FL+FR+BL+BR

=item B<quad(side)>

FL+FR+SL+SR

=item B<3.1>

FL+FR+FC+LFE

=item B<5.0>

FL+FR+FC+BL+BR

=item B<5.0(side)>

FL+FR+FC+SL+SR

=item B<4.1>

FL+FR+FC+LFE+BC

=item B<5.1>

FL+FR+FC+LFE+BL+BR

=item B<5.1(side)>

FL+FR+FC+LFE+SL+SR

=item B<6.0>

FL+FR+FC+BC+SL+SR

=item B<6.0(front)>

FL+FR+FLC+FRC+SL+SR

=item B<hexagonal>

FL+FR+FC+BL+BR+BC

=item B<6.1>

FL+FR+FC+LFE+BC+SL+SR

=item B<6.1>

FL+FR+FC+LFE+BL+BR+BC

=item B<6.1(front)>

FL+FR+LFE+FLC+FRC+SL+SR

=item B<7.0>

FL+FR+FC+BL+BR+SL+SR

=item B<7.0(front)>

FL+FR+FC+FLC+FRC+SL+SR

=item B<7.1>

FL+FR+FC+LFE+BL+BR+SL+SR

=item B<7.1(wide)>

FL+FR+FC+LFE+BL+BR+FLC+FRC

=item B<7.1(wide-side)>

FL+FR+FC+LFE+FLC+FRC+SL+SR

=item B<octagonal>

FL+FR+FC+BL+BR+BC+SL+SR

=item B<hexadecagonal>

FL+FR+FC+BL+BR+BC+SL+SR+WL+WR+TBL+TBR+TBC+TFC+TFL+TFR

=item B<downmix>

DL+DR

=back


A custom channel layout can be specified as a sequence of terms, separated by
'+' or '|'. Each term can be:

=over 4


=item *

the name of a standard channel layout (e.g. B<mono>,
B<stereo>, B<4.0>, B<quad>, B<5.0>, etc.)


=item *

the name of a single channel (e.g. B<FL>, B<FR>, B<FC>, B<LFE>, etc.)


=item *

a number of channels, in decimal, followed by 'c', yielding the default channel
layout for that number of channels (see the function
C<av_get_default_channel_layout>). Note that not all channel counts have a
default layout.


=item *

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.


=item *

a channel layout mask, in hexadecimal starting with "0x" (see the
C<AV_CH_*> macros in F<libavutil/channel_layout.h>.

=back


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").

See also the function C<av_get_channel_layout> defined in
F<libavutil/channel_layout.h>.


=head1 EXPRESSION EVALUATION


When evaluating an arithmetic expression, FFmpeg uses an internal
formula evaluator, implemented through the F<libavutil/eval.h>
interface.

An expression may contain unary, binary operators, constants, and
functions.

Two expressions I<expr1> and I<expr2> can be combined to form
another expression "I<expr1>;I<expr2>".
I<expr1> and I<expr2> are evaluated in turn, and the new
expression evaluates to the value of I<expr2>.

The following binary operators are available: C<+>, C<->,
C<*>, C</>, C<^>.

The following unary operators are available: C<+>, C<->.

The following functions are available:

=over 4


=item B<abs(x)>

Compute absolute value of I<x>.


=item B<acos(x)>

Compute arccosine of I<x>.


=item B<asin(x)>

Compute arcsine of I<x>.


=item B<atan(x)>

Compute arctangent of I<x>.


=item B<atan2(x, y)>

Compute principal value of the arc tangent of I<y>/I<x>.


=item B<between(x, min, max)>

Return 1 if I<x> is greater than or equal to I<min> and lesser than or
equal to I<max>, 0 otherwise.


=item B<bitand(x, y)>


=item B<bitor(x, y)>

Compute bitwise and/or operation on I<x> and I<y>.

The results of the evaluation of I<x> and I<y> are converted to
integers before executing the bitwise operation.

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).


=item B<ceil(expr)>

Round the value of expression I<expr> upwards to the nearest
integer. For example, "ceil(1.5)" is "2.0".


=item B<clip(x, min, max)>

Return the value of I<x> clipped between I<min> and I<max>.


=item B<cos(x)>

Compute cosine of I<x>.


=item B<cosh(x)>

Compute hyperbolic cosine of I<x>.


=item B<eq(x, y)>

Return 1 if I<x> and I<y> are equivalent, 0 otherwise.


=item B<exp(x)>

Compute exponential of I<x> (with base C<e>, the Euler's number).


=item B<floor(expr)>

Round the value of expression I<expr> downwards to the nearest
integer. For example, "floor(-1.5)" is "-2.0".


=item B<gauss(x)>

Compute Gauss function of I<x>, corresponding to
C<exp(-x*x/2) / sqrt(2*PI)>.


=item B<gcd(x, y)>

Return the greatest common divisor of I<x> and I<y>. If both I<x> and
I<y> are 0 or either or both are less than zero then behavior is undefined.


=item B<gt(x, y)>

Return 1 if I<x> is greater than I<y>, 0 otherwise.


=item B<gte(x, y)>

Return 1 if I<x> is greater than or equal to I<y>, 0 otherwise.


=item B<hypot(x, y)>

This function is similar to the C function with the same name; it returns
"sqrt(I<x>*I<x> + I<y>*I<y>)", the length of the hypotenuse of a
right triangle with sides of length I<x> and I<y>, or the distance of the
point (I<x>, I<y>) from the origin.


=item B<if(x, y)>

Evaluate I<x>, and if the result is non-zero return the result of
the evaluation of I<y>, return 0 otherwise.


=item B<if(x, y, z)>

Evaluate I<x>, and if the result is non-zero return the evaluation
result of I<y>, otherwise the evaluation result of I<z>.


=item B<ifnot(x, y)>

Evaluate I<x>, and if the result is zero return the result of the
evaluation of I<y>, return 0 otherwise.


=item B<ifnot(x, y, z)>

Evaluate I<x>, and if the result is zero return the evaluation
result of I<y>, otherwise the evaluation result of I<z>.


=item B<isinf(x)>

Return 1.0 if I<x> is +/-INFINITY, 0.0 otherwise.


=item B<isnan(x)>

Return 1.0 if I<x> is NAN, 0.0 otherwise.


=item B<ld(var)>

Load the value of the internal variable with number
I<var>, which was previously stored with st(I<var>, I<expr>).
The function returns the loaded value.


=item B<lerp(x, y, z)>

Return linear interpolation between I<x> and I<y> by amount of I<z>.


=item B<log(x)>

Compute natural logarithm of I<x>.


=item B<lt(x, y)>

Return 1 if I<x> is lesser than I<y>, 0 otherwise.


=item B<lte(x, y)>

Return 1 if I<x> is lesser than or equal to I<y>, 0 otherwise.


=item B<max(x, y)>

Return the maximum between I<x> and I<y>.


=item B<min(x, y)>

Return the minimum between I<x> and I<y>.


=item B<mod(x, y)>

Compute the remainder of division of I<x> by I<y>.


=item B<not(expr)>

Return 1.0 if I<expr> is zero, 0.0 otherwise.


=item B<pow(x, y)>

Compute the power of I<x> elevated I<y>, it is equivalent to
"(I<x>)^(I<y>)".


=item B<print(t)>


=item B<print(t, l)>

Print the value of expression I<t> with loglevel I<l>. If
I<l> is not specified then a default log level is used.
Returns the value of the expression printed.

Prints t with loglevel l


=item B<random(x)>

Return a pseudo random value between 0.0 and 1.0. I<x> is the index of the
internal variable which will be used to save the seed/state.


=item B<root(expr, max)>

Find an input value for which the function represented by I<expr>
with argument I<ld(0)> is 0 in the interval 0..I<max>.

The expression in I<expr> must denote a continuous function or the
result is undefined.

I<ld(0)> 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
C<ld(0)>. When the expression evaluates to 0 then the
corresponding input value will be returned.


=item B<round(expr)>

Round the value of expression I<expr> to the nearest integer. For example, "round(1.5)" is "2.0".


=item B<sgn(x)>

Compute sign of I<x>.


=item B<sin(x)>

Compute sine of I<x>.


=item B<sinh(x)>

Compute hyperbolic sine of I<x>.


=item B<sqrt(expr)>

Compute the square root of I<expr>. This is equivalent to
"(I<expr>)^.5".


=item B<squish(x)>

Compute expression C<1/(1 + exp(4*x))>.


=item B<st(var, expr)>

Store the value of the expression I<expr> in an internal
variable. I<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.


=item B<tan(x)>

Compute tangent of I<x>.


=item B<tanh(x)>

Compute hyperbolic tangent of I<x>.


=item B<taylor(expr, x)>


=item B<taylor(expr, x, id)>

Evaluate a Taylor series at I<x>, given an expression representing
the C<ld(id)>-th derivative of a function at 0.

When the series does not converge the result is undefined.

I<ld(id)> is used to represent the derivative order in I<expr>,
which means that the given expression will be evaluated multiple times
with various input values that the expression can access through
C<ld(id)>. If I<id> is not specified then 0 is assumed.

Note, when you have the derivatives at y instead of 0,
C<taylor(expr, x-y)> can be used.


=item B<time(0)>

Return the current (wallclock) time in seconds.


=item B<trunc(expr)>

Round the value of expression I<expr> towards zero to the nearest
integer. For example, "trunc(-1.5)" is "-1.0".


=item B<while(cond, expr)>

Evaluate expression I<expr> while the expression I<cond> is
non-zero, and returns the value of the last I<expr> evaluation, or
NAN if I<cond> was always false.

=back


The following constants are available:

=over 4


=item B<PI>

area of the unit disc, approximately 3.14

=item B<E>

exp(1) (Euler's number), approximately 2.718

=item B<PHI>

golden ratio (1+sqrt(5))/2, approximately 1.618

=back


Assuming that an expression is considered "true" if it has a non-zero
value, note that:

C<*> works like AND

C<+> works like OR

For example the construct:
	
	if (A AND B) then C

is equivalent to:
	
	if(A*B, C)


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.

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.

The list of available International System prefixes follows, with
indication of the corresponding powers of 10 and of 2.

=over 4


=item B<y>

10^-24 / 2^-80

=item B<z>

10^-21 / 2^-70

=item B<a>

10^-18 / 2^-60

=item B<f>

10^-15 / 2^-50

=item B<p>

10^-12 / 2^-40

=item B<n>

10^-9 / 2^-30

=item B<u>

10^-6 / 2^-20

=item B<m>

10^-3 / 2^-10

=item B<c>

10^-2

=item B<d>

10^-1

=item B<h>

10^2

=item B<k>

10^3 / 2^10

=item B<K>

10^3 / 2^10

=item B<M>

10^6 / 2^20

=item B<G>

10^9 / 2^30

=item B<T>

10^12 / 2^40

=item B<P>

10^15 / 2^40

=item B<E>

10^18 / 2^50

=item B<Z>

10^21 / 2^60

=item B<Y>

10^24 / 2^70

=back




=head1 SEE ALSO



ffmpeg(1), ffplay(1), ffprobe(1), libavutil(3)


=head1 AUTHORS


The FFmpeg developers.

For details about the authorship, see the Git history of the project
(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command
B<git log> in the FFmpeg source directory, or browsing the
online repository at E<lt>B<https://git.ffmpeg.org/ffmpeg>E<gt>.

Maintainers for the specific components are listed in the file
F<MAINTAINERS> in the source code tree.