Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

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