This script connects to a predefined list of switchers and changes a few settings at once.
$ python3 change-settings-multi.py -h
[Tue Nov 24 22:50:20 2020] PyATEMMax demo script: change-settings-multi
usage: change-settings-multi.py [-h] [-v MASTERVOLUME] [-w PREVIEW]
[-p PROGRAM] [-m MIXEFFECT]
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-multi.py -v 0.0 -m 1 -p 1 -w 2
[Tue Nov 24 22:51:17 2020] PyATEMMax demo script: change-settings-multi
[Tue Nov 24 22:51:17 2020] Changing settings in all switchers
[Tue Nov 24 22:51:17 2020] - Master volume: 0.0db
[Tue Nov 24 22:51:17 2020] - PGM Video source: 1 on m/e 1
[Tue Nov 24 22:51:17 2020] - PVW Video source: 2 on m/e 1
[Tue Nov 24 22:51:17 2020] Starting settings update
[Tue Nov 24 22:51:18 2020] ERROR: no response from 192.168.1.110
[Tue Nov 24 22:51:18 2020] Settings updated on ATEM Television Studio HD at 192.168.1.111
[Tue Nov 24 22:51:19 2020] ERROR: no response from 192.168.1.112
[Tue Nov 24 22:51:20 2020] ERROR: no response from 192.168.1.113
[Tue Nov 24 22:51:21 2020] ERROR: no response from 192.168.1.114
[Tue Nov 24 22:51:22 2020] ERROR: no response from 192.168.1.115
[Tue Nov 24 22:51:22 2020] FINISHED: 1/6 switchers updated.
Code walkthrough
Start with the usual initial steps (explained in Examples)
In this example, a custom switcher ip list is created:
Start working with the switcher:
First, the ATEMMax object is created and the hit count is initialized:
After that, a loop starts for all configured switchers:
The script tries to connect to the switcher:
Once connected, the provided values are used to change the switcher settings.
If waitForConnection() returned False the script displays an error message.