MPEG TS Documentation

MPEGTS Objects

class AcraNetwork.MPEGTS.MPEGTS

This class handles MPEG Transport Streams. https://en.wikipedia.org/wiki/MPEG_transport_stream

Each transport stream contains 188 byte packets. These packets contain either video, audio or metadata information

unpack(buf: bytes)

This method will convert a buffer of bytes into an array of MPEG TS packets

Parameters:

buf (str) – The buffer to unpack

Return type:

bool

blocks: List[MPEGPacket]

List of MPEGPacket objects

MPEGPacket Objects

class AcraNetwork.MPEGTS.MPEGPacket

The MPEGPacket is the elementary unit in an MPEG Transport Stream It contains an header, in which there’s a sync word, continuity counter, and a _payload

unpack(buf: bytes)

Converts a buffer into an MPEGTS packet

Parameters:

buf (str) – The buffer to unpack into an MPEG Packet

Return type:

bool

H264 Objects

class AcraNetwork.MPEG.H264.H264

This class will handle H.264 _payload. It can convert a buffer of bytes into an array of NALs(https://en.wikipedia.org/wiki/Network_Abstraction_Layer) The NALs contain different data, based on their types.

unpack(buf: bytes) bool

Split the buffer into multiple NALs and store as a H264 object

Parameters:

buf (str) – The buffer to unpack into a H264 object

Return type:

bool

NAL Objects

class AcraNetwork.MPEG.H264.NAL

The NAL can be split into the various types of NALs.

unpack(buf: bytes)

Split the buffer into a NAL object

Parameters:

buf (str|bytes) – The buffer to unpack into an NAL

Return type:

bool

ADTS Objects

class AcraNetwork.MPEG.ADTS.ADTS

PES Objects

class AcraNetwork.MPEG.PES.PES
unpack(buffer: bytes)

Converts a buffer into an MPEGTS packet

Parameters:

buf (str) – The buffer to unpack into an MPEG Packet

Return type:

bool

STANAG4609 Objects

class AcraNetwork.MPEG.PES.STANAG4609
pack() bytes

Pack the STANAG4609 object into bytes

Returns:

bytes: _description_

unpack(buffer: bytes)

Convert the buffer into a STANAG4609 object

STANAG4609_SEI Objects

class AcraNetwork.MPEG.STANAG4609.STANAG4609_SEI

Handle the SEI NAL and more specifically this will handle SEIs defined in 3.14.3.5 of the STANAG standard http://www.gwg.nga.mil/misb/docs/nato_docs/STANAG_4609_Ed3.pdf

unpack(buf)

Unpack the NAL _payload as an STANAG4609_SEI

Parameters:

buf (str) – The buffer to unpack into an STANAG4609_SEI

Return type:

bool