Variables are used to adapt and alter your workflow jobs to fit your output needs and incoming media. A variable is represented by a text string encapsulated with the percentage (%) character: %f_fps%, %username%, %s_original_name% etc… FFAStrans variables are always prefixed with a “s_” (string), “i_” (integer) or “f_” (float):
%s_v_codec% —> DNxHD120
%i_height% —> 1080
%f_fps% —> 29,97
FFAStrans has 3 kind of variables: Generic inbuilt variables, special inbuilt variables and user variables.
These variables are automatically populated. If variable cannot be populated, they will mostly have an empty string or a zero (0), (e.g: height or width for an audio file, number of audio channels for a video file, mxf version for a quicktime file, etc). FFAStrans has 5 types of generic inbuilt variables :
Variables are generally populated on the fly when needed.
You can call all these generic inbuilt variables when you want and insert it by pressing the arrow-button next to a text field. All fields that has an arrow next to it supports variables.
Media properties are derived from the original input file. Different types of media can contain different kind of properties
Video Variables Audio Variables
|%i_v_streams%||Number of video streams (1).||%i_a_streams%||Number of audio streams (4).|
|%i_v_bitrate%||Video bitrate of first video stream (50000).||%i_a_bitrate%||Audio bitrate of first audio stream (128).|
|%i_frames%||Media length in frames (2600).||%i_a_bit_depth%||Bit depth of first audio stream (16).|
|%s_pixel_format%||Pixel format of first video stream (yuv422p).||%i_a_channels%||Total number of audio channels (2).|
|%f_frame_rate%||Frames per second (29.97).||%i_a_sample_rate%||Audio sample rate of first audio stream(48000).|
|%s_v_codec%||Codec of first video stream (mpeg2video).||%s_a_codec%||Codec of first audio stream (pcm_s16le).|
|%s_v_profile%||The profile of the first video stream.||%s_a_profile%||The profile of the first audio stream.|
|%i_v_first%||Stream number of the first video stream.||%i_a_first%||Stream number of the first audio stream.|
|%s_pix_aspect%||Pixel aspect of the first video stream (16:9).||%i_tot_channels%||The total number of audio channels.|
|%f_duration%||Media length in seconds (137.48).||%f_duration%||Media length in seconds (137.48).|
|%i_interlace%||Field domination(0=Progressive, 1=Upper, 2=Lower (1)).||%s_a_layout%||Return audio layout as array. First instance is number of channels in first audio stream, etc.|
|%s_date_created%||Creation date of media (2015-15-11 21:16:33).||%s_date_created%||Creation date of media (2015-15-11 21:16:33).|
|%i_height%||Media video height of first video stream (1080).|
|%i_width%||Media video width of first video stream (1920).|
|%s_v_codec_long%||Long codec name of first video stream (Windows Media Video 2).|
|%s_disp_aspect%||Display aspect of the first video stream (1:1).|
|%s_color_space%||Color space of the first video.|
|%s_color_trans%||Color transfer of the first video.|
|%s_color_prim%||Color primaries of the first video.|
|%s_color_range%||Color range of the first video.|
|%i_intra%||Checks if media is intra frame based. Return 1 if true, 0 otherwise.|
|%i_rotation%||Find the rotation/orientation of the source media.|
|%s_duration_tc%||Media duration as time code (00:05:10:12).|
|%s_date_created%||Creation date of media (2015-15-11 21:16:33).|
|%f_start_sec%||Start TC converted to seconds (2591.96).|
|%i_stc_hh%||Start hour from TC.|
|%i_stc_mm%||Start minute from TC.|
|%i_stc_ss%||Start second from TC.|
|%i_stc_ff%||Start frame from TC.|
|%s_start_tc%||Start TC of Media (01:13:48:20).|
|%s_format%||Format name of the container.|
|%s_mxf_version%||Checks the mxf version used in the MXF source.|
|%s_mxf_op%||Find the operational pattern used in the MXF source.|
|%s_format_long%||Long format name of the container.|
|%s_master_display%||Master display info if present on PQ/HDR10 video.|
|%s_info_ffprobe%||Complete media info from ffprobe in JSON format.|
|%s_info_exiftool%||Complete media info from exiftool in JSON format.|
|%s_info_mediainfo%||Complete media info from mediainfo in JSON format.|
|%i_max_fall%||Maximum program average frame light level in nits.|
|%i_max_cll%||Maximum program light level in nits.|
File properties are derived from the original input file. ALL files has these properties so they will allways be populated with data.
|%s_original_attrib%||Attributes of the original file (RASH).|
|%s_original_full%||Full path original file name as picket up by monitor or manually submitted.|
|%s_original_name%||Original filename without extension and path.|
|%s_original_path%||Path of original file.|
|%s_original_folder%||Path of original without drive or UNC.|
|%s_original_path~n%||Folder name n-steps backwards.|
|%i_original_size%||File size of original in bytes.|
|%s_original_date%||Creation date of original file (YYYY-MM-DD_hh-mm-ss).|
|%i_original_year%||Creation year of original file, e.g. 2020|
|%i_original_mon%||Creation month of original file. [1-12]|
|%i_original_day%||Creation day of original file. [1-31]|
|%i_original_hour%||Creation hour of original file.|
|%i_original_min%||Creation minute of original file.|
|%i_original_sec%||Creation second of original file.|
|%s_original_drive%||Drive or UNC server of the original file.|
|%s_pickup_file%||Full path to the original file picked up by the monitors.|
|%s_recursed_path%||Path of original without drive/UNC, monitored path and filename.|
|%i_source_size%||File size of current source in bytes.|
These variables, also called system enviroments, are the ones that resides within the OS independent of FFAStrans. But all can be utilized within FFAStrans. F.ex. the variable %username% is a part of the OS variables. OS variables are in fact statics(see user variable/statics) that don't change from job to job, or workflow to workflow.
These variables are specific and depend of each system. You can find the list of all variables here : https://en.wikipedia.org/wiki/Environment_variable#Windows
We can find for example %APPDATA% –>C:\Users\Share\AppData\Roaming.
Or %windir% –> C:\Windows
These are a selection of time variables read from the system time.
|%i_year%||Full year (2020).|
|%i_yr%||Short year (20).|
|%s_mon%||Abbrevated month name going Jan. to Dec.|
|%s_month%||Month name going January to December.|
|%i_mday%||Day of month (01-31).|
|%i_wday%||Numeric day of week. Starting on Sunday (1) through Saturday (7).|
|%i_yday%||Current day of year. Range is 001 to 366 (or 001 to 365 if not a leap year).|
|%s_week_day%||Weekday name going Sunday to Saturday.|
|%s_w_day%||Abbrevated weekday name going Sun. to Sat.|
|%i_week%||Week number of the year.|
These are variables generated by FFAStrans. F.ex. %s_wf_name% holds the name of the workflow on where the job runs.
|%s_job_id%||GUID identifier for the current job (20160219-202314-181-4693BFCC0A72).|
|%s_job_work%||Work folder for the current job (D:\_ffas_workroot\2015052120481\20160219-202314-181-4693BFCC0A72).|
|%s_wf_id%||Identifier for the current workflow (20150521204819).|
|%s_wf_name%||Name of the current workflow (Untitled).|
|%s_node_name%||Name of the current working processor node (XDCAM-HD).|
|%s_source%||Full path to the file work file passed by FFAStrans processors.|
|%s_root_work%||Path to the global root work directory.|
|%s_ffastrans_dir%||Path to the local FFAStrans.exe file.|
|%s_ffmpeg%||Full path to the ffmpeg.exe file.|
|%s_ffmpegx64%||Full path to the ffmpegx64.exe file.|
|%s_prev_node%||Name of the previous processor node.|
|%s_error%||Current error message/state.|
|%s_cache_record%||Full path to the cache history record file created by the monitors.|
|%s_source_dir%||Path to the files passed by some FFAStrans processors.|
There is currently one variable that behave a bit different than others:
%s_original_path~n% = Folder name n-steps backwards.
%s_source% represent the input file for any processor. It can be altered using the “Populate variables”-node.
%s_success% represent the success message upon job completion. It can be altered using the “Populate variables”-node.
In this example, the objective is to ensure that the input file has a video stream to perform the H264 encoding. Otherwise a message in the status monitor and in Webinterface's jobs list will appear. In this particular workflow, each branch leads to a success(but “no video” node isn't one for the user). The trick is to turn that success into “error” for user. Don't forget to use “execute on success”(conditional “TRUE”) to continue to H264 node OR “execute on error”(conditional “FALSE”) to continue to another node.
You just have to finish your branch by populated the %s_success% variable to a message of your choice e.g: “error” or “failed” or for the example “No video in input file”.
Normal User Variable : User variables can be populated using the “Populate variables” node within a workflow, a number of other processors like the Loudness Analyzer and via API
Populate Variables help
User Variable Values are valid only for the current Branch and it's Child-branches. User Variables cannot be passed directly from one Branch to another.
How to create and set :
Static User Variable : This is another kind of variable. Unlike other variables, static variables are always written with upper case.Creating statics are very handy for example representing a very long path in a short static.
%S_MS_OUTPUT% = D:\Media\Customer previews\Huge important company\720p\Windows Media Video\500k bitrate with watermark
Example 2 :
In this example we have several monitor folder nodes with the same input folder.Only accept files or deny files are different.
If a full path is entered, it will work but all paths will have to be changed if the input folder is changed.
Static variables are handy to avoid this.
If your input path change, just edit and modify the content of %S_INGEST_PATH% and all the paths will be changed at the same time.