cyndilib.metadata_frame

MetadataFrame

class cyndilib.metadata_frame.MetadataFrame

Bases: object

An NDI® metadata frame

Metadata frames carry miscellaneous information between sources and receivers formatted as a single XML tag.

The data can be application-specific although there are some reserved namespaces and tag names for standardized use:

<ndi_tally_echo on_program="true" on_preview="false"/>

<ndi_product long_name="NDILib Receive Example"
             short_name="NDILib Receive"
             manufacturer="CoolCo, inc."
             version="1.000.000"
             model_name="PBX-42Q"
             session_name="My Midday Show"
             serial="ABCDEFG"/>

This class provides an interface to the parsed xml data with the attributes available in the attrs attribute or through dict-like methods:

>>> metadata_frame['on_program']
'true'
>>> metadata_frame.get('on_preview')
'false'
tag

The xml tag name

Type:

str

attrs

The xml attributes

Type:

dict

get(self, key: str)

Get the value of the attribute with the given name

get_tag(self)

Get the xml tag name for this metadata frame

get_timecode(self)

Get the current timecode as an integer

get_timecode_posix(self)

Get the current timecode converted to float seconds (posix)

Added in version 0.1.2.

items(self)

Get the attribute name-value pairs for this metadata frame

Added in version 0.1.2.

keys(self)

Get the attribute names for this metadata frame

Added in version 0.1.2.

set_tag(self, tag: str)

Set the xml tag name for this metadata frame

values(self)

Get the attribute values for this metadata frame

Added in version 0.1.2.

MetadataRecvFrame

class cyndilib.metadata_frame.MetadataRecvFrame

Bases: MetadataFrame

A MetadataFrame used in receiver.Receiver

MetadataSendFrame

class cyndilib.metadata_frame.MetadataSendFrame

Bases: MetadataFrame

A MetadataFrame used in sender.Sender

Parameters:
  • tag (str) – The xml tag name for this metadata frame

  • initdict (dict, optional) – Initial attributes for this metadata frame

  • **kwargs – Additional attributes for this metadata frame

The attributes in this class can be set using dict-like methods:

>>> metadata_frame['program_tally'] = "false"
>>> metadata_frame.update({'preview_tally':'true'})
clear(self)

Clear the tag and attributes in this metadata frame

set_tag(self, tag: str)

Set the xml tag name for this metadata frame

update(self, other: dict)

Update the attributes in this metadata frame with the items in other