Module timeline-state-resolver

Timeline State Resolver

Abstract

This library orchestrates and controls different devices. Its input is a timeline data structure and a layer-to-device-map. Using the input, it resolves the expected state, diffs the state against current state and sends commands to devices where necessary.

Supported devices

  • CasparCG - using the casparcg-connection library
  • Blackmagic Design ATEM vision mixers - using the atem-connection library
  • Blackmagic Design Hyperdeck record/playback devices - using the hyperdeck-connection library
  • Lawo audio mixers - using the emberplus library
  • Panasoniz PTZ cameras
  • Pharos light control devices
  • Sisyfos audio controller
  • Quantel video server
  • vMix software vision mixer
  • VizRT MediaSequencer graphics system - using the v-connection library
  • Arbitrary OSC compatible devices
  • Arbitrary HTTP (REST) compatible devices
  • Arbitrary TCP-socket compatible devices

Development

TSR is primarily developed to be used in the Playout Gateway of the Sofie project.

When developing support for new devices, a helpful tool for quickly trying out new functionality is the Quick-TSR repo.

Installation instructions (for developers)

Prerequisites

Build and test

  • Build: yarn build

  • Run test & view coverage yarn cov

Examples of timeline objects

Here follows some examples of valid mappings and timeline-objects to control devices with TSR.

CasparCG

Playing a video

Play the video clip "AMB" for 5 seconds

// Mapping:
{
myLayerCaspar: {
device: DeviceType.CASPARCG,
deviceId: 'myCCG',
channel: 1,
layer: 10
}
}
// Timeline:
{
id: 'video0',
enable: {
start: 'now',
duration: 5000
},
layer: 'myLayerCaspar',
content: {
deviceType: DeviceType.CASPARCG,
type: TimelineContentTypeCasparCg.MEDIA,

file: 'AMB'
}
}

Blackmagic Design ATEM

Cut to source

Cut to source 2 on ME1

// Mapping:
{
myLayerME1: {
device: DeviceType.ATEM,
deviceId: 'myAtem',
mappingType: MappingAtemType.MixEffect,
index: 0
}
}
// Timeline:
{
id: 'source2',
enable: {
start: 'now'
},
layer: 'myLayerME1',
content: {
deviceType: DeviceType.ATEM,
type: TimelineContentTypeAtem.ME,
me: {
input: 2,
transition: AtemTransitionStyle.CUT
}
}
}

Blackmagic Design Hyperdeck

Record a clip

Start recording of a clip, and record it for 10 secods

// Mapping:
{
myLayerRecord: {
device: DeviceType.ATEM,
deviceId: 'myHyperdeck',
mappingType: MappingAtemType.MixEffect,
index: 0
}
}
// Timeline:
{
id: 'record0',
enable: {
start: 'now',
duration: 10000
},
layer: 'myLayerRecord',
content: {
deviceType: DeviceType.HYPERDECK,
type: TimelineContentTypeHyperdeck.TRANSPORT,

status: TransportStatus.RECORD,
recordFilename: 'sofie_recording1'
}
}

Lawo audio mixer

Pull up a fader

Pull up a fader, and leave it there

// Mapping:
{
myLayerFader0: {
device: DeviceType.LAWO,
deviceId: 'myLawo',
mappingType: MappingLawoType.SOURCE,
identifier: 'BASE'
}
}
// Timeline:
{
id: 'lawofader0',
enable: {
start: 'now'
},
layer: 'myLayerFader0',
content: {
deviceType: DeviceType.LAWO,
type: TimelineContentTypeLawo.SOURCE,

faderValue: 0
}
}

Panasoniz PTZ

Recall a preset

// Mapping:
{
myLayerCamera1: {
device: DeviceType.PANASONIC_PTZ,
deviceId: 'myPtz',
mappingType: MappingPanasonicPtzType.PRESET
}
}
// Timeline:
{
id: 'ptzPreset1',
enable: {
start: 'now'
},
layer: 'myLayerCamera1',
content: {
deviceType: DeviceType.PANASONIC_PTZ,
type: TimelineContentTypePanasonicPtz.PRESET,
preset: 1
}
}

Pharos Light control

Recall a scene

// Mapping:
{
myLayerLights: {
device: DeviceType.PANASONIC_PTZ,
deviceId: 'myPtz',
mappingType: MappingPanasonicPtzType.PRESET
}
}
// Timeline:
{
id: 'scene1',
enable: {
start: 'now'
},
layer: 'myLayerLights',
content: {
deviceType: DeviceType.PHAROS,
type: TimelineContentTypePharos.SCENE,

scene: 1
}
}

Sisyfos audio controller

Activate channel 3

Activate channel 3 on sisyfos pgm output

// Mapping:
{
myLayerSisyfosScene1: {
device: DeviceType.SISYFOS,
deviceId: 'mySisyfos',
channel: 3
}
}
// Timeline:
//ON:
{
id: 'channel3',
enable: {
start: 'now'
},
layer: 'myLayerSisyfosScene1',
content: {
deviceType: DeviceType.SISYFOS,
type: TimelineContentTypeSisyfos.SISYFOS,

isPgm: 1 // 0 = OFF, 1 = Pgm level, 2 = VoiceOver level
}
}
//FADERLEVEL:
{
id: 'channel3',
enable: {
start: 'now'
},
layer: 'myLayerSisyfosScene1',
content: {
deviceType: DeviceType.SISYFOS,
type: TimelineContentTypeSisyfos.SISYFOS,

faderLevel: 0.75
}
}
//LABEL:
{
id: 'channel3',
enable: {
start: 'now'
},
layer: 'myLayerSisyfosScene1',
content: {
deviceType: DeviceType.SISYFOS,
type: TimelineContentTypeSisyfos.SISYFOS,
label: 'SERVER B'
}
}
//VISIBLE: (shows or hide a fader)
{
id: 'channel3',
enable: {
start: 'now'
},
layer: 'myLayerSisyfosScene1',
content: {
deviceType: DeviceType.SISYFOS,
type: TimelineContentTypeSisyfos.SISYFOS,
visible: false // false: hide - true: show
}
}

Quantel video server

Play a video

Play a video for 10 seconds

// Mapping:
{
myLayerVideoA: {
device: DeviceType.QUANTEL,
deviceId: 'myQuantel',

portId: 'sofie1',
channelId: 2
}
}
// Timeline:
{
id: 'video0',
enable: {
start: 'now',
duration: 10000
},
layer: 'myLayerVideoA',
content: {
deviceType: DeviceType.QUANTEL,

title: 'myClipInQuantel'
// guid: 'abcdef872832832a2b932c97d9b2eb9' // GUID works as well
}
}

Arbitrary HTTP-interface

Send a POST request

Send a POST Request to a URL

// Mapping:
{
myLayerHTTP: {
device: DeviceType.HTTPSEND,
deviceId: 'myHTTP'
}
}
// Timeline:
{
id: 'video0',
enable: {
start: 'now'
},
layer: 'myLayerHTTP',
content: {
deviceType: DeviceType.HTTPSEND,
type: TimelineContentTypeHttp.POST,

url: 'http://superfly.tv/api/report',
params: {
someRandomParameter: 42,
anotherFineParameter: 43
}
}
}

Index

Namespaces

Enumerations

Classes

Interfaces

AbstractActionExecutionResults AbstractOptions ActionExecutionResult ActivatePayload AtemActionExecutionResults AtemMediaPoolAsset AtemOptions AtemTransitionSettings CasparCGActionExecutionResults CasparCGOptions CasparCGTransitionInner CommandReport ConductorOptions Datastore DeviceOptionsAbstract DeviceOptionsAtem DeviceOptionsBase DeviceOptionsCasparCG DeviceOptionsHTTPSend DeviceOptionsHTTPWatcher DeviceOptionsHyperdeck DeviceOptionsLawo DeviceOptionsMultiOSC DeviceOptionsOBS DeviceOptionsOSC DeviceOptionsPanasonicPTZ DeviceOptionsPharos DeviceOptionsQuantel DeviceOptionsShotoku DeviceOptionsSingularLive DeviceOptionsSisyfos DeviceOptionsSofieChef DeviceOptionsTCPSend DeviceOptionsTelemetrics DeviceOptionsTriCaster DeviceOptionsVMix DeviceOptionsVizMSE DeviceStatus ExpectedPlayoutItemContentBase HTTPSendCommandContent HTTPSendOptions HTTPWatcherOptions HttpSendActionExecutionResults HyperdeckActionExecutionResults HyperdeckOptions I18NextData ITranslatableMessage LawoCommand LawoOptions ListMediaPayload Mapping MappingAtemAudioChannel MappingAtemAudioRouting MappingAtemAuxilliary MappingAtemColorGenerator MappingAtemDownStreamKeyer MappingAtemMacroPlayer MappingAtemMediaPlayer MappingAtemMixEffect MappingAtemSuperSourceBox MappingAtemSuperSourceProperties MappingCasparCGLayer MappingHyperdeckTransport MappingLawoFullpath MappingLawoSource MappingLawoSources MappingLawoTriggerValue MappingMultiOscLayer MappingObsCurrentScene MappingObsCurrentTransition MappingObsInputAudio MappingObsInputMedia MappingObsInputSettings MappingObsRecording MappingObsSceneItem MappingObsStreaming MappingPanasonicPTZPresetMem MappingPanasonicPTZPresetSpeed MappingPanasonicPTZZoom MappingPanasonicPTZZoomSpeed MappingQuantelPort MappingSingularLiveComposition MappingSisyfosChannel MappingSisyfosChannelByLabel MappingSisyfosChannels MappingSofieChefWindow MappingTricasterAUDIOCHANNEL MappingTricasterDSK MappingTricasterINPUT MappingTricasterMATRIXOUTPUT MappingTricasterME MappingTricasterMIXOUTPUT MappingVmixAudioChannel MappingVmixExternal MappingVmixFadeToBlack MappingVmixFader MappingVmixInput MappingVmixOutput MappingVmixOverlay MappingVmixPreview MappingVmixProgram MappingVmixRecording MappingVmixScript MappingVmixStreaming Mappings MediaInfo MediaObject Mixer MultiOSCOptions OBSOptions OBSSceneItemTransform OSCMessageCommandContent OSCOptions OSCValueBlob OSCValueBoolean OSCValueNumber OSCValueString OpenPresetPayload PanasonicPTZOptions PharosOptions QuantelActionExecutionResults QuantelOptions QuantelTransitionBase QuantelTransitionDelay RegularTimelineTransition ResolvedTimelineObjectInstanceExtended RestartWindowPayload SavePresetPayload SendCommandResult SendTcpCommandPayload ShotokuCommandContent ShotokuOptions SingularCompositionControlNode SingularLiveContent SingularLiveOptions SisyfosActionExecutionResults SisyfosChannelOptions SisyfosOptions SlowFulfilledCommandInfo SlowReportOptions SlowSentCommandInfo SofieChefActionExecutionResults SofieChefOptions StatReport TCPSendOptions TSRActionSchema TSRManifest TSRTansition TSRTimelineContentAbstract TSRTimelineKeyframe TSRTimelineObj TSRTimelineObjProps TSRTransitionOptions TcpSendActionExecutionResults TcpSendCommandContent TelemetricsOptions TimelineContentAtemAUX TimelineContentAtemAudioChannel TimelineContentAtemAudioRouting TimelineContentAtemBase TimelineContentAtemColorGenerator TimelineContentAtemDSK TimelineContentAtemME TimelineContentAtemMacroPlayer TimelineContentAtemMediaPlayer TimelineContentAtemSsrc TimelineContentAtemSsrcProps TimelineContentCCGHTMLPage TimelineContentCCGIP TimelineContentCCGInput TimelineContentCCGMedia TimelineContentCCGProducerBase TimelineContentCCGRecord TimelineContentCCGRoute TimelineContentCCGTemplate TimelineContentCasparCGBase TimelineContentEmpty TimelineContentHTTPSendBase TimelineContentHyperdeck TimelineContentLawoBase TimelineContentLawoEmberProperty TimelineContentLawoEmberRetrigger TimelineContentLawoSource TimelineContentLawoSourceValue TimelineContentLawoSources TimelineContentOBSBase TimelineContentOBSCurrentScene TimelineContentOBSCurrentTransition TimelineContentOBSInputAudio TimelineContentOBSInputMedia TimelineContentOBSRecording TimelineContentOBSSceneItem TimelineContentOBSStreaming TimelineContentOSC TimelineContentPanasonicPtz TimelineContentPanasonicPtzPreset TimelineContentPanasonicPtzPresetSpeed TimelineContentPanasonicPtzZoom TimelineContentPanasonicPtzZoomSpeed TimelineContentPharos TimelineContentPharosScene TimelineContentPharosTimeline TimelineContentQuantelClip TimelineContentShotokuSequence TimelineContentShotokuShot TimelineContentSingularLiveBase TimelineContentSingularLiveComposition TimelineContentSisyfos TimelineContentSisyfosChannel TimelineContentSisyfosChannels TimelineContentSisyfosTriggerValue TimelineContentSofieChef TimelineContentSofieChefScene TimelineContentTCPSendBase TimelineContentTelemetrics TimelineContentTriCasterAudioChannel TimelineContentTriCasterBase TimelineContentTriCasterDSK TimelineContentTriCasterInput TimelineContentTriCasterME TimelineContentTriCasterMatrixOutput TimelineContentTriCasterMixOutput TimelineContentVIZMSEBase TimelineContentVIZMSECleanupShows TimelineContentVIZMSEClearAllElements TimelineContentVIZMSEConcept TimelineContentVIZMSEElementContinue TimelineContentVIZMSEElementInternal TimelineContentVIZMSEElementPilot TimelineContentVIZMSEInitializeShows TimelineContentVIZMSELoadAllElements TimelineContentVMixAudio TimelineContentVMixBase TimelineContentVMixExternal TimelineContentVMixFadeToBlack TimelineContentVMixFader TimelineContentVMixInput TimelineContentVMixOutput TimelineContentVMixOverlay TimelineContentVMixPreview TimelineContentVMixProgram TimelineContentVMixRecording TimelineContentVMixScript TimelineContentVMixStreaming TimelineDatastoreReferences TimelineDatastoreReferencesContent TimelineStingTransition TimelineTransitionBase TransitionObject TranslationsBundle TriCasterAudioChannel TriCasterInput TriCasterKeyer TriCasterLayer TriCasterMixEffectInEffectMode TriCasterMixEffectInMixMode TriCasterMixEffectWithPreview TriCasterOptions TricasterOptions VIZMSEPlayoutItemContentBase VIZMSEPlayoutItemContentExternal VIZMSEPlayoutItemContentInternal VIZMSETransitionBase VIZMSETransitionDelay VMixInputOverlays VMixLayer VMixLayers VMixOptions VMixTransform VMixTransition VizMSEActionExecutionResults VizMSEOptions VizResetPayload VmixActionExecutionResults

Type Aliases

AbstractActionExecutionPayload AbstractActionExecutionResult AtemActionExecutionPayload AtemActionExecutionResult CasparCGActionExecutionPayload CasparCGActionExecutionResult CasparCGTransition CommandWithContext ConductorEvents DeviceOptionsAny DeviceOptionsAnyInternal DoOnTimeEvents DoOnTimeOptions DoOrderFunction DoOrderFunction0 DoOrderFunction1 DoOrderFunction2 DoOrderFunctionNothing EmberValue ExpectedPlayoutItem ExpectedPlayoutItemContent HttpSendActionExecutionPayload HttpSendActionExecutionResult HyperdeckActionExecutionPayload HyperdeckActionExecutionResult ListMediaResult OSCEasingType QuantelActionExecutionPayload QuantelActionExecutionResult QuantelOutTransition SisyfosActionExecutionPayload SisyfosActionExecutionResult SofieChefActionExecutionPayload SofieChefActionExecutionResult SomeMappingAbstract SomeMappingAtem SomeMappingCasparCG SomeMappingHttpSend SomeMappingHttpWatcher SomeMappingHyperdeck SomeMappingLawo SomeMappingMultiOsc SomeMappingObs SomeMappingOsc SomeMappingPanasonicPTZ SomeMappingPharos SomeMappingQuantel SomeMappingShotoku SomeMappingSingularLive SomeMappingSisyfos SomeMappingSofieChef SomeMappingTcpSend SomeMappingTelemetrics SomeMappingTricaster SomeMappingVizMSE SomeMappingVmix SomeOSCValue SuperSourceBox TSRDevicesManifest TSRDevicesManifestEntry TSRMappingOptions TSRTimeline TSRTimelineContent TcpSendActionExecutionPayload TcpSendActionExecutionResult TimelineContentAbstractAny TimelineContentAtemAny TimelineContentCasparCGAny TimelineContentHTTPRequest TimelineContentHTTPSendAny TimelineContentHyperdeckAny TimelineContentHyperdeckTransport TimelineContentLawoAny TimelineContentOBSAny TimelineContentOBSInputSettings TimelineContentOSCAny TimelineContentOSCMessage TimelineContentPanasonicPtzAny TimelineContentPharosAny TimelineContentQuantelAny TimelineContentShotoku TimelineContentSingularLiveAny TimelineContentSisyfosAny TimelineContentSofieChefAny TimelineContentTCPRequest TimelineContentTCPSendAny TimelineContentTelemetricsAny TimelineContentTriCasterAny TimelineContentVIZMSEAny TimelineContentVMixAny TimelineTransition TimelineTriggerTimeResult TriCasterAudioChannelName TriCasterDelegateName TriCasterInputName TriCasterKeyerName TriCasterLayerName TriCasterMatrixOutputName TriCasterMatrixOutputSource TriCasterMixEffect TriCasterMixEffectName TriCasterMixOutputName TriCasterMixOutputSource TriCasterSourceName TriCasterTransitionEffect VIZMSEOutTransition VIZMSEPlayoutItemContent VizMSEActionExecutionPayload VizMSEActionExecutionResult VmixActionExecutionPayload VmixActionExecutionResult

Variables

Generated using TypeDoc