Introduction
This documentation provides details on implementing NMOS IS-04 Node, Registration and Query APIs with NodeJS.
NodeAPI
Instantiation
const is04 = require('node-nmos-is04');
let store = new is04.NodeRAMStore();
await store.setSelf(new is04.Node({
label: "Test Node",
description: "This is a test node",
tags: ["testing", "node"],
interfaces: ["en0"]
}))
let NodeAPI = new is04.NodeAPI({
store: store
})
NodeAPI.on('registry', (cb) => {
console.log(`${cb.status}: ${cb.message}`, cb.data)
})
NodeAPI.on('heartbeat', (cb) => {
console.log(`${cb.status}: ${cb.message}. ${cb.data.time}`)
})
A NMOS-IS04 Node is created and made available on the network.
Parameters
Parameter | Required | Default | Description |
---|---|---|---|
store | required | Node Store for access to Node information | |
address | optional | 'localhost:3000' | Interface address and port |
regAddress | optional | null | Address of a pre-defined NMOS Registration Server |
Event: 'registry'
registry
event may return several objects
{
status: 'registered',
message: 'Node registered with Registration Server at 0.0.0.0:3000',
data: {
static: boolean,
address: string,
port: number,
connected: boolean,
registered: boolean,
selectedIndex: number
}
}
{
status: 'error',
message: 'Error registering with Registration Server at 0.0.0.0:3000',
data: {error object}
}
{
status: 'unregistered',
message: 'Node unregistered from Registration Server',
data: {
static: boolean,
address: string,
port: number,
connected: boolean,
registered: boolean,
selectedIndex: number
}
}
Fires registry
on several different events. The specific event is listed as the status
and the object may be different per each event
Parameter | Type | Description |
---|---|---|
status | string | registered Node has registered itself with a Registration Server |
message | string | Human-friend message for this event |
data | object | Object with details about the registration server |
data.static | boolean | Is the registration server provided (static) or found via mDNS |
data.address | string | Registration server address |
data.port | number | Registration server port |
data.connected | boolean | Connection status |
data.registered | boolean | Registration status |
data.selectedIndex | number | Index of selected mDNS Registration Server advertisement |
status | string | error Error registering with the Registration Server |
message | string | Human-friend message for this event |
data | object | Error object from HTTP request error |
status | string | unregistered Node has been unregistered by the Registration Server |
message | string | Human-friend message for this event |
data | object | Object with details about the registration server |
data.static | boolean | Is the registration server provided (static) or found via mDNS |
data.address | string | Registration server address |
data.port | number | Registration server port |
data.connected | boolean | Connection status |
data.registered | boolean | Registration status |
data.selectedIndex | number | Index of selected mDNS Registration Server advertisement |
Event: 'heartbeat'
heartbeat
event will be fired on every heartbeat once connected to a Registration Server
{
status: 'sent',
message: 'Heartbeat sent to Registration Server',
data: {
time: number,
uri: string
}
}
{
status: 'received',
message: 'Heartbeat received from Registration Server',
data: {
time: number
}
}
{
status: 'error',
message: 'Heartbeat Error',
data: {
time: number,
error: object
}
}
Fires heartbeat
on several different events. The specific event is listed as the status
and the object may be different per each event. Each heartbeat
records the Javascript time in Unix milliseconds so a "ping-pong" latency can be determined. Heartbeats are sent ever 5 seconds and timeout after 1000 ms. The Registration Server SHOULD remove this entry after 12 seconds of no heartbeat.
Parameter | Type | Description |
---|---|---|
status | string | sent Node has sent a heartbeat to the Registration Server |
message | string | Human-friend message for this event |
data | object | Object with details about the heartbeat |
data.time | number | Javascript timestamp (Unix milliseconds) of when heartbeat was sent |
data.uri | string | Address heartbeat was sent to |
status | string | received Node has received a heartbeat response from the Registration Server |
message | string | Human-friend message for this event |
data | object | Object with details about the heartbeat |
data.time | number | Javascript timestamp (Unix milliseconds) of when heartbeat was received |
status | string | error Error in sending or receiving heartbeat |
message | string | Human-friend message for this event |
data | object | Object with details about the heartbeat |
data.time | boolean | Javascript timestamp (Unix milliseconds) of when error was received |
data.error | object | Error object from HTTP Request |
start()
NodeAPI.start();
NodeAPI.on('started', (cb) => {
console.log(cb.message)
})
started
event returns the following:
{
message: "NMMOS IS-04 Node server has started"
}
Start the Node server and mDNS services.
Event: 'started'
Fires started
event once the Node server has been started with the following object:
Parameter | Type | Description |
---|---|---|
message | string | Human-friendly message for this event |
stop()
NodeAPI.stop()
NodeAPI.on('stopped', (cb) => {
console.log(cb.message)
})
stopped
event returns the following:
{
message: "NMMOS IS-04 Node server has stopped"
}
Stop the Node server and mDNS services.
Event: 'stopped'
Fires stopped
event once the Node server has been shutdown, with the following object:
Parameter | Type | Description |
---|---|---|
message | string | Human-friendly message for this event |
startMDNS()
NodeAPI.startMDNS()
NodeAPI.on('mdns', {
status: string,
message: string,
data: object
})
mdns
event may return several objects (see docs)
Manually start the mDNS Services. This is automatically started with start()
, but if the mDNS services were manually stopped, you can restart them here.
Event: 'mdns'
{
status: 'advert_start',
message: 'mDNS Advertisement has been started',
data: {
hostname: string,
txtRecord: object
}
}
{
status: 'browse_start',
message: 'mDNS Browse for Registration Servers has been started'
}
Fires mdns
on several different events. The specific event is listed as the status
and the object may be different per each event
Parameter | Type | Description |
---|---|---|
status | string | advert_start Start of the mDNS Advertisement |
message | string | Human-friend message for this event |
data | object | Additional data for this event |
data.hostname | string | mDNS Advertisement hostname |
data.txtRecord | object | txt_records included with mDNS Advertisement |
status | string | browse_start Start of mDNS looking for Registration Servers |
message | string | Human-friend message for this event |
stopMDNS()
NodeAPI.stopMDNS()
NodeAPI.on('mdns', {
status: string,
message: string,
data: object
})
mdns
event may return several objects (see docs)
Manually stop the mDNS Services. This is automatically stopped with stop()
but can also stop mDNS services manually
Event: 'mdns'
{
status: 'advert_stop',
message: 'mDNS Advertisement has stopped'
}
{
status: 'browse_stop',
message: 'mDNS Browse for Registration Servers have stopped'
}
Fires mdns
on several different events. The specific event is listed as the status
and the object may be different per each event
Parameter | Type | Description |
---|---|---|
status | string | advert_stop Stop of the mDNS Advertisement |
message | string | Human-friend message for this event |
status | string | browse_stop Stop of mDNS looking for Registration Servers |
message | string | Human-friend message for this event |
NodeRAMStore
Instantiation
const is04 = require('node-nmos-is04');
let store = new is04.NodeRAMStore();
Create a RAM-based Store for a Node or Registration Server.
getResources()
store.getResources()
Get all Resources currently available in the store.
Return
Example return
{
self: Node {
id: '9cc73ed0-d601-4efe-b974-949de6ae584d',
version: '1567947806:124643978',
label: 'Test Node',
description: '',
caps: {},
tags: [ 'tesing', 'node' ],
href: '',
api: { versions: [Array], endpoints: [Array] },
services: [],
clocks: [],
interfaces: { en0: [Array], en6: [Array] },
hostname: '' },
nodes:
{ '9cc73ed0-d601-4efe-b974-949de6ae584d':
Node {
id: '9cc73ed0-d601-4efe-b974-949de6ae584d',
version: '1567947806:124643978',
label: 'Test Node',
description: '',
caps: {},
tags: [Array],
href: '',
api: [Object],
services: [],
clocks: [],
interfaces: [Object],
hostname: '' } },
devices:
{ 'd00f73c6-7a27-4dc2-a4ad-1c375648bc77':
Device {
id: 'd00f73c6-7a27-4dc2-a4ad-1c375648bc77',
version: '1567947806:133492956',
label: 'Device 1',
description: '',
caps: {},
tags: [],
type: 'urn:x-nmos:device:pipeline',
node_id: '9cc73ed0-d601-4efe-b974-949de6ae584d',
senders: [],
receivers: [],
controls: [] } },
sources:
{ 'ed5ef4b3-6740-4db3-95f5-c907dd84916d':
Source {
id: 'ed5ef4b3-6740-4db3-95f5-c907dd84916d',
version: '1567947806:134232449',
label: 'Source 1',
description: '',
caps: {},
tags: [],
device_id: 'd00f73c6-7a27-4dc2-a4ad-1c375648bc77',
parents: [],
clock_name: null,
grain_rate: null,
format: 'urn:x-nmos:format:video',
channels: null }
},
flows:
{ '44d55a36-b553-42cc-bff1-e451df0e40c1':
Flow {
id: '44d55a36-b553-42cc-bff1-e451df0e40c1',
version: '1567947806:135367354',
label: 'Video Flow',
description: '',
caps: {},
tags: [],
grain_rate: null,
source_id: 'ed5ef4b3-6740-4db3-95f5-c907dd84916d',
device_id: 'd00f73c6-7a27-4dc2-a4ad-1c375648bc77',
parents: [],
format: 'urn:x-nmos:format:video',
frame_width: 1920,
frame_height: 1080,
interlace_mode: 'interlaced_tff',
colorspace: 'BT709',
transfer_characteristics: 'SDR',
media_type: null,
components: null }
},
senders:
{ '3620614c-929f-4fec-b59d-74763c397ece':
Sender {
id: '3620614c-929f-4fec-b59d-74763c397ece',
version: '1567947806:136110405',
label: 'Video Sender',
description: '',
caps: {},
tags: [],
flow_id: '44d55a36-b553-42cc-bff1-e451df0e40c1',
transport: 'urn:x-nmos:transport:rtp.mcast',
device_id: 'd00f73c6-7a27-4dc2-a4ad-1c375648bc77',
manfiest_href: null,
interface_bindings: [Array],
subscription: [Object] }
},
receivers:
{ 'a8f61658-47ad-4212-ab5a-8a659e500ab9':
Receiver {
id: 'a8f61658-47ad-4212-ab5a-8a659e500ab9',
version: '1567947806:136616679',
label: 'Receiver 1',
description: '',
caps: [Array],
tags: [],
device_id: 'd00f73c6-7a27-4dc2-a4ad-1c375648bc77',
transport: 'urn:x-nmos:transport:rtp.mcast',
interface_bindings: [Array],
format: 'urn:x-nmos:format:video',
subscription: [Object] }
}
}
Parameter | Type | Description |
---|---|---|
self | object | Node information when store is used for a Node, not Registration Server |
nodes | object | All Nodes in the store |
devices | object | All Devices in the store |
sources | object | All Sources in the store |
flows | object | All Flows in the store |
senders | object | All Senders in the store |
receivers | object | All Receivers in the store |
getResourceIDs()
store.getResourceIDs()
Get all IDs of all Resources currently available in the store.
Return
Example return
{ self: '3377bbba-a2a8-4b8c-b428-6d45bb60aad7',
nodes: [ '3377bbba-a2a8-4b8c-b428-6d45bb60aad7' ],
devices: [ '4a776a15-93ec-4953-9f86-288929ff33f2' ],
sources:
[ '080fe271-ecce-4bf4-a5ca-e25f1b3b3bcf',
'b3506a57-e9c6-4d33-9f3d-74ea951d68e0' ],
flows:
[ '626b631a-b7fb-4f03-bf20-97fb196eadb0',
'6e0cfe6c-855a-4f97-aa0d-fc9ef5c0473a' ],
senders:
[ '646f3a74-50da-4f87-85d0-19b380bba2b7',
'a0ab0c81-f917-49ff-bd85-ad48489231e9' ],
receivers:
[ '0c442fd0-f31d-4a0e-a495-a6ed0beb1c96',
'c7909c21-bd7d-4318-9913-bba6c3cb9f66' ] }
Parameter | Type | Description |
---|---|---|
self | object | Node information when store is used for a Node, not Registration Server |
nodes | array | All Node IDs in the store |
devices | array | All Device IDs in the store |
sources | array | All Sources IDs in the store |
flows | array | All Flow IDs in the store |
senders | array | All Sender IDs in the store |
receivers | array | All Receiver IDs in the store |
getResourceCounts()
store.getResourceCounts()
Get counts of objects currently in the store
Return
Example return
{ self: 1,
nodes: 1,
devices: 1,
sources: 2,
flows: 2,
senders: 2,
receivers: 2 }
Parameter | Type | Description |
---|---|---|
self | number | 1 if store used as Node, 0 if Registration Server |
nodes | number | Count of Nodes |
devices | number | Count of Devices |
sources | number | Count of Sources |
flows | number | Count of Flows |
senders | number | Count of Senders |
receivers | number | Count of Receivers |
getSelf()
store.getSelf()
Get the currently stored Node as Self, when store is used as Node, not Registration Server
Return
Example return
Node {
id: '9cc73ed0-d601-4efe-b974-949de6ae584d',
version: '1567947806:124643978',
label: 'Test Node',
description: '',
caps: {},
tags: [ 'tesing', 'node' ],
href: '',
api: { versions: [Array], endpoints: [Array] },
services: [],
clocks: [],
interfaces: { en0: [Array], en6: [Array] },
hostname: '' }
See Node Model
setSelf()
store.setSelf(new is04.Node({
label: "Test Node",
description: "This is a test node",
tags: ["tesing", "node"],
interfaces: ["en0"]
}))
Set the Node for self
, when used for a Node server, not Registration Server
Parameters
See Node model
Return
Example return
Node {
id: '9cc73ed0-d601-4efe-b974-949de6ae584d',
version: '1567947806:124643978',
label: 'Test Node',
description: '',
caps: {},
tags: [ 'tesing', 'node' ],
href: '',
api: { versions: [Array], endpoints: [Array] },
services: [],
clocks: [],
interfaces: { en0: [Array], en6: [Array] },
hostname: '' }
Returns same node
that was set. See Node Model.
putNode()
store.putNode(new is04.Node({
label: "Test Node",
description: "This is a test node",
tags: ["tesing", "node"],
interfaces: ["en0"]
}))
Put a node
in the nodes
store
Parameters
See Node model
Return
Example return
Node {
id: '9cc73ed0-d601-4efe-b974-949de6ae584d',
version: '1567947806:124643978',
label: 'Test Node',
description: '',
caps: {},
tags: [ 'tesing', 'node' ],
href: '',
api: { versions: [Array], endpoints: [Array] },
services: [],
clocks: [],
interfaces: { en0: [Array], en6: [Array] },
hostname: '' }
Returns same node
that was put. See Node Model.
getNodes()
store.getNodes()
store.getNodes([
'9cc73ed0-d601-4efe-b974-949de6ae584d',
'ed5ef4b3-6740-4db3-95f5-c907dd84916d',
'd00f73c6-7a27-4dc2-a4ad-1c375648bc77'
])
store.getNodes('9cc73ed0-d601-4efe-b974-949de6ae584d')
Get one or more Nodes from the store.
Parameters
getNodes()
accepts either a string or array of strings to return specific Nodes. If no parameter provided, returns all nodes on the store.
Parameter | Type | Description |
---|---|---|
uuid | string | UUID of a single Node to return |
uuid | [string] | Array of UUIDs to return |
Return
Example Return
[
{
id: '9cc73ed0-d601-4efe-b974-949de6ae584d',
version: '1567947806:124643978',
label: 'Test Node',
description: '',
caps: {},
tags: [ 'tesing', 'node' ],
href: '',
api: { versions: [Array], endpoints: [Array] },
services: [],
clocks: [],
interfaces: { en0: [Array], en6: [Array] },
hostname: ''
},
{ ... }
]
Returns an array of Nodes. See Node model
getNode()
store.getNode('9cc73ed0-d601-4efe-b974-949de6ae584d')
Get one Node from the store.
Parameters
Requires UUID to return
Parameter | Type | Description |
---|---|---|
uuid | string | UUID of a single Node to return |
Return
Example Return
{
id: '9cc73ed0-d601-4efe-b974-949de6ae584d',
version: '1567947806:124643978',
label: 'Test Node',
description: '',
caps: {},
tags: [ 'tesing', 'node' ],
href: '',
api: { versions: [Array], endpoints: [Array] },
services: [],
clocks: [],
interfaces: { en0: [Array], en6: [Array] },
hostname: ''
}
Returns a single Node. See Node model
deleteNode()
store.deleteNode('9cc73ed0-d601-4efe-b974-949de6ae584d')
Delete a Node from the store
Parameters
Requires UUID to delete
Parameter | Type | Description |
---|---|---|
uuid | string | UUID of a single Node to delete |
Return
Example Return
'9cc73ed0-d601-4efe-b974-949de6ae584d'
Returns ID of the deleted Node as a String
putDevice()
store.putDevice(new is04.Device({
node_id: '9cc73ed0-d601-4efe-b974-949de6ae584d',
label: "Device 1",
description: "A multifaceted device"
}))
Put a device
in the devices
store
Parameters
See Device model
Return
Example return
Device {
id: 'd00f73c6-7a27-4dc2-a4ad-1c375648bc77',
version: '1567947806:133492956',
label: 'Device 1',
description: '',
caps: {},
tags: [],
type: 'urn:x-nmos:device:pipeline',
node_id: '9cc73ed0-d601-4efe-b974-949de6ae584d',
senders: [],
receivers: [],
controls: [] }
Returns same device
that was put. See Device Model.
getDevices()
store.getDevices()
store.getDevices([
'9cc73ed0-d601-4efe-b974-949de6ae584d',
'ed5ef4b3-6740-4db3-95f5-c907dd84916d',
'd00f73c6-7a27-4dc2-a4ad-1c375648bc77'
])
store.getDevices('9cc73ed0-d601-4efe-b974-949de6ae584d')
Get one or more Devices from the store.
Parameters
getDevices()
accepts either a string or array of strings to return specific Devices. If no parameter provided, returns all devices on the store.
Parameter | Type | Description |
---|---|---|
uuid | string | UUID of a single Device to return |
uuid | [string] | Array of UUIDs to return |
Return
Example Return
[
{
id: 'd00f73c6-7a27-4dc2-a4ad-1c375648bc77',
version: '1567947806:133492956',
label: 'Device 1',
description: '',
caps: {},
tags: [],
type: 'urn:x-nmos:device:pipeline',
node_id: '9cc73ed0-d601-4efe-b974-949de6ae584d',
senders: [],
receivers: [],
controls: []
},
{ ... }
]
Returns an array of Devices. See Device model
getDevice()
store.getDevice('9cc73ed0-d601-4efe-b974-949de6ae584d')
Get one Device from the store.
Parameters
Requires UUID to return
Parameter | Type | Description |
---|---|---|
uuid | string | UUID of a single Device to return |
Return
Example Return
{
id: 'd00f73c6-7a27-4dc2-a4ad-1c375648bc77',
version: '1567947806:133492956',
label: 'Device 1',
description: '',
caps: {},
tags: [],
type: 'urn:x-nmos:device:pipeline',
node_id: '9cc73ed0-d601-4efe-b974-949de6ae584d',
senders: [],
receivers: [],
controls: []
}
Returns a single Device. See Device model
deleteDevice()
store.deleteDevice('9cc73ed0-d601-4efe-b974-949de6ae584d')
Delete a Device from the store
Parameters
Requires UUID to delete
Parameter | Type | Description |
---|---|---|
uuid | string | UUID of a single Device to delete |
Return
Example Return
'9cc73ed0-d601-4efe-b974-949de6ae584d'
Returns ID of the deleted Device as a String
putSource()
store.putSource(new is04.Source({
label: "Source 1",
description: "This is the first source",
device_id: 'd00f73c6-7a27-4dc2-a4ad-1c375648bc77',
format: "urn:x-nmos:format:video"
}))
Put a source
in the sources
store
Parameters
See Source model
Return
Example return
Sender {
id: '3620614c-929f-4fec-b59d-74763c397ece',
version: '1567947806:136110405',
label: 'Video Sender',
description: '',
caps: {},
tags: [],
flow_id: '44d55a36-b553-42cc-bff1-e451df0e40c1',
transport: 'urn:x-nmos:transport:rtp.mcast',
device_id: 'd00f73c6-7a27-4dc2-a4ad-1c375648bc77',
manfiest_href: null,
interface_bindings: [Array],
subscription: [Object] }
Returns same source
that was put. See Source Model.
getSources()
store.getSources()
store.getSources([
'9cc73ed0-d601-4efe-b974-949de6ae584d',
'ed5ef4b3-6740-4db3-95f5-c907dd84916d',
'd00f73c6-7a27-4dc2-a4ad-1c375648bc77'
])
store.getSources('9cc73ed0-d601-4efe-b974-949de6ae584d')
Get one or more Sources from the store.
Parameters
getSources()
accepts either a string or array of strings to return specific Sources. If no parameter provided, returns all sources on the store.
Parameter | Type | Description |
---|---|---|
uuid | string | UUID of a single Source to return |
uuid | [string] | Array of UUIDs to return |
Return
Example Return
[
{
id: '3620614c-929f-4fec-b59d-74763c397ece',
version: '1567947806:136110405',
label: 'Video Sender',
description: '',
caps: {},
tags: [],
flow_id: '44d55a36-b553-42cc-bff1-e451df0e40c1',
transport: 'urn:x-nmos:transport:rtp.mcast',
device_id: 'd00f73c6-7a27-4dc2-a4ad-1c375648bc77',
manfiest_href: null,
interface_bindings: [Array],
subscription: [Object]
},
{ ... }
]
Returns an array of Sources. See Source model
getSource()
store.getSource('9cc73ed0-d601-4efe-b974-949de6ae584d')
Get one Source from the store.
Parameters
Requires UUID to return
Parameter | Type | Description |
---|---|---|
uuid | string | UUID of a single Source to return |
Return
Example Return
{
id: '3620614c-929f-4fec-b59d-74763c397ece',
version: '1567947806:136110405',
label: 'Video Sender',
description: '',
caps: {},
tags: [],
flow_id: '44d55a36-b553-42cc-bff1-e451df0e40c1',
transport: 'urn:x-nmos:transport:rtp.mcast',
device_id: 'd00f73c6-7a27-4dc2-a4ad-1c375648bc77',
manfiest_href: null,
interface_bindings: [Array],
subscription: [Object]
}
Returns a single Source. See Source model
deleteSource()
store.deleteSource('9cc73ed0-d601-4efe-b974-949de6ae584d')
Delete a Source from the store
Parameters
Requires UUID to delete
Parameter | Type | Description |
---|---|---|
uuid | string | UUID of a single Source to delete |
Return
Example Return
'9cc73ed0-d601-4efe-b974-949de6ae584d'
Returns ID of the deleted Source as a String
putFlow()
store.putFlow(new is04.Flow({
label: 'Video Flow',
description: "This is the first Video flow",
source_id: 'ed5ef4b3-6740-4db3-95f5-c907dd84916d',
device_id: 'd00f73c6-7a27-4dc2-a4ad-1c375648bc77',
flow_type: "video",
video: {
frame_width: 1920,
frame_height: 1080,
interlace_mode: "interlaced_tff",
colorspace: "BT709"
}
})
Put a flow
in the flows
store
Parameters
See Flow model
Return
Example return
Flow {
id: '44d55a36-b553-42cc-bff1-e451df0e40c1',
version: '1567947806:135367354',
label: 'Video Flow',
description: '',
caps: {},
tags: [],
grain_rate: null,
source_id: 'ed5ef4b3-6740-4db3-95f5-c907dd84916d',
device_id: 'd00f73c6-7a27-4dc2-a4ad-1c375648bc77',
parents: [],
format: 'urn:x-nmos:format:video',
frame_width: 1920,
frame_height: 1080,
interlace_mode: 'interlaced_tff',
colorspace: 'BT709',
transfer_characteristics: 'SDR',
media_type: null,
components: null }
Returns same flow
that was put. See Flow Model.
getFlows()
store.getFlows()
store.getFlows([
'9cc73ed0-d601-4efe-b974-949de6ae584d',
'ed5ef4b3-6740-4db3-95f5-c907dd84916d',
'd00f73c6-7a27-4dc2-a4ad-1c375648bc77'
])
store.getFlows('9cc73ed0-d601-4efe-b974-949de6ae584d')
Get one or more Flows from the store.
Parameters
getFlows()
accepts either a string or array of strings to return specific Flows. If no parameter provided, returns all flows on the store.
Parameter | Type | Description |
---|---|---|
uuid | string | UUID of a single Flow to return |
uuid | [string] | Array of UUIDs to return |
Return
Example Return
[
{
id: '44d55a36-b553-42cc-bff1-e451df0e40c1',
version: '1567947806:135367354',
label: 'Video Flow',
description: '',
caps: {},
tags: [],
grain_rate: null,
source_id: 'ed5ef4b3-6740-4db3-95f5-c907dd84916d',
device_id: 'd00f73c6-7a27-4dc2-a4ad-1c375648bc77',
parents: [],
format: 'urn:x-nmos:format:video',
frame_width: 1920,
frame_height: 1080,
interlace_mode: 'interlaced_tff',
colorspace: 'BT709',
transfer_characteristics: 'SDR',
media_type: null,
components: null
},
{ ... }
]
Returns an array of Flows. See Flow model
getFlow()
store.getFlow('9cc73ed0-d601-4efe-b974-949de6ae584d')
Get one Flow from the store.
Parameters
Requires UUID to return
Parameter | Type | Description |
---|---|---|
uuid | string | UUID of a single Flow to return |
Return
Example Return
{
id: '44d55a36-b553-42cc-bff1-e451df0e40c1',
version: '1567947806:135367354',
label: 'Video Flow',
description: '',
caps: {},
tags: [],
grain_rate: null,
source_id: 'ed5ef4b3-6740-4db3-95f5-c907dd84916d',
device_id: 'd00f73c6-7a27-4dc2-a4ad-1c375648bc77',
parents: [],
format: 'urn:x-nmos:format:video',
frame_width: 1920,
frame_height: 1080,
interlace_mode: 'interlaced_tff',
colorspace: 'BT709',
transfer_characteristics: 'SDR',
media_type: null,
components: null
}
Returns a single Flow. See Flow model
deleteFlow()
store.deleteFlow('9cc73ed0-d601-4efe-b974-949de6ae584d')
Delete a Flow from the store
Parameters
Requires UUID to delete
Parameter | Type | Description |
---|---|---|
uuid | string | UUID of a single Flow to delete |
Return
Example Return
'9cc73ed0-d601-4efe-b974-949de6ae584d'
Returns ID of the deleted Flow as a String
putSender()
store.putFlow(new is04.Sender({
label: 'Audio Sender',
flow_id: "44d55a36-b553-42cc-bff1-e451df0e40c1",
transport: 'urn:x-nmos:transport:rtp.mcast',
device_id: "9cc73ed0-d601-4efe-b974-949de6ae584d",
interface_bindings: ["en0"]
}))
Put a sender
in the senders
store
Parameters
See Sender model
Return
Example return
Sender {
id: '3620614c-929f-4fec-b59d-74763c397ece',
version: '1567947806:136110405',
label: 'Video Sender',
description: '',
caps: {},
tags: [],
flow_id: '44d55a36-b553-42cc-bff1-e451df0e40c1',
transport: 'urn:x-nmos:transport:rtp.mcast',
device_id: 'd00f73c6-7a27-4dc2-a4ad-1c375648bc77',
manfiest_href: null,
interface_bindings: [Array],
subscription: [Object] }
Returns same sender
that was put. See Sender Model.
getSenders()
store.getSenders()
store.getSenders([
'9cc73ed0-d601-4efe-b974-949de6ae584d',
'ed5ef4b3-6740-4db3-95f5-c907dd84916d',
'd00f73c6-7a27-4dc2-a4ad-1c375648bc77'
])
store.getSenders('9cc73ed0-d601-4efe-b974-949de6ae584d')
Get one or more Senders from the store.
Parameters
getSenders()
accepts either a string or array of strings to return specific Senders. If no parameter provided, returns all senders on the store.
Parameter | Type | Description |
---|---|---|
uuid | string | UUID of a single Sender to return |
uuid | [string] | Array of UUIDs to return |
Return
Example Return
[
{
id: '3620614c-929f-4fec-b59d-74763c397ece',
version: '1567947806:136110405',
label: 'Video Sender',
description: '',
caps: {},
tags: [],
flow_id: '44d55a36-b553-42cc-bff1-e451df0e40c1',
transport: 'urn:x-nmos:transport:rtp.mcast',
device_id: 'd00f73c6-7a27-4dc2-a4ad-1c375648bc77',
manfiest_href: null,
interface_bindings: [Array],
subscription: [Object]
},
{ ... }
]
Returns an array of Senders. See Sender model
getSender()
store.getSender('9cc73ed0-d601-4efe-b974-949de6ae584d')
Get one Sender from the store.
Parameters
Requires UUID to return
Parameter | Type | Description |
---|---|---|
uuid | string | UUID of a single Sender to return |
Return
Example Return
{
id: '3620614c-929f-4fec-b59d-74763c397ece',
version: '1567947806:136110405',
label: 'Video Sender',
description: '',
caps: {},
tags: [],
flow_id: '44d55a36-b553-42cc-bff1-e451df0e40c1',
transport: 'urn:x-nmos:transport:rtp.mcast',
device_id: 'd00f73c6-7a27-4dc2-a4ad-1c375648bc77',
manfiest_href: null,
interface_bindings: [Array],
subscription: [Object] }
Returns a single Sender. See Sender model
deleteSender()
store.deleteSender('9cc73ed0-d601-4efe-b974-949de6ae584d')
Delete a Sender from the store
Parameters
Requires UUID to delete
Parameter | Type | Description |
---|---|---|
uuid | string | UUID of a single Sender to delete |
Return
Example Return
'9cc73ed0-d601-4efe-b974-949de6ae584d'
Returns ID of the deleted Sender as a String
putReceiver()
store.putReceiver(new is04.Receiver({
label: 'Receiver 1',
device_id: 'd00f73c6-7a27-4dc2-a4ad-1c375648bc77',
transport: 'urn:x-nmos:transport:rtp.mcast',
interface_bindings: ["en0"],
receiver_type: "video",
caps: ["video/raw"]
}))
Put a receiver
in the receivers
store
Parameters
See Receiver model
Return
Example return
Receiver {
id: 'a8f61658-47ad-4212-ab5a-8a659e500ab9',
version: '1567947806:136616679',
label: 'Receiver 1',
description: '',
caps: [Array],
tags: [],
device_id: 'd00f73c6-7a27-4dc2-a4ad-1c375648bc77',
transport: 'urn:x-nmos:transport:rtp.mcast',
interface_bindings: [Array],
format: 'urn:x-nmos:format:video',
subscription: [Object] }
}
Returns same receiver
that was put. See Receiver Model.
getReceivers()
store.getReceivers()
store.getReceivers([
'9cc73ed0-d601-4efe-b974-949de6ae584d',
'ed5ef4b3-6740-4db3-95f5-c907dd84916d',
'd00f73c6-7a27-4dc2-a4ad-1c375648bc77'
])
store.getReceivers('9cc73ed0-d601-4efe-b974-949de6ae584d')
Get one or more Receivers from the store.
Parameters
getReceivers()
accepts either a string or array of strings to return specific Receivers. If no parameter provided, returns all receivers on the store.
Parameter | Type | Description |
---|---|---|
uuid | string | UUID of a single Receiver to return |
uuid | [string] | Array of UUIDs to return |
Return
Example Return
[
{
id: 'a8f61658-47ad-4212-ab5a-8a659e500ab9',
version: '1567947806:136616679',
label: 'Receiver 1',
description: '',
caps: [Array],
tags: [],
device_id: 'd00f73c6-7a27-4dc2-a4ad-1c375648bc77',
transport: 'urn:x-nmos:transport:rtp.mcast',
interface_bindings: [Array],
format: 'urn:x-nmos:format:video',
subscription: [Object]
},
{ ... }
]
Returns an array of Receivers. See Receiver model
getReceiver()
store.getReceiver('9cc73ed0-d601-4efe-b974-949de6ae584d')
Get one Receiver from the store.
Parameters
Requires UUID to return
Parameter | Type | Description |
---|---|---|
uuid | string | UUID of a single Receiver to return |
Return
Example Return
{
id: 'a8f61658-47ad-4212-ab5a-8a659e500ab9',
version: '1567947806:136616679',
label: 'Receiver 1',
description: '',
caps: [Array],
tags: [],
device_id: 'd00f73c6-7a27-4dc2-a4ad-1c375648bc77',
transport: 'urn:x-nmos:transport:rtp.mcast',
interface_bindings: [Array],
format: 'urn:x-nmos:format:video',
subscription: [Object]
}
Returns a single Receiver. See Receiver model
deleteReceiver()
store.deleteReceiver('9cc73ed0-d601-4efe-b974-949de6ae584d')
Delete a Receiver from the store
Parameters
Requires UUID to delete
Parameter | Type | Description |
---|---|---|
uuid | string | UUID of a single Receiver to delete |
Return
Example Return
'9cc73ed0-d601-4efe-b974-949de6ae584d'
Returns ID of the deleted Receiver as a String
RegistrationAPI
Instantiation
const is04 = require('node-nmos-is04');
let store = new is04.NodeRAMStore()
let RegistrationAPI = new is04.RegistrationAPI({
store: store,
address: '0.0.0.0:3001'
});
RegistrationAPI.on('heartbeat', (cb) => {
console.log(`${cb.status}: ${cb.message} | Time since last: ${cb.data.timeSinceLast}` )
})
Start a NMOS IS-04 Registration Server. The Registration Server is compliant with the REST API as defined by NMOS in their documentation up to NMOS v1.3
Parameters
Parameter | Required | Default | Description |
---|---|---|---|
store | required | Node Store for access to Registry information | |
address | optional | 'localhost:3000' | Interface address and port |
hostname | optional | 'nmos_reg' | Hostname of Registry instance |
priority | optional | 100 | Registry Server Priority |
Event: 'heartbeat'
{
status: 'received',
message: 'Heartbeat received from Node',
data: {
id: string,
timeSeconds: number,
timeSinceLast: number,
time: number
}
}
Fires heartbeat
when a heartbeat is received from a Node. Each heartbeat
records the Javascript time in Unix milliseconds so a "ping-pong" latency can be determined. Heartbeats SHOULD be received from the Node every 5 seconds.
Parameter | Type | Description |
---|---|---|
status | string | received Registration Server has received a heartbeat response from the Node |
message | string | Human-friend message for this event |
data | object | Object with details about the heartbeat |
data.id | string | ID of the reporting Node |
data.timeSeconds | number | Time when heartbeat was received, in seconds |
data.timeSinceLast | number | Amount of time since the last heartbeat |
data.time | number | Javascript timestamp (Unix milliseconds) of when heartbeat was received |
RegistrationAPI.start()
RegistrationAPI.start()
RegistrationAPI.on('started', (cb) => {
console.log(cb.message)
})
Start the Registration Server and mDNS services
Event: 'started'
{
message: "NMOS IS-04 Registration Server Started"
}
Fires started
upon start of the registry server
Parameter | Type | Description |
---|---|---|
message | string | Human-friendly message for this event |
RegistrationAPI.stop()
RegistrationAPI.stop()
RegistrationAPI.on('stopped', (cb) => {
console.log(cb.message)
})
Stop the Registration Server
Event: 'stopped'
{
message: "NMOS IS-04 Registration Server stopped"
}
Fires stopped
upon start of the registry server
Parameter | Type | Description |
---|---|---|
message | string | Human-friendly message for this event |
RegistrationAPI.startMDNS()
RegistrationAPI.startMDNS()
RegistrationAPI.on('mdns', (cb) => {
console.log(cb.message, cb.data)
})
mdns
event may return several objects
Manually start the mDNS Services. This is automatically started with start()
, but if the mDNS services were manually stopped, you can restart them here.
Event: 'mdns'
{
status: 'advert_start',
message: 'mDNS Advertisement has been started',
data: {
hostname: string,
txtRecord: {
pri: number
}
}
}
Fires mdns
on several different events. The specific event is listed as the status
and the object may be different per each event
Parameter | Type | Description |
---|---|---|
status | string | advert_start Start of the mDNS Advertisement |
message | string | Human-friend message for this event |
data | object | Additional data for this event |
data.hostname | string | mDNS Advertisement hostname |
data.txtRecord | object | txt_records included with mDNS Advertisement |
data.txtRecord.pri | number | Registration Server Priority Number |
RegistrationAPI.stopMDNS()
RegistrationAPI.stopMDNS()
RegistrationAPI.on('mdns', (cb) => {
console.log(cb.message)
})
mdns
event may return several objects (see docs)
Manually stop the mDNS Services. This is automatically stopped with stop()
but can also stop mDNS services manually
Event: 'mdns'
{
status: 'advert_stop',
message: 'mDNS Advertisement has stopped'
}
Fires mdns
on several different events. The specific event is listed as the status
and the object may be different per each event
Parameter | Type | Description |
---|---|---|
status | string | advert_stop Stop of the mDNS Advertisement |
message | string | Human-friend message for this event |
QueryAPI
Instantiation
const is04 = require('node-nmos-is04');
let store = new is04.NodeRAMStore()
let QueryAPI = new is04.QueryAPI({
store: store
});
Start a NMOS IS-04 Query Service. The Query Service is compliant with the REST API as defined by NMOS in their documentation up to NMOS v1.3.
The Query Service also supports WebSocket connections as per NMOS documentation on Querying Behavior. In general, the API endpoint POST /subscriptions
allows for a WebSocket host to be created on the Query server for clients to connect to and receive real-time updates of resource changes in the store.
The Query Services DOES NOT yet support RQL Queries, as they are specified as optional in the IS-04 v1.3 standard.
Parameters
Parameter | Required | Default | Description |
---|---|---|---|
store | required | Node Store for access to Registry information | |
address | optional | 'localhost:3002' | Interface address and port |
QueryAPI.start()
QueryAPI.start()
QueryAPI.on('started', (cb) => {
console.log(cb.message)
})
Start the Query API server to interact with a particular store
Event: 'started'
Event fires
{
message: "NMOS IS-04 Query Service Started"
}
Fires started
upon start of the query service
Parameter | Type | Description |
---|---|---|
message | string | Human-friendly message for this event |
Event: 'ws'
QueryAPI.on('ws', (cb) => {
console.log(cb.message)
})
Event fires
{
event: 'start',
message: "webSocket service started"
}
Fires when the websocket server is started
Parameter | Type | Description |
---|---|---|
message | string | Human-friendly message for this event |
Model: Node
Instantiation
let node = new is04.Node({
label: 'Test Node',
description: "This is a new test node"
})
Returns the following object
{
id: string,
version: string,
label: string,
description: string,
caps: [object],
tags: [string],
href: string,
services: [object],
clocks: [object],
interfaces: [string],
hostname: string
}
Create new a new Node object.
Parameters
All parameters are optional and will take default values if not provided. Additional properties of the Node are generated automatically. If no ID is provided, Serial number is required to generated UUID.
Parameter | Type | Required | Description |
---|---|---|---|
id | string | Globally unique UUID identifier for the Node | |
serial | string | Serial number of this physical device | |
version | string | String formatted PTP timestamp | |
label | string | Freeform string label for the Node. | |
desc | string | Detailed description of the resource | |
caps | [object] | Array of Capabilities (not yet defined) | |
tags | [string] | Array of tags | |
href | string | HTTP access href for Node's API (deprecated) | |
services | [object] | Array of Services | |
clocks | [object] | Array of Clocks | |
interfaces | [string] | String or Array of strings to only include certain interfaces |
Return
The resulting Node
instance will have the following properties:
Parameter | Type | Default | Description |
---|---|---|---|
id | string | Globally unique UUID identifier for the Node | |
version | string | String formatted PTP timestamp | |
label | string | Freeform string label for the Node. | |
desc | string | Detailed description of the resource | |
caps | [object] | [] | Array of Capabilities (not yet defined) |
tags | [string] | [] | Array of tags |
href | string | HTTP access href for Node's API (deprecated) | |
hostname | string | Hostname for Node's API (deprecated) | |
services | [object] | [] | Array of Services |
clocks | [object] | [] | Array of Clocks |
interfaces | [string] | [] | String or Array of strings to only include certain interfaces |
valid()
Returns true
if current Device is validated against the JSON Schema provided by NMOS IS-04. Not yet implemented.
Model: Device
Instantiation
let device = new is04.Device({
node_id: '9cc73ed0-d601-4efe-b974-949de6ae584d',
label: "Device 1",
description: "A multifaceted device"
})
Returns the following object
{
node_id: string,
id: string,
version: string,
label: string,
description: string,
caps: [object],
tags: [string],
type: string,
senders: [string],
receivers: [string],
controls: [string]
}
Create new a new Device object.
Parameters
Only a node_id
is required, all other parameters are optional. All properties will be generated automatically if not provided. If no ID is provided, Serial number is required to generated UUID.
Parameter | Type | Required | Description |
---|---|---|---|
id | string | Globally unique UUID identifier for the Device | |
serial | string | Serial number of this physical device | |
version | string | String formatted PTP timestamp | |
label | string | Freeform string label for the Device. | |
desc | string | Detailed description of the resource | |
caps | [object] | Array of Capabilities (not yet defined) | |
tags | [string] | Array of tags | |
node_id | string | required | UUID for the Node that created this Device |
type | string | Device Type URN | |
controls | [string] | Control endpoints exposed for the Device |
Return
The resulting Device
instance will have the following properties:
Parameter | Type | Default | Description |
---|---|---|---|
id | string | Globally unique UUID identifier for the Device | |
version | string | String formatted PTP timestamp | |
label | string | Freeform string label for the Device. | |
desc | string | Detailed description of the resource | |
caps | [object] | [] | Array of Capabilities (not yet defined) |
tags | [string] | [] | Array of tags |
node_id | string | UUID for the Node that created this Device | |
type | string | "urn:x-nmos:device:pipeline" | Device Type URN |
senders | [string] | [] | UUIDs of Senders attached to the Device (deprecated) |
receivers | [string] | [] | UUIDs of Receivers attached to the Device (deprecated) |
controls | [string] | [] | Control endpoints exposed for the Device |
valid()
Returns true
if current Device is validated against the JSON Schema provided by NMOS IS-04. Not yet implemented.
Model: Source
Instantiation
let source = new is04.Source({
label: "Source 1",
description: "This is the first source",
device_id: '9cc73ed0-d601-4efe-b974-949de6ae584d',
format: "urn:x-nmos:format:video"
})
Returns the following object
{
id: string,
version: string,
label: string,
description: string,
caps: [object],
tags: [string],
device_id: string,
parents: [string],
clock_name: object,
grain_rate: object,
format: string,
channels: [object]
}
Create new a new Source object.
Parameters
device_id
and format
are required, all other parameters are optional. All properties will be generated automatically if not provided. If no ID is provided, Serial number is required to generated UUID.
Parameter | Type | Required | Description |
---|---|---|---|
id | string | Globally unique UUID identifier for the Source | |
serial | string | Serial number of this physical device | |
version | string | String formatted PTP timestamp | |
label | string | Freeform string label for the Source. | |
desc | string | Detailed description of the resource | |
caps | [object] | Array of Capabilities (not yet defined) | |
tags | [string] | Array of tags | |
device_id | string | required | UUID for the Device which initially created the Source. This attribute is used to ensure referential integrity by registry implementations. |
format | string | required | Source Format |
parents | [string] | Array of UUIDs representing the Source IDs of Grains which came together at the input to this Source (may change over the lifetime of this Source) | |
clock_name | string | Reference to clock in the originating Node | |
grain_rate | object | Maximum number of Grains per second for Flows derived from this Source.Corresponding Flow Grain rates may override this attribute. Grain rate matches the frame rate for video (see NMOS Content Model). Specified for periodic Sources only | |
grain_rate.numerator | number | Grain Rate Numerator | |
grain_rate.denominator | number | Grain Rate Denominator | |
channels | [object] | Array of audio channels objects | |
channels.label | string | Label for an audio channel (free text) | |
channels.symbol | string | Symbol for this channel (per VSF TR-03 Appendix A) |
Return
The resulting Source
instance will have the following properties:
Parameter | Type | Default | Description |
---|---|---|---|
id | string | Globally unique UUID identifier for the Source | |
version | string | String formatted PTP timestamp | |
label | string | Freeform string label for the Source. | |
desc | string | Detailed description of the resource | |
caps | [object] | [] | Array of Capabilities (not yet defined) |
tags | [string] | [] | Array of tags |
device_id | string | UUID for the Device which initially created the Source. This attribute is used to ensure referential integrity by registry implementations. | |
format | string | Source Format | |
parents | [string] | [] | Array of UUIDs representing the Source IDs of Grains which came together at the input to this Source (may change over the lifetime of this Source) |
clock_name | string | null | Reference to clock in the originating Node |
grain_rate | object | null | Maximum number of Grains per second for Flows derived from this Source.Corresponding Flow Grain rates may override this attribute. Grain rate matches the frame rate for video (see NMOS Content Model). Specified for periodic Sources only |
grain_rate.numerator | number | Grain Rate Numerator | |
grain_rate.denominator | number | Grain Rate Denominator | |
channels | [object] | null | Array of audio channels objects |
channels.label | string | Label for an audio channel (free text) | |
channels.symbol | string | Symbol for this channel (per VSF TR-03 Appendix A) |
valid()
Returns true
if current Source is validated against the JSON Schema provided by NMOS IS-04. Not yet implemented.
Model: Flow
Instantiation
let flow = new is04.Flow({
label: 'Video Flow',
description: "This is the first Video flow",
source_id: '9cc73ed0-d601-4efe-b974-949de6ae584d',
device_id: 'd00f73c6-7a27-4dc2-a4ad-1c375648bc77',
flow_type: "video",
video: {
frame_width: 1920,
frame_height: 1080,
interlace_mode: "interlaced_tff",
colorspace: "BT709"
}
})
Returns the following object (some properties dependent on format)
{
id: string,
version: string,
label: string,
description: string,
caps: [object],
tags: [string],
device_id: string,
source_id: string,
parents: [string],
grain_rate: object,
format: string,
sample_rate: object,
media_type: string,
bit_depth: number,
frame_width: number,
frame_height: number,
interlace_mode: string,
colorspace: string,
transfer_characteristics: string,
media_type: string,
components: [object],
did_sdid: [string]
}
Create new a new Flow object.
Parameters
device_id
, source_id
and flow_type
are required, all other parameters are optional. All properties will be generated automatically if not provided.
Parameter | Type | Required | Description |
---|---|---|---|
id | string | Globally unique UUID identifier for the Flow | |
version | string | String formatted PTP timestamp | |
label | string | Freeform string label for the Flow. | |
desc | string | Detailed description of the resource | |
caps | [object] | Array of Capabilities (not yet defined) | |
tags | [string] | Array of tags | |
flow_type | string | required | Type of flow to create |
device_id | string | required | UUID for the Device which initially created the Source. This attribute is used to ensure referential integrity by registry implementations (v1.1 onward). |
source_id | string | required | UUID for the Source which initially created the Flow. This attribute is used to ensure referential integrity by registry implementations (v1.0 only). |
parents | [string] | Array of UUIDs representing the Flow IDs of Grains which came together to generate this Flow (may change over the lifetime of this Flow) | |
grain_rate | object | Maximum number of Grains per second for Flows derived from this Source.Corresponding Flow Grain rates may override this attribute. Grain rate matches the frame rate for video (see NMOS Content Model). Specified for periodic Sources only | |
grain_rate.numerator | number | Grain Rate Numerator | |
grain_rate.denominator | number | Grain Rate Denominator | |
sample_rate | object | Number of Audio Samples per second for this flow (required for audio flows) | |
sample_rate.numerator | number | Sample Rate Numerator | |
sample_rate.denominator | number | Sample Rate Denominator | |
media_type | string | Subclassification of the format using IANA assigned media types | |
bit_depth | number | Bit depth of the audio samples | |
frame_width | number | Width of the picture in pixels | |
frame_height | number | Height of the picture in pixels | |
interlace_mode | string | Interlaced video mode for the frames in this flow | |
colorspace | string | Colorspace used for the video | |
transfer_characteristics | string | Transfer Characteristic | |
components | [object] | Array of objects describing the components | |
components.name | string | Name of this component | |
components.width | number | Width of this component in pixels | |
components.height | number | Height of this component in pixels | |
components.bit_depth | number | Number of bits used to describe each sample | |
did_sdid | object | List of Data identification and secondary data identification words | |
did_sdid.DID | string | Data Identification Word | |
did_sdid.SDID | string | Secondary data identification word |
Return
The resulting Flow
instance will have the following properties:
Parameter | Type | Default | Description |
---|---|---|---|
id | string | Globally unique UUID identifier for the Flow | |
version | string | String formatted PTP timestamp | |
label | string | Freeform string label for the Flow. | |
desc | string | Detailed description of the resource | |
caps | [object] | Array of Capabilities (not yet defined) | |
tags | [string] | Array of tags | |
device_id | string | UUID for the Device which initially created the Source. This attribute is used to ensure referential integrity by registry implementations (v1.1 onward). | |
source_id | string | UUID for the Source which initially created the Flow. This attribute is used to ensure referential integrity by registry implementations (v1.0 only). | |
parents | [string] | [] | Array of UUIDs representing the Flow IDs of Grains which came together to generate this Flow (may change over the lifetime of this Flow) |
format | string | Source Format | |
grain_rate | object | Maximum number of Grains per second for Flows derived from this Source.Corresponding Flow Grain rates may override this attribute. Grain rate matches the frame rate for video (see NMOS Content Model). Specified for periodic Sources only | |
grain_rate.numerator | number | Grain Rate Numerator | |
grain_rate.denominator | number | Grain Rate Denominator | |
sample_rate | object | Number of Audio Samples per second for this flow (required for audio flows) | |
sample_rate.numerator | number | Sample Rate Numerator | |
sample_rate.denominator | number | Sample Rate Denominator | |
media_type | string | Subclassification of the format using IANA assigned media types | |
bit_depth | number | Bit depth of the audio samples | |
frame_width | number | Width of the picture in pixels | |
frame_height | number | Height of the picture in pixels | |
interlace_mode | string | Interlaced video mode for the frames in this flow | |
colorspace | string | Colorspace used for the video | |
transfer_characteristics | string | Transfer Characteristic | |
components | [object] | Array of objects describing the components | |
components.name | string | Name of this component | |
components.width | number | Width of this component in pixels | |
components.height | number | Height of this component in pixels | |
components.bit_depth | number | Number of bits used to describe each sample | |
did_sdid | object | List of Data identification and secondary data identification words | |
did_sdid.DID | string | Data Identification Word | |
did_sdid.SDID | string | Secondary data identification word |
valid()
Returns true
if current Flow is validated against the JSON Schema provided by NMOS IS-04. Not yet implemented.
Model: Sender
Instantiation
let device = new is04.Sender({
label: 'Video Sender',
flow_id: '44d55a36-b553-42cc-bff1-e451df0e40c1',
transport: 'urn:x-nmos:transport:rtp.mcast',
device_id: 'd00f73c6-7a27-4dc2-a4ad-1c375648bc77',
interface_bindings: ["en0"]
})
Returns the following object
{
id: string,
version: string,
label: string,
description: string,
caps: [object],
tags: [string],
flow_id: string,
device_id: string,
transport: string,
manifest_href: string,
interface_bindings: [string],
subscription: object
}
Create new a new Sender object.
Parameters
flow_id
, device_id
& interface_bindings
are required, all other parameters are optional. Optional properties will be generated automatically if not provided. If no ID is provided, Serial number is required to generated UUID.
Parameter | Type | Required | Description |
---|---|---|---|
id | string | Globally unique UUID identifier for the Sender | |
serial | string | Serial number of this physical device | |
version | string | String formatted PTP timestamp | |
label | string | Freeform string label for the Sender. | |
desc | string | Detailed description of the resource | |
caps | [object] | Array of Capabilities (not yet defined) | |
tags | [string] | Array of tags | |
flow_id | string | required | UUID of the Flow currently passing via this Sender |
device_id | string | required | UUID of Device which this Sender forms part of. This attribute is used to ensure referential integrity by registry implementations |
transport | string | required | Transport type used by the Sender in URN Format |
manifest_href | string | HTTP URL to a file describing how to connect to the Sender (SDP for RTP). The Sender's 'version' attribute should be updated if the contents of this file are modified. This URL may return an HTTP 404 where the 'active' parameter in the 'subscription' object is present and set to false (v1.2+ only). | |
interface_bindings | [string] | required | Binding of Sender egress ports to interfaces on the parent Node. Should contain a single network interface unless a redundancy mechanism such as ST.2022-7 is in use, in which case each 'leg' should have its matching interface listed. Where the redundancy mechanism sends more than one copy of the stream via the same interface, that interface should be listed a corresponding number of times. |
subscription | object | Object containing the 'receiver_id' currently subscribed to (unicast only). Receiver_id should be null on initialization, or when connected to a non-NMOS unicast Receiver. |
Return
The resulting Sender
instance will have the following properties:
Parameter | Type | Default | Description |
---|---|---|---|
id | string | Globally unique UUID identifier for the Sender | |
version | string | String formatted PTP timestamp | |
label | string | Freeform string label for the Sender. | |
desc | string | Detailed description of the resource | |
caps | [object] | Array of Capabilities (not yet defined) | |
tags | [string] | Array of tags | |
flow_id | string | UUID of the Flow currently passing via this Sender | |
device_id | string | UUID of Device which this Sender forms part of. This attribute is used to ensure referential integrity by registry implementations | |
transport | string | Transport type used by the Sender in URN Format | |
manifest_href | string | HTTP URL to a file describing how to connect to the Sender (SDP for RTP). The Sender's 'version' attribute should be updated if the contents of this file are modified. This URL may return an HTTP 404 where the 'active' parameter in the 'subscription' object is present and set to false (v1.2+ only). | |
interface_bindings | [string] | Binding of Sender egress ports to interfaces on the parent Node. Should contain a single network interface unless a redundancy mechanism such as ST.2022-7 is in use, in which case each 'leg' should have its matching interface listed. Where the redundancy mechanism sends more than one copy of the stream via the same interface, that interface should be listed a corresponding number of times. | |
subscription | object | { receiver_id: null, active: false } |
Object containing the 'receiver_id' currently subscribed to (unicast only). Receiver_id should be null on initialization, or when connected to a non-NMOS unicast Receiver. |
valid()
Returns true
if current Sender is validated against the JSON Schema provided by NMOS IS-04. Not yet implemented.
Model: Receiver
Instantiation
let device = new is04.Receiver({
label: 'Receiver 1',
device_id: 'd00f73c6-7a27-4dc2-a4ad-1c375648bc77',
transport: 'urn:x-nmos:transport:rtp.mcast',
interface_bindings: ["en0"],
receiver_type: "video",
caps: ["video/raw"]
})
Returns the following object
{
id: string,
version: string,
label: string,
description: string,
caps: [object],
tags: [string],
device_id: string,
transport: string,
interface_bindings: [string],
subscription: object
}
Create new a new Receiver object.
Parameters
device_id
, transport
, interface_bindings
, receiver_type
and caps
are required, all other parameters are optional. Optional properties will be generated automatically if not provided. If no ID is provided, Serial number is required to generated UUID.
Parameter | Type | Required | Description |
---|---|---|---|
id | string | Globally unique UUID identifier for the Receiver | |
serial | string | Serial number of this physical device | |
version | string | String formatted PTP timestamp | |
label | string | Freeform string label for the Receiver. | |
desc | string | Detailed description of the resource | |
caps | [object] | required | Array of Capabilities (not yet defined) |
tags | [string] | Array of tags | |
device_id | string | required | UUID of Device which this Receiver forms part of. This attribute is used to ensure referential integrity by registry implementations |
receiver_type | string | required | Type of receiver |
transport | string | required | Transport type used by the Receiver in URN Format |
interface_bindings | [string] | required | Binding of Receiver ingress ports to interfaces on the parent Node. Should contain a single network interface unless a redundancy mechanism such as ST.2022-7 is in use, in which case each 'leg' should have its matching interface listed. Where the redundancy mechanism sends more than one copy of the stream via the same interface, that interface should be listed a corresponding number of times. |
subscription | object | Object containing the 'sender_id' currently subscribed to. Sender_id should be null on initialisation, or when connected to a non-NMOS Sender. |
Return
The resulting Receiver
instance will have the following properties:
Parameter | Type | Default | Description |
---|---|---|---|
id | string | Globally unique UUID identifier for the Receiver | |
version | string | String formatted PTP timestamp | |
label | string | Freeform string label for the Receiver. | |
desc | string | Detailed description of the resource | |
caps | [object] | Array of Capabilities (not yet defined) | |
tags | [string] | Array of tags | |
flow_id | string | UUID of the Flow currently passing via this Sender | |
device_id | string | UUID of Device which this Sender forms part of. This attribute is used to ensure referential integrity by registry implementations | |
transport | string | Transport type used by the Sender in URN Format | |
manifest_href | string | HTTP URL to a file describing how to connect to the Sender (SDP for RTP). The Sender's 'version' attribute should be updated if the contents of this file are modified. This URL may return an HTTP 404 where the 'active' parameter in the 'subscription' object is present and set to false (v1.2+ only). | |
interface_bindings | [string] | Binding of Sender egress ports to interfaces on the parent Node. Should contain a single network interface unless a redundancy mechanism such as ST.2022-7 is in use, in which case each 'leg' should have its matching interface listed. Where the redundancy mechanism sends more than one copy of the stream via the same interface, that interface should be listed a corresponding number of times. | |
subscription | object | { sender_id: null, active: false } |
Object containing the 'sender_id' currently subscribed to. Sender_id should be null on initialisation, or when connected to a non-NMOS Sender. |
valid()
Returns true
if current Receiver is validated against the JSON Schema provided by NMOS IS-04. Not yet implemented.