Table of Contents

Functions

All these functions will manipulate character strings to fit your needs. Functions can use into conditional node and populate variable node and keep the result in a variable.

There are 3 groups of functions :

  1. Other functions

Other Functions

$exists

Usage:
$exists(input string = “string/%variable%”)

$exists(“C:\Windows\explorer.exe”) 1

$exists(“C:\Windows\system32\win*”) 98

$exists("\\NAS\MOVIES\ORIGINAL\FILM1.MXF",1 ,1) \\NAS\MOVIES\ORIGINAL\FILM1.MXF
(First “,1” tell the function to output ONE file, which is the first match it can find. Second “,1” tells the function to look into subfolders.)

$exists("\\NAS\MOVIES\ORIGINAL\FILM*.MXF",2 ,1) [“\\NAS\\MOVIES\\ORIGINAL\\FILM1.MXF”,“\\NAS\\MOVIES\\ORIGINAL\\FILM2.MXF”,“\\NAS\\MOVIES\\ORIGINAL\\FILM3.MXF”]
“,2” tells the function to return an array (list) of matches.
“,3” tells the function to return a basic string list of files separated with an <enter>.


$base64

Usage:

$base64(input string =“string/%variable%”)

$base64(“FFAStrans”)= RkZBU3RyYW5z


$base64dec

Usage :
$base64dec(input string =“string/%variable%”)

$base64dec(“RkZBU3RyYW5z”) FFAStrans


$jsonencode, $jsonget and $jsonput

That this does not produce any JSON data structure but one can use the result as a “Value” in a JSON data structure. This can be used in order to produce a JSON string for further automatic processing, e.g. send a POST request to some 3rdparty API using the HTTP Request processor. Or to write a JSON File using the Write File processor.

Understanding FFAStrans JSON functions :



Usages:
$jsonencode(input string = “string/%variable%”)
$jsonget(input string = “string/%variable%”[, input string = “string/%variable%”])
$jsonput(input string =“string/%variable%”, input string = “string/%variable%”, input string = “string/%variable%”)

$jsonencode(“D:\My\Media\folder”) D:\\My\\Media\\folder

$jsonencode('Hello “World”') Hello \“World\”

$jsonget('{“things”:{“myStuff”:“some other stuff”}}', “things.myStuff”) some other stuff

jsonget Usage Example to retrieve values from ffprobe:

$jsonget('%s_info_ffprobe%', 'streams[1].format_name') mov,mp4,m4a,3gp,3g2,mj2

You can use online tools to generate the selection string (streams[1].format_name) like this: http://jsonpathfinder.com/ Best Practice is to use a Write File Processor and write %s_info_ffprobe% to a file. This gives you the full JSON structure of your file. You can use the resulting JSON in above mentioned online tools.


$readarray

This can be used in combination with another processor which generates JSON on output, for example loudness filter or in combination again with a HTTP Get processor that receives JSON data from a 3rdparty API.

Usage:
$readarray(input string = “string/%variable%”[, input integer = integer/%variable%])

$readarray(“[23, 55.5, 19]”, 2) 55.5

$readarray('[“make”, “my”, “day”]', 3) day

The array starts at 1 instead of 0

$regext

Usage :
$regext(input string = “string/%variable%”, pattern = “string/%variable%”)

$regext(“<Duration value=“1214”/>”, “<Duration value=”(\d+)“/>”) 1214

$regext(“TVShow_EP0013.mxf”, “/(EP\d{4})/”) EP0013


$hex and $dec

Usages :
$hex(input integer = integer/%variable%)
$dec(input string/integer = “string”/integer/%variable%)

$hex(8) 8           $hex(15) f

$dec(8) 8           $dec(“f”) 15


$guid

Usage :
$guid()

$guid() bc067580-f7de-4e12-9f84-7e905bd60378


$xxhash

Usage :
$xxhash(input string = “string/%variable%”)

$xxhash(“x:\path\to\file.mxf”) 61abf926


$read

Usage :
$read(input string = “string/%variable%”)

$read(“metadata.xml”)


$urlencode

Usage :
$urlencode(input string = “string/%variable%”)

$urlencode(“FFAStrans is #supercool!”) FFAStrans%20is%20%23supercool!


$week

Usage :
$week([input number=YEAR/“%variable%”, input number=MONTH/“%variable%”, input number=MONTH DAY/“%variable%”])

$week(2020, 10, 15) 42

A week goes from Monday to Sunday.

$weekday

Usage :
$weekday([input number=YEAR/“%variable%”, input number=MONTH/“%variable%”, input number=MONTH DAY/“%variable%”])

$weekday(2020, 10, 15) 5

The number 1 is Sunday. Monday is 2, Tuesday is 3, etc.

$lookup

Usage :
$lookup(input array =“REFERENCE/%variable%”, inputarray =“TABLE/%variable%”, input string =“SEARCH/%variable%”)

$lookup('[“joe”, “bill”, “greg”]', '[“lucy”, “evy”, “jane”]', “evy”) bill


$lookuprep

Usage :
$lookuprep(input array =“REFERENCE/%variable%”, input array =“TABLE/%variable%”, input string =“SEARCH/%variable%”)

$lookuprep('[“joe”, “bill”, “greg”]', '[“lucy”, “evy”, “jane”]', “lucylindajane”) joelindagreg


$foreach

Usage :
$foreach(input string =“string/%variable%”, input string =“OPERATION/%variable%”)

$foreach('[“jack”, “joe”, “jill”, “jane”, “james”, “jules”]', '$triml(“%$%”, 2)') [“ck”, “e”, “ll”, “ne”, “mes”, “les”]

$foreach('[“jack”, “joe”, “jill”, “jane”, “james”, “jules”]', '%i% - %$%') [“1 - jack”, “2 - joe”, “3 - jill”, “4 - jane”, “5 - james”, “6 - jules”]

$foreach('[10, 11, 12, 10, 20, -6]', '%$%-%i%') [9, 9, 9, 6, 15, -12]


$sort

Usage :
$sort(input string/array =“string/%variable%”[, input string =“SEPARATOR/%variable%”])

$sort(“[6,2,4,3,5]”) [2,3,4,5,6]

$sort('[“jack”, “joe”, “jill”, “jane”, “james”, “jules”]') [“jack”, “james”, “jane”, “jill”, “joe”, “jules”]


$stringf

Usage :

$stringf(input string =“string/%variable%”, input data/array =“ARGUMENTS/%variable%”)

$stringf('%05d', 12) 00012

$stringf('%02i\%02i\%04i', '[1,8,2021]') 01\08\2021


$fsize

Usage :

$fsize(input string =“string/%variable%”)

$fsize(“D:\Replace spaces in filename”) 57162


$fext

Usage :

$fext(input string =“string/%variable%”)

$fext(“D:\Replace spaces in filename.mp4”) mp4


$fname

Usage :

$fname(input string =“string/%variable%”)

$fname(“D:\my_file.mxf”) my_file


$fpath

Usage :

$fpath(input string =“string/%variable%”)

$fpath(“D:\cool folder\right_here\my_file.mxf”) D:\cool folder\right_here


$fdrive

Usage :

$fdrive(input string =“string/%variable%”)

$fdrive(“D:\cool folder\right_here\my_file.mxf”) D:


$asplit

Usage :

$asplit(input string/array =“string/%variable%”[, input string =“SEPARATOR/%variable%”])

$asplit(“[6,2,4,3,5]”, “|”) 6|2|3|4|5

$asplit('[“jack”, “joe”, “jill”, “jane”, “james”, “jules”]')

jack

joe

jill

jane

james

jules


$ffconcat

Usage :

$ffconcat(input string/array =“string/%variable%”)

$ffconcat('[“c:\myClips\video1.mov”, “c:\myClips\video1.mov”, “c:\myClips\video3.mov”]')

ffconcat version 1.0

file 'c:\myClips\video1.mov'

file 'c:\myClips\video2.mov'

file 'c:\myClips\video3.mov'


$owner

Usage :

$owner(input string =“string/%variable%”)

$owner(“D:\cool folder\right_here\my_file.mxf”) domain/ElonMusk


$waccess

Usage :

$waccess(input string =“string/%variable%”)

$waccess(“D:\cool folder\right_here”) 1


$dateweek

Usage :

dateweek(input integer = integer/%variable%[, input integer = integer/%variable%, input integer = integer/%variable%, input string =“string/%variable%”])

(find date of week no. 35, the second day of the week starting on monday) $dateweek(1973, 35, 2, 'mon') 1973_08_28


$timecalc

y = year, M = month, d = day, w = week, h = hour, m = minute, s = second

Usage :

$timecalc(input integer = integer/%variable%[, input integer = integer/%variable%, input integer = integer/%variable%, input string =“string/%variable%”])

(add 60 days) $timecalc('d', 60, '2019/11/24') 2020_01_23

(add 3 hours) $timecalc('h', 3, '2019/11/24 22:35:00') 2019_11_25 01:35:00


$shortcut

Usage :

$shortcut(input string =“string/%variable%”)

$shortcut(“c:\users\myname\desktop\cool video.mkv - Shortcut.lnk”) \\server\some_share\projects\REALITY_SHOW\my video files\cool video.mkv


                                                                                                          Back to top