node Package

node Package

interface Module

class ebu_tt_live.node.interface.IConsumerNode[source]

Bases: ebu_tt_live.node.interface.INode

classmethod auto_register_impl(y)
consumer_carriage

Carriage mechanism accessor :return:

classmethod expects()[source]

Data type expected :return:

register_consumer_carriage(consumer_carriage)[source]

Input carriage mechanism registration :param consumer_carriage:

class ebu_tt_live.node.interface.INode[source]

Bases: object

This is the foundation of all nodes that take part in the processing of subtitle documents. The Node should deal with subtitles in a high level interface, which is an instance of <ebu_tt_live.documents.SubtitleDocument>. That is the interface which should be used to communicate with the carriage mechanism. See <ebu_tt_live.carriage.ICarriageMechanism>

classmethod auto_register_impl(y)
process_document(document, **kwargs)[source]

The central hook that is meant to implement the main functionality of the node. A node must implement this method.

Parameters:
  • kwargs – Extra parameters
  • document – Can be XML, Document object…etc. depending on the carriage implementation
class ebu_tt_live.node.interface.IProducerNode[source]

Bases: ebu_tt_live.node.interface.INode

classmethod auto_register_impl(y)
producer_carriage

Carriage mechanism accessor :return:

classmethod provides()[source]

Data type provided :return:

register_producer_carriage(producer_carriage)[source]

Output carriage mechanism registration :param producer_carriage:

resume_producing()[source]

This allows the node to be triggered by events, such as a timer.

base Module

class ebu_tt_live.node.base.AbstractCombinedNode(node_id, producer_carriage=None, consumer_carriage=None, **kwargs)[source]

Bases: ebu_tt_live.node.base.AbstractConsumerNode, ebu_tt_live.node.base.AbstractProducerNode

classmethod auto_register_impl(y)
class ebu_tt_live.node.base.AbstractConsumerNode(node_id, consumer_carriage=None, **kwargs)[source]

Bases: ebu_tt_live.node.interface.IConsumerNode, ebu_tt_live.node.base.__AbstractNode

classmethod auto_register_impl(y)
check_if_document_seen(document=None, sequence_identifier=None, sequence_number=None)[source]
consumer_carriage
is_document(document)[source]
limit_sequence_to_one(document)[source]
register_consumer_carriage(consumer_carriage)[source]

Input carriage mechanism registration :param consumer_carriage:

class ebu_tt_live.node.base.AbstractProducerNode(node_id, producer_carriage=None, **kwargs)[source]

Bases: ebu_tt_live.node.interface.IProducerNode, ebu_tt_live.node.base.__AbstractNode

classmethod auto_register_impl(y)
producer_carriage
register_producer_carriage(producer_carriage)[source]

Output carriage mechanism registration :param producer_carriage:

resume_producing()[source]

This allows the node to be triggered by events, such as a timer.

consumer Module

class ebu_tt_live.node.consumer.ReSequencer(node_id, reference_clock, segment_length, discard, sequence_identifier, consumer_carriage=None, producer_carriage=None, init_document=None, **kwargs)[source]

Bases: ebu_tt_live.node.base.AbstractProducerNode, ebu_tt_live.node.consumer.SimpleConsumer

classmethod auto_register_impl(y)
convert_next_segment()[source]
get_segment(begin=None, end=None)[source]
increment_last_segment_end(increment_by)[source]
last_segment_end
process_document(document, **kwargs)[source]

The central hook that is meant to implement the main functionality of the node. A node must implement this method.

Parameters:
  • kwargs – Extra parameters
  • document – Can be XML, Document object…etc. depending on the carriage implementation
segment_length
class ebu_tt_live.node.consumer.SimpleConsumer(node_id, consumer_carriage=None, reference_clock=None, verbose=False, **kwargs)[source]

Bases: ebu_tt_live.node.base.AbstractConsumerNode

classmethod auto_register_impl(y)
create_sequence_from_document(document)[source]
process_document(document, **kwargs)[source]

The central hook that is meant to implement the main functionality of the node. A node must implement this method.

Parameters:
  • kwargs – Extra parameters
  • document – Can be XML, Document object…etc. depending on the carriage implementation
reference_clock

producer Module

class ebu_tt_live.node.producer.SimpleProducer(node_id, producer_carriage, document_sequence, input_blocks)[source]

Bases: ebu_tt_live.node.base.AbstractProducerNode

classmethod auto_register_impl(y)
document_sequence
process_document(document=None, **kwargs)[source]

The central hook that is meant to implement the main functionality of the node. A node must implement this method.

Parameters:
  • kwargs – Extra parameters
  • document – Can be XML, Document object…etc. depending on the carriage implementation
reference_clock

encoder Module

class ebu_tt_live.node.encoder.EBUTTDEncoder(node_id, media_time_zero, default_ns=False, producer_carriage=None, consumer_carriage=None, **kwargs)[source]

Bases: ebu_tt_live.node.base.AbstractCombinedNode

classmethod auto_register_impl(y)
process_document(document, **kwargs)[source]

The central hook that is meant to implement the main functionality of the node. A node must implement this method.

Parameters:
  • kwargs – Extra parameters
  • document – Can be XML, Document object…etc. depending on the carriage implementation

delay Module

class ebu_tt_live.node.delay.BufferDelayNode(node_id, fixed_delay, consumer_carriage=None, producer_carriage=None)[source]

Bases: ebu_tt_live.node.base.AbstractCombinedNode

classmethod auto_register_impl(y)
process_document(document, **kwargs)[source]

The central hook that is meant to implement the main functionality of the node. A node must implement this method.

Parameters:
  • kwargs – Extra parameters
  • document – Can be XML, Document object…etc. depending on the carriage implementation
class ebu_tt_live.node.delay.RetimingDelayNode(node_id, fixed_delay, document_sequence, consumer_carriage=None, producer_carriage=None)[source]

Bases: ebu_tt_live.node.base.AbstractCombinedNode

classmethod auto_register_impl(y)
process_document(document, **kwargs)[source]

The central hook that is meant to implement the main functionality of the node. A node must implement this method.

Parameters:
  • kwargs – Extra parameters
  • document – Can be XML, Document object…etc. depending on the carriage implementation
class ebu_tt_live.node.delay.UntimedPathFinder(root_element)[source]

Bases: ebu_tt_live.bindings.pyxb_utils.RecursiveOperation

path_found
ebu_tt_live.node.delay.has_a_leaf_with_no_timing_path(element)[source]

Check if a document has at least one leaf that has no ancestor that has begin time or has begin time itself. @param element: @return:

ebu_tt_live.node.delay.is_explicitly_timed(element)[source]
ebu_tt_live.node.delay.update_body_timing(body, timebase, delay_int)[source]
ebu_tt_live.node.delay.update_children_timing(element, timebase, delay_int)[source]

distributing Module

class ebu_tt_live.node.distributing.DistributingNode(node_id, producer_carriage=None, consumer_carriage=None, **kwargs)[source]

Bases: ebu_tt_live.node.base.AbstractCombinedNode

classmethod auto_register_impl(y)
process_document(document, raw_xml=None, **kwargs)[source]

The central hook that is meant to implement the main functionality of the node. A node must implement this method.

Parameters:
  • kwargs – Extra parameters
  • document – Can be XML, Document object…etc. depending on the carriage implementation

handover Module

class ebu_tt_live.node.handover.HandoverNode(node_id, authors_group_identifier, sequence_identifier, consumer_carriage=None, producer_carriage=None, **kwargs)[source]

Bases: ebu_tt_live.node.switcher.SwitcherNode

The handover node implements the functionality described in EBU-3370. It is a specialised case of the switching node basing its decisions on the handover-related attributes on the document root element and on its previous decisions.

classmethod auto_register_impl(y)
process_document(document, **kwargs)[source]

The specified functionality is met by keeping the following priorities in mind when processing an incoming document:

  • If this is a new sequence_identifier+sequence_number pair and authorsGroupIdentifier+authorsGroupControlToken are defined and authorsGroupIdentifier matches the configuration
    • If sequenceIdentifier matches the one selected the document should be emitted
    • If sequenceIdentifier does not match the one selected or one is not selected
      • If the token is higher than our current one or one is not set the document should be emitted
      • If token is lower than the our current one or missing the document should be ignored
    • If the document should be emitted
      • Set/update current sequenceIdentifier in the node from the one in the document
      • Set/update current authorsGroupControlToken in the node
      • Reassign document to output sequenceIdentifier
      • Assign new sequenceNumber to document
      • Emit document
Parameters:
  • document
  • kwargs

deduplicator Module

class ebu_tt_live.node.deduplicator.ComparableElement(value)[source]

Takes all the attributes of an element and returns a hash value

class ebu_tt_live.node.deduplicator.DeDuplicatorNode(node_id, sequence_identifier, consumer_carriage=None, producer_carriage=None)[source]

Bases: ebu_tt_live.node.base.AbstractCombinedNode

The DeDuplicator Node addresses the issue raised, whereby after ReSequencing duplication of style and region elements and attributes occurs.

AppendNewElements(element_list, element_to_append_to, old_id_dict, new_id_dict, hash_dict)[source]

Replaces starting style and region elements with the unique ones identified in CollateUniqueVals

CollateUniqueVals(element_list, old_id_dict, new_id_dict, hash_dict)[source]

Creates a dict() of all unique style/region names

classmethod auto_register_impl(y)
process_document(document, **kwargs)[source]

The central hook that is meant to implement the main functionality of the node. A node must implement this method.

Parameters:
  • kwargs – Extra parameters
  • document – Can be XML, Document object…etc. depending on the carriage implementation
remove_duplication(document)[source]
ebu_tt_live.node.deduplicator.ReplaceNone(attr_value)[source]

If an attribute has no value, it is given non-legal character as a value, to prevent ‘collisions’

class ebu_tt_live.node.deduplicator.ReplaceStylesAndRegions(root_element, old_id_dict, new_id_dict)[source]

Bases: ebu_tt_live.bindings.pyxb_utils.RecursiveOperation

new_id_dict = None
old_id_dict = None