Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@mykkode/test-casparcg-connection

SuperFlyTV27MIT5.1.3TypeScript support: included

Node.js Javascript/Typescript library for CasparCG connection and commands.

casparcg, caspar, amcp, socket, tcp, broadcast, graphics, superfly, connection, middleware, remote

readme

casparcg-connection

GitHub license npm

CircleCI

API Docs Guide

Introduction

CasparCG Server is an open source graphics- and video server for broadcast and streaming productions. This library lets you connect and interact with CasparCG Servers from Node.js in Javascript. This library is also a part of the Sofie TV News Studio Automation System.

Features

  • CasparCG AMCP 2.0 and 2.1 protocol implemented
  • Parsing and validation of command parameters and response
  • Queueing of commands
  • Promise-based commands for easy chaining and sequences
  • Helper functions for parsing of Config, Version and System info

Project

Getting started

Installing with NPM

npm install casparcg-connection --save

This installs the full project with sourcecode and dependencies, typescript project files and the compiled .js output with typings.

In your code, include and use the CasparCG object from this library with a code similar to:

const {CasparCG} = require("casparcg-connection");

var connection = new CasparCG();
connection.play(1, 1, "amb");

Note: starting with version 4.0.0 the default queue mode is now SALVO. You can optionally set the queue mode back to sequential if you need compatibility with CasparCG 2.0.7 or earlier. Note that the implementation of scheduled commands requires asynchronous behaviour and therefore only works in salvo mode.

Build from source

Installing from NPM adds the dev-dependencies needed to compile TypeScript and using Gulp as build tool. A set of commands help you managing development and testing:

  • npm run gulp Runs the build command and watches all /src files for changes, re-running the build upon each file change.
  • npm run clean Empties the /js directory.
  • npm run build Runs a single build command without watching for changes.
  • npm run cleanBuild Runs the clean command before a build command.
  • npm run lint Runs code linting. Pull Requests won't be accepted without lint compliance.
  • npm run test Runs code tests through Jest.

Documentation

Join the discussion in the CasparCG Forum thread.

Visit https://superflytv.github.io/casparcg-connection/ for API documentation.

Visit https://superfly-tv.gitbooks.io/casparcg-connection-getting-started-guide/content/ for Getting started guide.

About

Created and published by SuperFly.tv

Roadmap

  1. AMCP 2.1 parity
  2. Parsing of return data to Objects and Arrays
  3. Validating of responses against AMCP protocol
  4. OSC events parsing
  5. Smart queue with linked and grouped commands

Acknowledgements:

changelog

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

5.1.0 (2020-11-16)

Features

  • add ffmpeg filter options (1b81653)

5.0.1 (2020-09-29)

5.0.0 (2020-09-29)

⚠ BREAKING CHANGES

  • drop node 8 support

Features

  • drop node 8 support (44f6dae)
  • ci: use prerelease flow & optionally skip audit [skip ci] (bd32ef1)
  • update ci to run for node 8,10,12 (8e1de30)

4.9.0 (2019-11-18)

Features

  • clear_on_404 parameter for PLAY/LOAD/LOADBG (b8f0bd6)
  • FRAMES_DELAY parameter for PLAY/LOAD/LOADBG route (bceabce)

4.8.1 (2019-11-07)

4.8.0 (2019-11-07)

Bug Fixes

Features

  • call: Adds SEEK support to call (bad75ae), closes #5
  • sting audio fade parameters (9c64a9e)

4.7.0 (2019-04-11)

Bug Fixes

  • Validator: refactor of PositiveNumberValidatorBetween (1d6f41e)

Features

  • call: adds all ffmpeg producer calls (2edbe9d)
  • call: Adds SEEK support to call (1704912), closes #5
  • add support for IN property in PLAY command (9e059be)

4.6.1 (2019-01-15)

4.6.0 (2018-12-12)

Bug Fixes

  • add back overloads for play methods (40b12b4)

Features

  • channel_layout property (c66fcfb)

4.5.3 (2018-10-03)

Bug Fixes

  • sting: stingOverlayFilename can be the empty string (afe1143)

4.5.2 (2018-09-24)

4.5.1 (2018-09-11)

Bug Fixes

  • validation of transition paramters (d128f98)

4.5.0 (2018-08-14)

Features

4.4.0 (2018-08-07)

Bug Fixes

  • Commands: Rejects promise on invalid command (8632c79)

Features

  • Commands: Better promise handling with fallback to empty promises instead of mixing promise and null handling (8400194)

4.3.1 (2018-08-02)

Bug Fixes

  • Time command takes timecode parameter (858e2a4)

4.3.0 (2018-08-02)

Features

4.2.2 (2018-07-02)

Bug Fixes

  • use 'new' keyword instead of Object.create (27c6055)

4.2.1 (2018-07-02)

4.2.0 (2018-06-28)

Bug Fixes

  • refactor package.json, add circleCI badge and correct ssh fingerprint (37c5377)
  • ts lint errors (84e830c)
  • typescrit imrovements (3b8634e)

Features

  • initial convert to circleci (842de38)

4.1.1 (2018-06-27)

Bug Fixes

  • don't set queueMode on uninitialized socket (c6a8b06)

4.1.0 (2018-05-22)

4.0.3 (2018-05-07)

4.0.2 (2018-05-04)

4.0.1 (2018-04-29)

Bug Fixes

  • TemplateData): PR from Craig Sweaton escaping \r\n from template data. Prevents breaking the AMCP communication.

4.0.0 (2018-04-10)

Features

  • Asynchronous commands: refactor the internal command execution (7b10d43)
  • QueueMode: allow runtime configuration (f39f7ea)
  • Scheduled Commands: keep sequential mode for compatibility (48a760f)
  • Scheduled Commands: schedule and resolve scheduled commands (5a9f0fb)

BREAKING CHANGES

  • set default queue mode to SALVO, making the library fully asynchronous.

3.1.0 (2018-03-28)

Features

  • Add/Remove Commands: Merge branch 'Besedin86/master' into develop (ca772e6)

3.0.2 (2018-03-27)

Bug Fixes

  • CGAddCommand: playOnLoad is required (3fc9300), closes #93

3.0.1 (2017-10-22)

Bug Fixes

  • MixerCommands: Corrected copy/paste errors for several mixer commands, related to transitions. (29bc5a5), closes #89

3.0.0 (2017-10-16)

Bug Fixes

  • TemplateData: Correct double escaping of quotes xml strings (5bda229)

3.0.0-next.4 (2017-10-03)

Bug Fixes

  • Config: Correct cross-version-import between configVOs (bdcedfd)
  • onConnection: Bug with promise resolve and queue conducting on initial connection (4504cb9)

3.0.0-next.3 (2017-07-31)

Bug Fixes

  • Socket: Fixed bug with disposing socket clients before they are created (7a0a510)

3.0.0-next.2 (2017-07-24)

3.0.0-next.1 (2017-07-20)

Features

  • VirginServer: Report server's virgin-state on connected events (a8f3b61)

3.0.0-next.0 (2017-07-20)

Bug Fixes

  • Command: Critical error with command timeouts (6caeacb)
  • Config: Bugfix with manual operations parsing config XML (e80117b)
  • Events: Critical bug introduced in v1.0.0 (7dcd9fe)
  • Logging: Better handling of errors (d80c794)
  • Socket: Prevents timeout of extremely long responses (613c629)
  • Socket: Removed unused internal event (5eb343c)
  • Version: bugfix for setting manuel ServerVersion (8362a22)

Code Refactoring

  • Enum: Changed the public enum ServerVersion (b7aadea)

Features

  • Command: Planned for better timeout retry strategy (b0b5f19)
  • Config: Added members "vo" and "xml" as aliases to "VO" and "XML" on Config objects (65dffde)
  • Queue: Added prioritized queues (929e4ad), closes #15
  • Version: Added version promise to CasparCG (554ea41), closes #73

BREAKING CHANGES

  • Enum: enum ServerVersion is now CasparCGVersion, for consistency.

2.1.0 (2017-07-18)

Bug Fixes

  • CasparCG Connection events (a825a18)

Features

  • Commands: Better command timeout strategy (bd51c31)
  • Socket: (Re)connection strategy (3d04e5f), closes #66
  • Socket: Reconnection (90ca334)

2.0.3 (2017-07-12)

Bug Fixes

2.0.2 (2017-07-12)

2.0.1 (2017-07-12)

2.0.0 (2017-07-12)

Bug Fixes

BREAKING CHANGES

  • Reverted ES6 target back to ES5 due to Meteor compability

1.0.0 (2017-07-12)

build

Features

BREAKING CHANGES

  • build target ES2015 (ES6). This required Node.js version 6.4.0 or higher to fully function.

0.17.2 (2017-06-18)

Bug Fixes