ffmpeg-utils.html 44 KB

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