Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

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