This script connects to a switcher and changes a few settings at once.
$ python3 change-settings.py -h
[Tue Nov 24 22:36:06 2020] PyATEMMax demo script: change-settings
usage: change-settings.py [-h] [-v MASTERVOLUME] [-w PREVIEW] [-p PROGRAM]
[-m MIXEFFECT]
ip
positional arguments:
ip switcher IP address
optional arguments:
-h, --help show this help message and exit
-v MASTERVOLUME, --mastervolume MASTERVOLUME
master volume (dB)
-w PREVIEW, --preview PREVIEW
set preview video source
-p PROGRAM, --program PROGRAM
set program video source
-m MIXEFFECT, --mixeffect MIXEFFECT
select mix effect (0/1), default 0
$ python3 change-settings.py 192.168.1.111 -v 1.7 -p 3 -w 2
[Tue Nov 24 22:37:26 2020] PyATEMMax demo script: change-settings
[Tue Nov 24 22:37:26 2020] Changing settings in 192.168.1.111
[Tue Nov 24 22:37:26 2020] - Master volume: 1.7db
[Tue Nov 24 22:37:26 2020] - PGM Video source: 3 on m/e 0
[Tue Nov 24 22:37:26 2020] - PVW Video source: 2 on m/e 0
[Tue Nov 24 22:37:26 2020] Starting settings update
[Tue Nov 24 22:37:26 2020] Connecting to 192.168.1.111
[Tue Nov 24 22:37:26 2020] Settings updated on ATEM Television Studio HD at 192.168.1.111
Code walkthrough
Start with the usual initial steps (explained in Examples)
Start working with the switcher:
First, the ATEMMax object is created the script waits for connection:
Once connected, the provided values are used to change the switcher settings.
If waitForConnection() returned False the script displays an error message.