星火微课系统客户端
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

ffmpeg-utils.html 43KB

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