npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@steffeydev/atem-connection

v3.6.0-1

Published

Typescript Node.js library for connecting with an ATEM switcher.

Downloads

13

Readme

Sofie ATEM Connection Library

Node CI codecov npm

This is the ATEM Connection library of the Sofie TV Automation System. The library is used for connecting to Blackmagic Design's ATEM devices.

General Sofie System Information


Device support

| Version | Level of Support | | ------------- | ----------------------------------------------------------------- | | v8.0 - v8.6 | Primary focus. Target for new features | | v7.2 | Previous focus, should still work well | | v7.3 - v7.5.2 | Community 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.

We have no intention of dropping support for older firmwares, but we may do at some point. If we do this will be done in a major version bump, and will only be for significantly older firmware.

The library 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
  • 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

We welcome any contributions. Please read our guide on how to add new commands before raising 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

  • error This event will be fired when an error occurs in the connection. Node requires you to handle these errors, or your application will quit.

  • info This event will be fired when the connection provides some logging information.

  • debug This event is not useful for most users. It will emit some messages useful to figure out why some data useful mostly to library developers.

  • 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.mixEffects.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 Design's ATEM SDK.


The NRK logo is a registered trademark of Norsk rikskringkasting AS. The license does not grant any right to use, in any way, any trademarks, service marks or logos of Norsk rikskringkasting AS.