Functions can only be used in the “Populate Variables” Processor. Using Functions you can manipulate strings or numbers, do calculations, read files, parse JSON and much more. The execution of a function typically takes < 1ms, so it is about executing quick actions that are not worth inserting a processor into your workflow.
Usage description:
$function(input-1 = "string", input-2 = integer[, optional input-3 = "string"/integer])
$left | Get string n-characters from the left side. |
$triml | Trim string n-characters from the left side. |
$right | Get string n-characters from the right side. |
$trimr | Trim string n-characters from the right side. |
$middle | Get string n-characters from n-position. |
$between | Get string between two strings. |
$upper | Force string to upper case. |
$lower | Force string to lower case. |
$proper | Capitalizes every first letter following a non-alphanumeric character. |
$replace | Replace string in string. |
$alrep | Replace all non-alphanumeric characters and add optional exceptions. |
$leads | Add leading character(s) to a string. If string to fill is omitted a zero (0) will be used. |
$trails | Add trailing character(s) to a string. If fill-string is omitted a zero (0) will be used. |
$stripws | Removes leading and trailing white spaces. |
$stripcrlf | Strips string for line feed and carriage returns. |
$isdigit | Check if string is only numbers. Success returns 1, failure returns 0. |
$isalpha | Check if string is only alphabetic letters. Success returns 1, failure returns 0. |
$length | Retrieves length of the string (number of characters). |
$reverse | Reverse a string. |
$round | Round number to nearest decimal. |
$roundd | Round number down to nearest integer. |
$roundu | Round number up to nearest integer. |
$inttotc | Convert integer to time code. |
$tctosec | Convert time code to seconds. |
$abs | Returns the absolute value of a number. |
$log | Returns the natural logarithm of a number. |
$random | Returns a random integer number between two integers. |
$exists | This is a file function that will tell if file(s) exists. |
$base64 | Encodes the input string as base 64. |
$jsonencode | Converts the input string to an JSON friendly string. |
$jsonget | Retrieves the value from a JSON object key. Here is an example to retrieve values from ffprobe |
$readarray | Returns an instance from a valid array; “[data, data, etc…]”. |
$regext | This is regular expression function. It extracts text based on recognition patterns. |
$hex | Converts a decimal integer to hexadecimal number. |
$dec | Converts a hexadecimal number to decimal integer. |
$guid | Returns a random GUID/UUID. |
$xxhash | Returns an eight character hash for any file. |
$read | Reads the contents of a any text file. |
$urlencode | Converts the input string to an URL friendly string. |