In general the operation of the node is dependent on the ATEM it's self. This node stores information such as the input properties, keyer information etc but the ATEM is expected to update the information stored. The node is seperated into several commands that can be performed that all follow the research by SKAARHOJ found at https://www.skaarhoj.com/fileadmin/BMDPROTOCOL.html.
The general command layout is the same for most functions as seen below. In general the "raw" part of the command defines the raw information passed by the ATEM. The "cmd" portion defines what command has been found and processed with the "data" being the outputted information from the supported command.
//Received Information Format
var msg.payload = {
"cmd": "The command",
"raw": {
"flag": "The flag of the packet that was sent",
"length": "The length of the packet",
"name": "The command name",
"packet": "The raw packet"
},
"data": {
"The data outputted by a supported Command."
},
}
//Send Information Format
var msg.payload = {
"cmd": "The command",
"data": {
"The data outputted by a supported Command. Note if this is empty it will return allstored data"
},
}
[{"id":"78488d8.fa1d574","type":"function","z":"4ecf69fc.958c48","name":"Change Program Input On ME 0 To Input 1","func":"var msg1 = {\n \"payload\": {\n \"cmd\": \"programInput\",\n \"data\": {\n \"ME\": 0,\n \"videoSource\": {\n \"id\": 0\n }\n }\n }\n}\nreturn msg1;","outputs":1,"noerr":0,"x":611,"y":180,"wires":[["6e96c850.4b84c8"]]},{"id":"6e96c850.4b84c8","type":"atem-atem","z":"4ecf69fc.958c48","name":"ATEM","network":"3260f992.1b9866","outputMode":"all","x":858,"y":179,"wires":[["a9196221.5360f"]]},{"id":"2b3e1a40.2130e6","type":"inject","z":"4ecf69fc.958c48","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":348,"y":180,"wires":[["78488d8.fa1d574"]]},{"id":"a9196221.5360f","type":"debug","z":"4ecf69fc.958c48","name":"","active":true,"console":"false","complete":"false","x":1019,"y":179,"wires":[]},{"id":"b9195ab8.f950f8","type":"comment","z":"4ecf69fc.958c48","name":"Remember to change the ip address","info":"Open ATEM and edit the network and set \nthe ip address of the atem.\n\nThe IP Address can be found in the ATEM setup utility","x":862.5,"y":129,"wires":[]},{"id":"3260f992.1b9866","type":"atem-network","z":"","name":"Test ATEM","ipAddress":"0.0.0.0"}]
Performs a raw command to the ATEM. The commands can be found at https://www.skaarhoj.com/fileadmin/BMDPROTOCOL.html.
//This will set ME 0 to input 0
var msg = {
"payload": {
"cmd": "raw",
"data": {
"name": "CPgI",
"packet": new Buffer.from([0, 0, 0, 0])
}
}
}
States the current state of the node
disconnected - Disconnected connecting - Attempting to handshake initalising - Gathering information connected - Connected error - A error has occured
When all information is gained from the ATEM spit out the read values
Changes the program input on a ME
Where the MEs start at 0. So ME 1 is 0
This can contain either the id, shortName or longName Integer of the macro id starting at 0
//This will set input 0 (Blk) to ME 0
var msg = {
"payload": {
"cmd": "programInput",
"data": {
"ME": 0,
"videoSource": {
id: 0,
shortName: "blk",
longName: "black" //(Only one of the above is requred)
}
}
}
}
Changes the preview input on a ME
Where the MEs start at 0. So ME 1 is 0
This can contain either the id, shortName or longName Integer of the macro id starting at 0
//This will set input 0 (Blk) to ME 0
var msg = {
"payload": {
"cmd": "previewInput",
"data": {
"ME": 0,
"videoSource": {
id: 0,
shortName: "blk",
longName: "black" //(Only one of the above is requred)
}
}
}
}
Gets the properties of a input
//This will ask for all input properties
var msg = {
"payload": {
"cmd": "inputProperty",
"data": {}
}
}
Performs a cut transition on a ME
Where the MEs start at 0. So ME 1 is 0
//This will perform a cut on ME 0
var msg = {
"payload": {
"cmd": "performCut",
"data": {
"ME": 0
}
}
}
Performs a auto transition on a ME
Where the MEs start at 0. So ME 1 is 0
//This will perform a cut on ME 0
var msg = {
"payload": {
"cmd": "performAuto",
"data": {
"ME": 0
}
}
}
Controls the downstream keyers
Where x is the keyer number 0 - 4
//This will turn downstream keyer 0 on air
var msg = {
"payload": {
"cmd": "downstreamKeyer",
"data": {
"id": 0,
"state: true
}
}
}
Controls the upstream keyers
Where x is the keyer number 0 - 4
//This will turn upstream keyer 0 on ME 0 on air
var msg = {
"payload": {
"cmd": "downstreamKeyer",
"data": {
"ME": 0,
"id": 0,
"state: true
}
}
}
Controls the aux sources
//Gets the aux sources
var msg = {
"payload": {
"cmd": "auxSource",
"data": {
"id": x //This can be passed to get the specific aux source
}
}
}
//Sets the aux source to input 0 (black) on aux 0
var msg = {
"payload": {
"cmd": "auxSource",
"data": {
"id": 0,
"videoSource": {
"id": 0,
"shortName": "blk",
"longName": "black" // Only one of these is required
},
"mask": true
}
}
}
The time read from the ATEM
//This will get the current time on the ATEM
var msg = {
"payload": {
"cmd": "time",
"data": {}
}
}
The current transition position
0 - 9999
//This will set the transition position on ME 0 to be half way
var msg = {
"payload": {
"cmd": "transitionPosition",
"data": {
"ME": 0,
"position": 4999
}
}
}
Controls the box control under the super source
cmd
"superSourceBox"data
Array[superSourceID][boxID] where super source 1 box 3 will be Array[1][3]superSourceID
the super source to change the box onbox
the box to changeenabled
should the box be enabled?inputNumber
videoSource
the input to set the box to (can be either a raw inputNumber or a videoSource object)xPosition
the x positionyPosition
the y positionsize
the size of the boxcropEnabled
should the crop be enabled?cropTop
the top crop positioncropBottom
the bottom crop positioncropLeft
the left crop positioncropRight
the right crop position
var msg = {
"payload": {
"cmd": "superSourceBox",
"data": {
//Super Source ID
1: {
//Box ID
1: {
"enabled": true,
"inputNumber": 0,
"videoSource": {
"id": 0,
"longName": "black"
},
"xPosition": 15.0,
"yPosition": 20.0,
"size": 1.0,
"cropEnabled": true,
"cropTop": 1.0,
"cropBottom": 1.0,
"cropLeft": 1.0,
"cropRight": 1.0
},
2: {
....
}
}
}
}
}
//Request to set the super source box on super source 1 box 4 to change input
var msg = {
"payload": {
"cmd": "superSourceBox",
"data": {
"superSourceID": 1,
"box": 4,
"videoSource": {
"id": 5
}
//You don't need to set everything if a parameter is not set it will set it to what was read in
}
}
}
Controls a camera
cmd
"cameraControl"data
Array[cameraId]iris
The current iris value in percentage (0-100%). Set value toauto
for auto irisfocus
The current focus value in percentage (0-100%). Set value toauto
for auto focusgain
The gain value of the camera (-12, -6, 0, +6, +12, 18, 24)dbwhiteBalance
The white balance of the camera (Integer)zoomSpeed
The current zoom speed in percentage (-100% - 100%). Send 0% to stopzoomPosition
Move the zoom to a set position (0-100%)lift[red,green,blue,yellow]
Sets the lift value of the camera (-1.0 - 1.0)gamma[red,green,blue,yellow]
Sets the gamma value of the camera (-1.0 - 1.0)gain[red,green,blue,yellow]
Sets the gain value of the camera (0 - 4.0)lumMix
Sets the lum mix of the camera (0 - 100%)hue
Sets the hue of the camera (0 - 100%)shutter
The shutter speed ("1/24", "1/25", "1/30", "1/50", "1/60", "1/75", "1/90", "1/100", "1/120", "1/150", "1/180", "1/250", "1/360", "1/500", "1/725", "1/1000", "1/1450", "1/2000")contrast
Sets the contrast on the camera (0 - 100%)saturation
Sets the saturation of the camera (0 - 100%)
var msg = {
"payload": {
"cmd": "cameraControl",
"data": {
//Camera ID
1: {
"iris": 0,
"focus": 0,
"overallGain": "0db",
"whiteBalance": 5600,
"zoomSpeed": 0,
"lift": {
"red": 0.0,
"green": 0.0,
"blue": 0.0,
"yellow": 0.0
},
"gamma": {
"red": 0.0,
"green": 0.0,
"blue": 0.0,
"yellow": 0.0
},
"gain": {
"red": 0.0,
"green": 0.0,
"blue": 0.0,
"yellow": 0.0
},
"lumMix": 0,
"hue": 50,
"shutter": "1/75",
"contrast": 50,
"saturation": 0,
"zoomPosition" 0
},
2: {
....
}
}
}
}
//Request camera 1 to reset to defaults
var msg = {
"payload": {
"cmd": "cameraControl",
"data": {
"cameraID": 1,
"iris": 0,
"overallGain": "6db",
"whiteBalance": 5700,
"lift": {
"red": 0.0,
"green": 0.0,
"blue": 0.0,
"yellow": 0.0
},
"gamma": {
"red": 0.0,
"green": 0.0,
"blue": 0.0,
"yellow": 0.0
},
"gain": {
"red": 1.0,
"green": 1.0,
"blue": 1.0,
"yellow": 1.0
},
"lumMix": 0,
"hue": 0,
"shutter": "1/50",
"contrast": 50,
"saturation": 50
}
}
}
Contorls a audio mixer input
cmd
"audioMixerInput"data
Array[audioMixerID]id
The ID of this audio mixer inputinput
A object containing the video input relevent to this audio input (See inputProperty for more information)type
The type of channelfromMediaPlayer
Is this channel from the media player?plugType
The type of plug this channel comes frommixOption
What is the mix optionvolume
The volume of the channel 0-100%
var msg = {
"payload": {
"cmd": "audioMixerInput",
"data": {
//Mixer Channel
1: {
"id": 1,
"input": [inputProperty Object],
"type": "externalVideo",
"fromMediaPlayer": false,
"plugType": "sdi",
"mixOption": "off",
"volume": 50,
"balance": 0
},
2: {
....
}
}
}
}
//Request channel 1 to be half volume
var msg = {
"payload": {
"cmd": "audioMixerInput",
"data": {
//You can pass either a raw id or a input containing it's id or short/long name
"id": 1,
"input": {
"id": 1,
"shortName": "CAM1"
},
"volume": 50,
"balance": 0
}
}
Contorls a audio mixer input
cmd
"audioMixerMonitor"data
enabled
If the audio monitor is enabledvolume
The volume of the audio monitor (0-100%)muteEnabled
If the audio monitor is mutedsoloEnabled
If the audio monitor is set to solosoloInput
The solo input of the monitor whereid
is the id of the selected input andinput
is the audioMixerInput object of the input (See audioMixerInput for more)dimEnabled
If the dim is enabled
var msg = {
"payload": {
"cmd": "audioMixerMonitor",
"data": {
"enabled": true,
"volume": 100,
"muteEnabled": false,
"soloEnabled": true,
"soloInput": {
"id": 1,
"input": [audioMixerInput Object]
},
"dimEnabled": false
}
}
}
//Request to change the solo input and set the volume to half
var msg = {
"payload": {
"cmd": "audioMixerMonitor",
"data": {
"enabled": true,
"volume": 50,
"muteEnabled": false,
"soloEnabled": true,
"soloInput": 1 or "soloInput": "CAM1", //Both are valid
"dimEnabled": false
}
}
Contorls a audio mixer input
-
cmd
"multiViewerInput" -
data
An array containing each multiviewer -
Data object
-
id
The multiviewer id -
windows
An array containing each window -
Windows object
-
index
The window index number -
inputId
The input id set to the window -
videoSource
The video source set to the window (See inputProperty for more information)
var msg = {
"payload": {
"cmd": "multiViewerInput",
"data": {
"id": 0,
"windows": {
"index": 0,
"inputId": 0,
"videoSource": [inputProperty Object]
},
{
"index": 1,
"inputId": 2,
"videoSource": [inputProperty Object]
}
...
},
{
"id": 1,
"windows": {
"index": 0,
"inputId": 0,
"videoSource": [inputProperty Object]
},
...
}
...
}
}
//Request to set multiviewer 1, window 1, to input 1
var msg = {
"payload": {
"cmd": "multiViewerInput",
"data": {
"multiViewerId": 0,
"windowIndex": 0,
"input": {
"id": 1,
"shortName": "CAM1"
}
or
"inputId": 1
}
}
The current version of the ATEM
//This will get the current version of the ATEM
var msg = {
"payload": {
"cmd": "version",
"data": {}
}
}
Performs a maro
Integer of the macro id starting at 0
- "run" - Runs the command
- "stop" - Stops the command
- "stoprecording" - Stops recoding a macro
- "insertwaitforuser" - Inserts a wait for the user
- "continue" - Continue the marco after a pause
- "deletemacro" - Deletes the macro
//This will run macro 0
var msg = {
"payload": {
"cmd": "macroAction",
"data": {
"macroId": 0,
"action": "run"
}
}
}
If the atem sends a warning
//This will get the last warning message received if there was one
var msg = {
"payload": {
"cmd": "warning",
"data": {}
}
}
The topology of the ATEM
//This will get the last warning message received if there was one
var msg = {
"payload": {
"cmd": "topology",
"data": {}
}
}