Skip to content
Sofie: The Modern TV News Studio Automation System (ATEM Connection library)
TypeScript JavaScript
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci feat: enable running tests in circleci Jun 20, 2019
.github Set up boilerplate structure Apr 12, 2018
.vscode
config Set up boilerplate structure Apr 12, 2018
src fix: media player source still & clip inverted Oct 9, 2019
.editorconfig
.gitignore chore(gitignore): fix *.js files in src not being ignored Aug 6, 2018
.npmignore
CHANGELOG.md chore(release): 1.0.2 [skip ci] Oct 9, 2019
LICENSE Update license holder Apr 17, 2018
README.md chore: update readme Sep 2, 2019
jest.config.js fix: upgrade dependencies to pass audit Mar 22, 2019
package.json
tsconfig.jest.json Set up boilerplate structure Apr 12, 2018
tsconfig.json fix: exclude test helpers in build Jun 20, 2019
tslint.json
yarn.lock chore: update dependencies Oct 9, 2019

README.md

Sofie: The Modern TV News Studio Automation System (ATEM connection library)

CircleCI

This library is used in the Sofie TV News Studio Automation System for connecting to Blackmagic Design ATEM devices.

Technology highlights

  • Typescript
  • Yarn
  • Jest
  • standard-version
  • codecov

Installation

For usage by library consumers installation is as easy as:

yarn add atem-connection

For library developers installation steps are as following:

git clone https://github.com/nrkno/tv-automation-atem-connection
yarn
yarn build

If you want to make a contribution, feel free to open a PR.

Usage

const { Atem } = require('atem-connection')
const myAtem = new Atem({ externalLog: console.log })

myAtem.connect('192.168.168.240')

myAtem.on('connected', () => {
	myAtem.changeProgramInput(3).then((res) => {
		console.log(res)
		// ProgramInputCommand {
		// 	flag: 0,
		// 	rawName: 'PrgI',
		// 	mixEffect: 0,
		// 	properties: { source: 3 },
		// 	resolve: [Function],
		// 	reject: [Function] }
	})
	console.log(myAtem.state)
})

myAtem.on('stateChanged', function(err, state) {
  console.log(state); // catch the ATEM state.
});

Documentation

You can find the generated type docs here.

Events

  • connected This event will be fired once we have connected with the ATEM.

  • disconnected Whenever the connection to the ATEM fails and does not recover within 5 seconds this is called.

  • stateChanged(state, path) Whenever a packet from the ATEM is received that changes the state, this event will be fired. The path parameter is a path into the state that represents the change, to allow for filtering of events. eg video.ME.0.programInput

Debug

Set debug=true config option in order to see raw packets. This is especially useful for library developers.

const myAtem = new Atem({ debug: true, externalLog: console.log })
SEND <Buffer 10 14 53 ab 00 00 00 00 00 3a 00 00 01 00 00 00 00 00 00 00>
SEND <Buffer 80 0c 53 ab 00 00 00 00 00 03 00 00>
SEND <Buffer 80 0c 53 ab 00 00 00 00 00 03 00 00>
SEND <Buffer 80 0c 80 0f 00 01 00 00 00 41 00 00>
RECV <Buffer 00 0c 90 60 5f 76 65 72 00 02 00 10>...

Test

This module run tests with jest.

$ yarn unit

There is a suite of generated serialization tests, using atem-connection-test-generator as the LibAtem project has tests to verify its serialization against the Blackmagic Atem SDK

You can’t perform that action at this time.