CLI
Using the command line interface
MX Light's command line interface provides access to all primary functions by means of the command line passed to MXLight.exe. This allows full automation through batch scripts (.bat files) or shell execution from external programs.
Available commands:
Commands are processed in the same order they appear in the command line, from left to right & should be separated by a single space character.
All setup commands should be performed first.
eg.
MXLight.exe stream-profile='my profile' stream=on
MXLight.exe record-to-file='c:\myfile.TS' record=on
MXLight.exe useconf='myconf.cda' stream=on
stream-profile value uses the top node of a preset in the streams.cda file. eg. To select the default RTMP streaming preset which has a top node = '<RTMP.' the command line option is stream-profile='RTMP'. The value is case sensitive so be careful when entering this value.
To reference a stream profile that has been automatically generated by a template preset. The stream-profile value is as above plus the index of the preset generated by the virtual preset. eg. stream-profile='{name} {index}'
For more information on virtual preset see preset help Streaming preset creation - guidelines
useconf is a particularly powerful command, this allows you to load a complete or partial config file to override the current configuration. This includes recorded file name/destination & used streaming profile, so these do not necesserily need to be included in the command line.
If you just want to set the video & audio Kbps of the encoding, you can create a text file that only modifies those properties.
These files must be saved with the extension '.cda'.
The format of these files is very important, so it is safest to start with a copy of the default config.cda & then modify it as required. They should be edited in a plain text editor such as Notepad.
As in the above example the type specifier seen in the config.cda (eg. [TSTR8],[TS32] is not required in these override configuration files. Do not add a different type specifier as this will make the file unreadable.
Only 1 instance of MX Light can be running at any one time, so all command lines are passed to the running instance.
eg.
mxlight.exe preview=on
mxlight.exe exit
will start MX Light & begin previewing, the second line will then cause it to exit.
References to config files can be relative or absolute. eg. useconf='myconf.cda' will attempt to load myconf.cda from the directory mxlight.exe is in.
Specifying a file to record to, needs a complete path.
Available commands:
command |
value(s) |
example |
record | on / off | record=on |
turn recording on or off |
||
record-to-file | {filename} | record-to-file='C:\tmp.TS' |
specify a filename for the next recording |
||
record-split | {takes no values} | record-split |
split the current recording immediately into a new file |
||
preview | on / off | preview=on |
turn preview on or off |
||
stream | on / off | stream=on |
turn streaming on or off |
||
stream-profile | {stream profile name} | stream-profile='my profile name' |
select a streaming preset to use [see below] |
||
useconf | {override config file} | useconf='cfg-cli\2Mbps.cda' |
load config settings [see below] |
||
exit | {takes no values} | exit |
exit MX Light |
||
gui-config | show / hide | gui-config=hide |
set GUI to visible / not visible (taskbar icon) |
||
gui-stats | show / hide | gui-stats=hide |
set status window visiblility |
||
replay-mode |
from / range | replay-mode=from |
set replay mode |
||
replay-speed | {number} | replay-speed=0.3 |
set replay speed |
||
replay-add-cue | {cue name} |
replay-add-cue=newCue |
add a new replay cue at the current point in the recording |
||
replay-play-cue | {cue name} | replay-play-cue=newCue |
start replay from a specified cue |
||
replay-play-last-cue | replay-play-last-cue | |
start replay from last created cue |
||
replay-stop | replay-stop | |
stop the current replay & close plaback window |
||
snapshot | snapshot | |
save a snapshot of the current VLC preview window as a file. nb. the output directory & file format are set in VLC's Video preferences. |
||
lock-state | on / off | lock-state=on |
VLCLive: | {vlc command} | VLCLive:volume 70 |
send the following text to the current VLC preview instances RC interface (if preview is active) |
VLCReplay: | {vlc command} | VLCReplay:volume 70 VLCReplay:pause |
send the following text to the current VLC replay instances RC interface (if replay is active) |
All setup commands should be performed first.
eg.
MXLight.exe stream-profile='my profile' stream=on
MXLight.exe record-to-file='c:\myfile.TS' record=on
MXLight.exe useconf='myconf.cda' stream=on
stream-profile value uses the top node of a preset in the streams.cda file. eg. To select the default RTMP streaming preset which has a top node = '<RTMP.' the command line option is stream-profile='RTMP'. The value is case sensitive so be careful when entering this value.
To reference a stream profile that has been automatically generated by a template preset. The stream-profile value is as above plus the index of the preset generated by the virtual preset. eg. stream-profile='{name} {index}'
For more information on virtual preset see preset help Streaming preset creation - guidelines
useconf is a particularly powerful command, this allows you to load a complete or partial config file to override the current configuration. This includes recorded file name/destination & used streaming profile, so these do not necesserily need to be included in the command line.
If you just want to set the video & audio Kbps of the encoding, you can create a text file that only modifies those properties.
eg.
<MXL.
<encoding.
<video.
kbps. = 2000
>
<audio.
kbps. = 64
>
>
>
Important notes:These files must be saved with the extension '.cda'.
The format of these files is very important, so it is safest to start with a copy of the default config.cda & then modify it as required. They should be edited in a plain text editor such as Notepad.
As in the above example the type specifier seen in the config.cda (eg. [TSTR8],[TS32] is not required in these override configuration files. Do not add a different type specifier as this will make the file unreadable.
Only 1 instance of MX Light can be running at any one time, so all command lines are passed to the running instance.
eg.
mxlight.exe preview=on
mxlight.exe exit
will start MX Light & begin previewing, the second line will then cause it to exit.
References to config files can be relative or absolute. eg. useconf='myconf.cda' will attempt to load myconf.cda from the directory mxlight.exe is in.
Specifying a file to record to, needs a complete path.