Macros

Macros are placeholders that can be used in all locations where StaxRip allows to customize 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$ Filepath 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 following macros:

Name Description
%input% Audio source file
%output% Audio target File
%bitrate% Audio bitrate
%delay% Audio delay
%channels% Audio channels count
%language_native% Native language name
%language_english% English language name

Global Macros

Name Description
%app:name% Returns the path of a tool, it can be any type of tool found in the Apps dialog. Example: %app:qtgmc%
%app_dir:name% Returns the directory of a tool, it can be any type of tool found in the Apps dialog. Example: %app_dir:x265%
%audio_bitrate% Overall audio bitrate.
%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.
%delay% Audio delay of the first audio track.
%delay2% Audio delay of the second audio track.
%dpi% DPI value of the main dialog.
%encoder_ext% File extension of the format the encoder of the active project outputs.
%encoder_out_file% Output file of the video encoder.
%eval:expression% Evaluates a PowerShell expression which may contain macros.
%eval_ps:expression% This macro is obsolete since 2020.
%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.
%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
%video_encoder% Depending on which video encoder is active returns x264, x265, nvenc, qsvenc, vceenc, aomenc, ffmpeg or xvid_encraw.
%working_dir% Directory of the source file or the temp directory if enabled.