3.5.0 • Published 9 days ago

atem-connection v3.5.0

Weekly downloads
1,588
License
MIT
Repository
github
Last release
9 days ago

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

CircleCI codecov npm

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

Device support

VersionLevel of Support
v8.0 - v8.1Primary focus. Target for new features
v7.2Previous focus, should still work well
v7.3 - v7.5.2Community tested, we may accept PRs but will not be testing these

Due to the nature of the ATEM firmware and its tendency to break things, it is likely that new firmwares will require updates to the library to be fully supported. Additionally any newly unimplemented functionality will generally only be written and tested for the latest firmware, even if it was added in an older firmware.

It is tested on a variety of models spanning every generation, and the aim is to provide support for every model.

Note: USB control of devices is not supported by this library.

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()
myAtem.on('info', console.log)
myAtem.on('error', console.error)

myAtem.connect('192.168.168.240')

myAtem.on('connected', () => {
	myAtem.changeProgramInput(3).then(() => {
		// Fired once the atem has acknowledged the command
		// Note: the state likely hasnt updated yet, but will follow shortly
		console.log('Program input set')
	})
	console.log(myAtem.state)
})

myAtem.on('stateChanged', (state, pathToChange) => {
  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

  • receivedCommand(command) Whenever a packet from the ATEM is received that contains a command, this event will be fired. This should not be relied on in most usage, as the commands can and will have breaking changes in patch releases. This event is needed for some use cases, so if this is used you should likely pin the version down to a specific patch release to ensure nothing breaks.

Debug

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

const myAtem = new Atem({ debugBuffers: true })
myAtem.on('info', console.log)
myAtem.on('debug', console.log)
myAtem.on('error', console.error)
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

3.5.0

3 months ago

3.4.0

5 months ago

3.3.3

5 months ago

2.5.0

9 months ago

3.3.1

7 months ago

3.3.0

8 months ago

3.3.2

7 months ago

3.2.0

1 year ago

3.1.3

1 year ago

3.1.2

1 year ago

3.1.0

1 year ago

3.0.1

2 years ago

3.0.0

2 years ago

2.4.0

2 years ago

2.3.1

3 years ago

2.3.0

3 years ago

2.2.2

3 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.10.0

5 years ago

0.9.0

5 years ago

0.8.2

5 years ago

0.8.1

5 years ago

0.8.0

5 years ago

0.7.0

6 years ago

0.6.1

6 years ago

0.6.0

6 years ago

0.5.2

6 years ago

0.5.1

6 years ago

0.5.0

6 years ago

0.4.0

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago