Macros - staxrip/staxrip GitHub Wiki

Macros

Macros are placeholders that can be used in all locations where StaxRip allows customizing command lines and scripts.

Whenever StaxRip starts a process and shell execute is disabled it passes all macros as environment variables to the process.

Interactive Macros

Interactive macros can be used in certain menus like the filter profiles menu.

Name Description
$browse_file$ File path returned from a file browser.
$enter_text$ Text entered in a input box.
$enter_text:prompt$ Text entered in a input box.
$select:param1;param2;...$ String selected from dropdown, to show a optional message the first parameter has to start with msg: and to give the items optional captions use caption|value. Example: $select:msg:hello;caption1|value1;caption2|value2$

Command Line Audio Encoder

StaxRip supports 2 types of audio encoding profiles, a GUI based profile used for the default audio profiles and a Command Line based profile which supports the following macros:

Name Description
%input% Audio source file
%output% Audio target File
%bitrate% Audio bitrate
%channels% Audio channels count
%delay% Audio delay
%language_native% Native language name
%language_english% English language name
%streamid0% Stream ID of 1st audio
%streamid1% Stream ID of 2nd audio

Global Macros

Name Description
%app:name% Returns the path of a given tool, it can be any type of tool found in the Apps dialog. Example: %app:x265%
%app_dir:name% Returns the directory of a given tool, it can be any type of tool found in the Apps dialog. Example: %app_dir:x265%
%app_path:name% Returns the path of a given tool, it can be any type of tool found in the Apps dialog. Example: %app:x265%
%app_version:name% Returns the version of a given tool, it can be any type of tool found in the Apps dialog. Example: %version:x265%
%audio_bitrate% Overall audio bitrate.
%audio_bitrate1% Audio bitrate of the first audio track.
%audio_bitrate2% Audio bitrate of the second audio track.
%audio_channels1% Audio channels of the first audio track.
%audio_channels2% Audio channels of the second audio track.
%audio_codec1% Audio codec of the first audio track.
%audio_codec2% Audio codec of the second audio track.
%audio_delay1% Audio delay of the first audio track.
%audio_delay2% Audio delay of the second audio track.
%audio_file1% File path of the first audio file.
%audio_file2% File path of the second audio file.
%compressibility% Compressibility value.
%crop_bottom% Bottom crop value.
%crop_height% Crop height.
%crop_left% Left crop value.
%crop_right% Right crop value.
%crop_top% Top crop value.
%crop_width% Crop width.
%current_date% Returns the current date.
%current_time% Returns the current time (12h).
%current_time24% Returns the current time (24h).
%dpi% DPI value of the main dialog.
%encoder% Name of the active video encoder.
%encoder_ext% File extension of the format the encoder of the active project outputs.
%encoder_out_file% Output file of the video encoder.
%encoder_profile% Name of the selected video encoder profile name.
%encoder_settings% Settings of the active video encoder.
%eval:expression% Evaluates a PowerShell expression which may contain macros.
%filter:name% Returns the script code of a filter of the active project that matches the specified name.
%media_info_audio:property% Returns a MediaInfo audio property for the video source file.
%media_info_video:property% Returns a MediaInfo video property for the source file.
%muxer_ext% Output extension of the active muxer.
%player% Path of the media player.
%plugin_dir% AviSynth/VapourSynth plugin auto load directory.
%pos_frame% Current preview position in frames.
%pos_ms% Current preview position in milliseconds.
%processing% Returns 'True' if a job is currently processing otherwise 'False'.
%programs_dir% Programs system directory.
%random:digits% Returns a 'digits' long random number, whereas 'digits' is clamped between 1 and 10.
%script_dir% Users PowerShell scripts directory.
%script_ext% File extension of the AviSynth/VapourSynth script so either avs or vpy.
%script_file% Path of the AviSynth/VapourSynth script.
%sel_end% End position of the first selecion in the preview.
%sel_start% Start position of the first selecion in the preview.
%settings_dir% Path of the settings direcory.
%source_dar% Source display aspect ratio.
%source_dir% Directory of the source file.
%source_dir_name% Name of the source file directory.
%source_dir_parent% Parent directory of the source file directory.
%source_ext% File extension of the source file.
%source_file% File path of the source video.
%source_files% Source files in quotes separated by a blank.
%source_files_comma% Source files in quotes separated by comma.
%source_framerate% Frame rate returned by the source filter AviSynth section.
%source_frames% Length in frames of the source video.
%source_height% Image height of the source video.
%source_name% The name of the source file without file extension.
%source_par_x% Source pixel/sample aspect ratio.
%source_par_y% Source pixel/sample aspect ratio.
%source_seconds% Length in seconds of the source video.
%source_temp_file% File located in the temp directory using the same name as the source file.
%source_video_format% Video codec of the source file.
%source_width% Image width of the source video.
%startup_dir% Directory of the application.
%system_dir% System directory.
%target_dar% Target display aspect ratio.
%target_dir% Directory of the target file.
%target_file% File path of the target file.
%target_framerate% Frame rate of the target video.
%target_frames% Length in frames of the target video.
%target_height% Image height of the target video.
%target_name% Name of the target file without file extension.
%target_par_x% Target pixel/sample aspect ratio.
%target_par_y% Target pixel/sample aspect ratio.
%target_seconds% Length in seconds of the target video.
%target_size% Size of the target video in kilo bytes.
%target_temp_file% File located in the temp directory using the same name as the target file.
%target_width% Image width of the target video.
%temp_dir% Directory of the source file or the temp directory if enabled.
%temp_file% File located in the temp directory using the same name as the source file.
%template_name% Name of the template the active project is based on.
%text_editor% Path of the application currently associated with TXT files.
%version% StaxRip version.
%video_bitrate% Video bitrate in Kbps
%working_dir% Directory of the source file or the temp directory if enabled.