Provided by: ffmpeg_4.1.4-1build2_amd64

**NAME**

ffmpeg-utils - FFmpeg utilities

**DESCRIPTION**

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

**SYNTAX**

This section documents the syntax and formats employed by the FFmpeg libraries and tools.QuotingandescapingFFmpeg adopts the following quoting and escaping mechanism, unless explicitly specified. The following rules are applied: ·'and\are special characters (respectively used for quoting and escaping). In addition to them, there might be other special characters depending on the specific syntax where the escaping and quoting are employed. · A special character is escaped by prefixing it with a\. · All characters enclosed between''are included literally in the parsed string. The quote character'itself cannot be quoted, so you may need to close the quote and escape it. · Leading and trailing whitespaces, unless escaped or quoted, are removed from the parsed string. Note that you may need to add a second level of escaping when using the command line or a script, which depends on the syntax of the adopted shell language. The function "av_get_token" defined inlibavutil/avstring.hcan be used to parse a token quoted or escaped according to the rules defined above. The tooltools/ffescapein the FFmpeg source tree can be used to automatically quote or escape a string in a script.Examples· Escape the string "Crime d'Amour" containing the "'" special character: Crime d\'Amour · The string above contains a quote, so the "'" needs to be escaped when quoting it: 'Crime d'\''Amour' · Include leading or trailing whitespaces using quoting: ' this string starts and ends with whitespaces ' · Escaping and quoting can be mixed together: ' The string '\'string\'' is a string ' · To include a literal\you can use either escaping or quoting: 'c:\foo' can be written as c:\\fooDateThe accepted syntax is: [(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...]]])|(HHMMSS[.m...]]]))[Z] now If the value is "now" it takes the current time. Time is local time unless Z is appended, in which case it is interpreted as UTC. If the year-month-day part is not specified it takes the current year-month-day.TimedurationThere are two accepted syntaxes for expressing time duration. [-][<HH>:]<MM>:<SS>[.<m>...]HHexpresses the number of hours,MMthe number of minutes for a maximum of 2 digits, andSSthe number of seconds for a maximum of 2 digits. Themat the end expresses decimal value forSS.or[-]<S>+[.<m>...]Sexpresses the number of seconds, with the optional decimal partm. In both expressions, the optional-indicates negative duration.ExamplesThe following examples are all valid time duration:5555 seconds12:03:4512 hours, 03 minutes and 45 seconds23.18923.189 secondsVideosizeSpecify the size of the sourced video, it may be a string of the formwidthxheight, or the name of a size abbreviation. The following abbreviations are recognized:ntsc720x480pal720x576qntsc352x240qpal352x288sntsc640x480spal768x576film352x240ntsc-film352x240sqcif128x96qcif176x144cif352x2884cif704x57616cif1408x1152qqvga160x120qvga320x240vga640x480svga800x600xga1024x768uxga1600x1200qxga2048x1536sxga1280x1024qsxga2560x2048hsxga5120x4096wvga852x480wxga1366x768wsxga1600x1024wuxga1920x1200woxga2560x1600wqsxga3200x2048wquxga3840x2400whsxga6400x4096whuxga7680x4800cga320x200ega640x350hd480852x480hd7201280x720hd10801920x10802k2048x10802kflat1998x10802kscope2048x8584k4096x21604kflat3996x21604kscope4096x1716nhd640x360hqvga240x160wqvga400x240fwqvga432x240hvga480x320qhd960x5402kdci2048x10804kdci4096x2160uhd21603840x2160uhd43207680x4320VideorateSpecify the frame rate of a video, expressed as the number of frames generated per second. It has to be a string in the formatframe_rate_num/frame_rate_den, an integer number, a float number or a valid video frame rate abbreviation. The following abbreviations are recognized:ntsc30000/1001pal25/1qntsc30000/1001qpal25/1sntsc30000/1001spal25/1film24/1ntsc-film24000/1001RatioA ratio can be expressed as an expression, or in the formnumerator:denominator. Note that a ratio with infinite (1/0) or negative value is considered valid, so you should check on the returned value if you want to exclude those values. The undefined value can be expressed using the "0:0" string.ColorIt can be the name of a color as defined below (case insensitive match) or a "[0x|#]RRGGBB[AA]" sequence, possibly followed by @ and a string representing the alpha component. The alpha component may be a string composed by "0x" followed by an hexadecimal number or a decimal number between 0.0 and 1.0, which represents the opacity value (0x00or0.0means completely transparent,0xffor1.0completely opaque). If the alpha component is not specified then0xffis assumed. The stringrandomwill result in a random color. The following names of colors are recognized:AliceBlue0xF0F8FFAntiqueWhite0xFAEBD7Aqua0x00FFFFAquamarine0x7FFFD4Azure0xF0FFFFBeige0xF5F5DCBisque0xFFE4C4Black0x000000BlanchedAlmond0xFFEBCDBlue0x0000FFBlueViolet0x8A2BE2Brown0xA52A2ABurlyWood0xDEB887CadetBlue0x5F9EA0Chartreuse0x7FFF00Chocolate0xD2691ECoral0xFF7F50CornflowerBlue0x6495EDCornsilk0xFFF8DCCrimson0xDC143CCyan0x00FFFFDarkBlue0x00008BDarkCyan0x008B8BDarkGoldenRod0xB8860BDarkGray0xA9A9A9DarkGreen0x006400DarkKhaki0xBDB76BDarkMagenta0x8B008BDarkOliveGreen0x556B2FDarkorange0xFF8C00DarkOrchid0x9932CCDarkRed0x8B0000DarkSalmon0xE9967ADarkSeaGreen0x8FBC8FDarkSlateBlue0x483D8BDarkSlateGray0x2F4F4FDarkTurquoise0x00CED1DarkViolet0x9400D3DeepPink0xFF1493DeepSkyBlue0x00BFFFDimGray0x696969DodgerBlue0x1E90FFFireBrick0xB22222FloralWhite0xFFFAF0ForestGreen0x228B22Fuchsia0xFF00FFGainsboro0xDCDCDCGhostWhite0xF8F8FFGold0xFFD700GoldenRod0xDAA520Gray0x808080Green0x008000GreenYellow0xADFF2FHoneyDew0xF0FFF0HotPink0xFF69B4IndianRed0xCD5C5CIndigo0x4B0082Ivory0xFFFFF0Khaki0xF0E68CLavender0xE6E6FALavenderBlush0xFFF0F5LawnGreen0x7CFC00LemonChiffon0xFFFACDLightBlue0xADD8E6LightCoral0xF08080LightCyan0xE0FFFFLightGoldenRodYellow0xFAFAD2LightGreen0x90EE90LightGrey0xD3D3D3LightPink0xFFB6C1LightSalmon0xFFA07ALightSeaGreen0x20B2AALightSkyBlue0x87CEFALightSlateGray0x778899LightSteelBlue0xB0C4DELightYellow0xFFFFE0Lime0x00FF00LimeGreen0x32CD32Linen0xFAF0E6Magenta0xFF00FFMaroon0x800000MediumAquaMarine0x66CDAAMediumBlue0x0000CDMediumOrchid0xBA55D3MediumPurple0x9370D8MediumSeaGreen0x3CB371MediumSlateBlue0x7B68EEMediumSpringGreen0x00FA9AMediumTurquoise0x48D1CCMediumVioletRed0xC71585MidnightBlue0x191970MintCream0xF5FFFAMistyRose0xFFE4E1Moccasin0xFFE4B5NavajoWhite0xFFDEADNavy0x000080OldLace0xFDF5E6Olive0x808000OliveDrab0x6B8E23Orange0xFFA500OrangeRed0xFF4500Orchid0xDA70D6PaleGoldenRod0xEEE8AAPaleGreen0x98FB98PaleTurquoise0xAFEEEEPaleVioletRed0xD87093PapayaWhip0xFFEFD5PeachPuff0xFFDAB9Peru0xCD853FPink0xFFC0CBPlum0xDDA0DDPowderBlue0xB0E0E6Purple0x800080Red0xFF0000RosyBrown0xBC8F8FRoyalBlue0x4169E1SaddleBrown0x8B4513Salmon0xFA8072SandyBrown0xF4A460SeaGreen0x2E8B57SeaShell0xFFF5EESienna0xA0522DSilver0xC0C0C0SkyBlue0x87CEEBSlateBlue0x6A5ACDSlateGray0x708090Snow0xFFFAFASpringGreen0x00FF7FSteelBlue0x4682B4Tan0xD2B48CTeal0x008080Thistle0xD8BFD8Tomato0xFF6347Turquoise0x40E0D0Violet0xEE82EEWheat0xF5DEB3White0xFFFFFFWhiteSmoke0xF5F5F5Yellow0xFFFF00YellowGreen0x9ACD32ChannelLayoutA channel layout specifies the spatial disposition of the channels in a multi-channel audio stream. To specify a channel layout, FFmpeg makes use of a special syntax. Individual channels are identified by an id, as given by the table below:FLfront leftFRfront rightFCfront centerLFElow frequencyBLback leftBRback rightFLCfront left-of-centerFRCfront right-of-centerBCback centerSLside leftSRside rightTCtop centerTFLtop front leftTFCtop front centerTFRtop front rightTBLtop back leftTBCtop back centerTBRtop back rightDLdownmix leftDRdownmix rightWLwide leftWRwide rightSDLsurround direct leftSDRsurround direct rightLFE2low frequency 2 Standard channel layout compositions can be specified by using the following identifiers:monoFCstereoFL+FR2.1FL+FR+LFE3.0FL+FR+FC3.0(back)FL+FR+BC4.0FL+FR+FC+BCquadFL+FR+BL+BRquad(side)FL+FR+SL+SR3.1FL+FR+FC+LFE5.0FL+FR+FC+BL+BR5.0(side)FL+FR+FC+SL+SR4.1FL+FR+FC+LFE+BC5.1FL+FR+FC+LFE+BL+BR5.1(side)FL+FR+FC+LFE+SL+SR6.0FL+FR+FC+BC+SL+SR6.0(front)FL+FR+FLC+FRC+SL+SRhexagonalFL+FR+FC+BL+BR+BC6.1FL+FR+FC+LFE+BC+SL+SR6.1FL+FR+FC+LFE+BL+BR+BC6.1(front)FL+FR+LFE+FLC+FRC+SL+SR7.0FL+FR+FC+BL+BR+SL+SR7.0(front)FL+FR+FC+FLC+FRC+SL+SR7.1FL+FR+FC+LFE+BL+BR+SL+SR7.1(wide)FL+FR+FC+LFE+BL+BR+FLC+FRC7.1(wide-side)FL+FR+FC+LFE+FLC+FRC+SL+SRoctagonalFL+FR+FC+BL+BR+BC+SL+SRdownmixDL+DR A custom channel layout can be specified as a sequence of terms, separated by '+' or '|'. Each term can be: · the name of a standard channel layout (e.g.mono,stereo,4.0,quad,5.0, etc.) · the name of a single channel (e.g.FL,FR,FC,LFE, etc.) · a number of channels, in decimal, followed by 'c', yielding the default channel layout for that number of channels (see the function "av_get_default_channel_layout"). Note that not all channel counts have a default layout. · a number of channels, in decimal, followed by 'C', yielding an unknown channel layout with the specified number of channels. Note that not all channel layout specification strings support unknown channel layouts. · a channel layout mask, in hexadecimal starting with "0x" (see the "AV_CH_*" macros inlibavutil/channel_layout.h. Before libavutil version 53 the trailing character "c" to specify a number of channels was optional, but now it is required, while a channel layout mask can also be specified as a decimal number (if and only if not followed by "c" or "C"). See also the function "av_get_channel_layout" defined inlibavutil/channel_layout.h.

**EXPRESSION** **EVALUATION**

When evaluating an arithmetic expression, FFmpeg uses an internal formula evaluator, implemented through thelibavutil/eval.hinterface. An expression may contain unary, binary operators, constants, and functions. Two expressionsexpr1andexpr2can be combined to form another expression "expr1;expr2".expr1andexpr2are evaluated in turn, and the new expression evaluates to the value ofexpr2. The following binary operators are available: "+", "-", "*", "/", "^". The following unary operators are available: "+", "-". The following functions are available:abs(x)Compute absolute value ofx.acos(x)Compute arccosine ofx.asin(x)Compute arcsine ofx.atan(x)Compute arctangent ofx.atan2(x,y)Compute principal value of the arc tangent ofy/x.between(x,min,max)Return 1 ifxis greater than or equal tominand lesser than or equal tomax, 0 otherwise.bitand(x,y)bitor(x,y)Compute bitwise and/or operation onxandy. The results of the evaluation ofxandyare converted to integers before executing the bitwise operation. Note that both the conversion to integer and the conversion back to floating point can lose precision. Beware of unexpected results for large numbers (usually 2^53 and larger).ceil(expr)Round the value of expressionexprupwards to the nearest integer. For example, "ceil(1.5)" is "2.0".clip(x,min,max)Return the value ofxclipped betweenminandmax.cos(x)Compute cosine ofx.cosh(x)Compute hyperbolic cosine ofx.eq(x,y)Return 1 ifxandyare equivalent, 0 otherwise.exp(x)Compute exponential ofx(with base "e", the Euler's number).floor(expr)Round the value of expressionexprdownwards to the nearest integer. For example, "floor(-1.5)" is "-2.0".gauss(x)Compute Gauss function ofx, corresponding to "exp(-x*x/2) / sqrt(2*PI)".gcd(x,y)Return the greatest common divisor ofxandy. If bothxandyare 0 or either or both are less than zero then behavior is undefined.gt(x,y)Return 1 ifxis greater thany, 0 otherwise.gte(x,y)Return 1 ifxis greater than or equal toy, 0 otherwise.hypot(x,y)This function is similar to the C function with the same name; it returns "sqrt(x*x+y*y)", the length of the hypotenuse of a right triangle with sides of lengthxandy, or the distance of the point (x,y) from the origin.if(x,y)Evaluatex, and if the result is non-zero return the result of the evaluation ofy, return 0 otherwise.if(x,y,z)Evaluatex, and if the result is non-zero return the evaluation result ofy, otherwise the evaluation result ofz.ifnot(x,y)Evaluatex, and if the result is zero return the result of the evaluation ofy, return 0 otherwise.ifnot(x,y,z)Evaluatex, and if the result is zero return the evaluation result ofy, otherwise the evaluation result ofz.isinf(x)Return 1.0 ifxis +/-INFINITY, 0.0 otherwise.isnan(x)Return 1.0 ifxis NAN, 0.0 otherwise.ld(var)Load the value of the internal variable with numbervar, which was previously stored with st(var,expr). The function returns the loaded value.lerp(x,y,z)Return linear interpolation betweenxandyby amount ofz.log(x)Compute natural logarithm ofx.lt(x,y)Return 1 ifxis lesser thany, 0 otherwise.lte(x,y)Return 1 ifxis lesser than or equal toy, 0 otherwise.max(x,y)Return the maximum betweenxandy.min(x,y)Return the minimum betweenxandy.mod(x,y)Compute the remainder of division ofxbyy.not(expr)Return 1.0 ifexpris zero, 0.0 otherwise.pow(x,y)Compute the power ofxelevatedy, it is equivalent to "(x)^(y)".print(t)print(t,l)Print the value of expressiontwith loglevell. Iflis not specified then a default log level is used. Returns the value of the expression printed. Prints t with loglevel lrandom(x)Return a pseudo random value between 0.0 and 1.0.xis the index of the internal variable which will be used to save the seed/state.root(expr,max)Find an input value for which the function represented byexprwith argumentis 0 in the interval 0..ld(0)max. The expression inexprmust denote a continuous function or the result is undefined.is used to represent the function input value, which means that the given expression will be evaluated multiple times with various input values that the expression can access through ld(0). When the expression evaluates to 0 then the corresponding input value will be returned.ld(0)round(expr)Round the value of expressionexprto the nearest integer. For example, "round(1.5)" is "2.0".sin(x)Compute sine ofx.sinh(x)Compute hyperbolic sine ofx.sqrt(expr)Compute the square root ofexpr. This is equivalent to "(expr)^.5".squish(x)Compute expression "1/(1 + exp(4*x))".st(var,expr)Store the value of the expressionexprin an internal variable.varspecifies the number of the variable where to store the value, and it is a value ranging from 0 to 9. The function returns the value stored in the internal variable. Note, Variables are currently not shared between expressions.tan(x)Compute tangent ofx.tanh(x)Compute hyperbolic tangent ofx.taylor(expr,x)taylor(expr,x,id)Evaluate a Taylor series atx, given an expression representing the "ld(id)"-th derivative of a function at 0. When the series does not converge the result is undefined.ld(id)is used to represent the derivative order inexpr, which means that the given expression will be evaluated multiple times with various input values that the expression can access through "ld(id)". Ifidis not specified then 0 is assumed. Note, when you have the derivatives at y instead of 0, "taylor(expr, x-y)" can be used.time(0)Return the current (wallclock) time in seconds.trunc(expr)Round the value of expressionexprtowards zero to the nearest integer. For example, "trunc(-1.5)" is "-1.0".while(cond,expr)Evaluate expressionexprwhile the expressioncondis non-zero, and returns the value of the lastexprevaluation, or NAN ifcondwas always false. The following constants are available:PIarea of the unit disc, approximately 3.14Eexp(1) (Euler's number), approximately 2.718PHIgolden ratio (1+sqrt(5))/2, approximately 1.618 Assuming that an expression is considered "true" if it has a non-zero value, note that: "*" works like AND "+" works like OR For example the construct: if (A AND B) then C is equivalent to: if(A*B, C) In your C code, you can extend the list of unary and binary functions, and define recognized constants, so that they are available for your expressions. The evaluator also recognizes the International System unit prefixes. If 'i' is appended after the prefix, binary prefixes are used, which are based on powers of 1024 instead of powers of 1000. The 'B' postfix multiplies the value by 8, and can be appended after a unit prefix or used alone. This allows using for example 'KB', 'MiB', 'G' and 'B' as number postfix. The list of available International System prefixes follows, with indication of the corresponding powers of 10 and of 2.y10^-24 / 2^-80z10^-21 / 2^-70a10^-18 / 2^-60f10^-15 / 2^-50p10^-12 / 2^-40n10^-9 / 2^-30u10^-6 / 2^-20m10^-3 / 2^-10c10^-2d10^-1h10^2k10^3 / 2^10K10^3 / 2^10M10^6 / 2^20G10^9 / 2^30T10^12 / 2^40P10^15 / 2^40E10^18 / 2^50Z10^21 / 2^60Y10^24 / 2^70

**SEE** **ALSO**

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

**AUTHORS**

The FFmpeg developers. For details about the authorship, see the Git history of the project (git://source.ffmpeg.org/ffmpeg), e.g. by typing the commandgitlogin the FFmpeg source directory, or browsing the online repository at <http://source.ffmpeg.org>. Maintainers for the specific components are listed in the fileMAINTAINERSin the source code tree. FFMPEG-UTILS(1)