Documentation
¶
Overview ¶
Package pes implements an MPEG-2 packetized elementary stream parser as defined in ISO/IEC 13818-1.
This package is experimental and is not intended for use in production environments.
This package is _not_ optimized for processing video in a production environment, instead is geared towards an educational look at some of the algorithms and processes used to decode compressed video.
Index ¶
Constants ¶
const StartCodePrefix = 0x000001
StartCodePrefix is the prefix that signals the start a PES packet.
Variables ¶
Functions ¶
Types ¶
type Extension ¶
type Extension struct {
PrivateDataFlag bool
PackHeaderFieldFlag bool
ProgramPacketSequenceCounterFlag bool
P_STD_BufferFlag bool
ExtensionFlag2 bool
PrivateData []byte
*P_STD_Buffer
}
Extension contains the parsed fields from an optional Header Extension.
type Header ¶
type Header struct {
ScramblingControl uint32
Priority bool
DataAlignmentIndicator bool
Copyright bool
OrignalOrCopy bool
PtsDtsFlags uint32
EscrFlag bool
EsRateFlag bool
DsmTrickModeFlag bool
AdditionalCopyInfoFlag bool
CrcFlag bool
ExtensionFlag bool
HeaderDataLength uint32
PresentationTimeStamp uint32
DecodingTimeStamp uint32
Extension *Extension
}
Header contains the optional header fields parsed from a PES packet.
type P_STD_Buffer ¶
type Packet ¶
Packet is a parsed PES packet from a bitstream. A PES packet consists, at minimum, of a start_code_prefix, stream_id, packet_length, followed by a variable number of bytes of payload. It can optionally, for certain stream types, contain a Header.
┌──────────────────────┬──────┬──────────────┬────────────────────────-
│start_code_prefix │stream│packet_length │payload -
│ (24)│id (8)│ (16)│ -
└──────────────────────┴──────┴──────────────┴────────────────────────-
Λ
╱ ╲
╱─────────────(optional)──────────────╱ ╲
╱ ╲
┌───────────────────────────────────────────┐
│PES Header │
│ (variable)│
└───────────────────────────────────────────┘
type PacketChannel ¶
type PacketChannel <-chan *Packet
PacketChannel is a delivery channel of PES Packets
func (PacketChannel) PayloadOnly ¶
func (input PacketChannel) PayloadOnly() <-chan []byte
PayloadOnly transforms a PacketChannel into a delivery channel of packet payload