Documentation
¶
Index ¶
- Constants
- Variables
- func AddPTS(p1, p2 int64) int64
- func CalculateSteps(timestamps []int64) []int64
- func Execute(w io.Writer, o Options, inFile string, function RunableFunc) error
- func ExtractES(ctx context.Context, textWriter io.Writer, esWriter io.Writer, f io.Reader, ...) error
- func FilterPids(ctx context.Context, textWriter io.Writer, tsWriter io.Writer, f io.Reader, ...) error
- func GetDifferenceOfTwoSlices(s1 []int, s2 []int) []int
- func GetIntersectionOfTwoSlices(s1 []int, s2 []int) []int
- func GetVersion() string
- func IsTwoSlicesOverlapping(s1 []int, s2 []int) bool
- func OpenFileAndAppend(file string) (*os.File, error)
- func ParseAll(ctx context.Context, w io.Writer, f io.Reader, o Options) error
- func ParseInfo(ctx context.Context, w io.Writer, f io.Reader, o Options) error
- func ParsePacketToPAT(pkt *packet.Packet) (pat psi.PAT, e error)
- func ParsePidsFromString(input string) []int
- func ParseSCTE35(ctx context.Context, w io.Writer, f io.Reader, o Options) error
- func ParseSMPTE2038(jp *JsonPrinter, d *astits.DemuxerData, o Options)
- func ReadPMTPackets(r io.Reader, pid int) ([]packet.Packet, psi.PMT, error)
- func RemoveFileIfExists(file string) error
- func SignedPTSDiff(p2, p1 int64) int64
- func ToSdtInfo(sdt *astits.SDTData) sdtInfo
- func UnsignedPTSDiff(p2, p1 int64) int64
- func WritePacket(pkt *packet.Packet, w io.Writer) error
- type AvcPS
- type ElementaryStreamInfo
- type HevcPS
- type JsonPrinter
- func (p *JsonPrinter) Error() error
- func (p *JsonPrinter) Print(data any, show bool)
- func (p *JsonPrinter) PrintFilter(s PidFilterStatistics, show bool)
- func (jp *JsonPrinter) PrintPS(pid uint16, psKind string, nr uint32, ps []byte, details any, verbose bool, ...)
- func (p *JsonPrinter) PrintSdtInfo(sdt *astits.SDTData, show bool)
- func (p *JsonPrinter) PrintStatistics(s StreamStatistics, show bool)
- type NaluData
- type NaluFrameData
- type OptionParseFunc
- type Options
- type PidFilterStatistics
- type PsInfo
- type RunableFunc
- type SCTE35Info
- type SMPTE291Identifier
- type SegmentationDescriptor
- type SeiOut
- type SpliceCommand
- type StreamStatistics
Constants ¶
View Source
const ( PacketSize = 188 PtsWrap = 1 << 33 PcrWrap = PtsWrap * 300 TimeScale = 90000 )
View Source
const ( ANC_REGISTERED_IDENTIFIER = 0x56414E43 ANC_DESCRIPTOR_TAG = 0xC4 )
Variables ¶
View Source
var SMPTE291Map = map[SMPTE291Identifier]string{
{0x41, 0x05}: "AFD and Bar Data",
{0x41, 0x06}: "Pan and Scan Information",
{0x41, 0x07}: "ANSI/SCTE 104 messages",
{0x41, 0x08}: "DVB/SCTE VBI data",
{0x43, 0x01}: "Inter Station Control Packet Data",
{0x43, 0x02}: "OP-47 SDP - Subtitling Data",
{0x43, 0x03}: "OP-47 Multi Packet ANC Data",
{0x45, 0x01}: "Audio Metadata (Single Program)",
{0x45, 0x02}: "Audio Metadata Ch 01/02",
{0x45, 0x03}: "Audio Metadata Ch 03/04",
{0x45, 0x04}: "Audio Metadata Ch 05/06",
{0x45, 0x05}: "Audio Metadata Ch 07/08",
{0x45, 0x06}: "Audio Metadata Ch 09/10",
{0x45, 0x07}: "Audio Metadata Ch 11/12",
{0x45, 0x08}: "Audio Metadata Ch 13/14",
{0x45, 0x09}: "Audio Metadata Ch 15/16",
{0x50, 0x01}: "WSS - Wide Screen Signaling",
{0x50, 0x30}: "User Defined",
{0x50, 0x49}: "User Defined",
{0x60, 0x60}: "ATC - Ancillary Timecode",
{0x61, 0x01}: "EIA 708B Data mapping into VANC space",
{0x61, 0x02}: "EIA 608 Data mapping into VANC space",
{0x62, 0x01}: "DTV Program Description",
{0x62, 0x02}: "DTV Data Broadcast",
{0x62, 0x03}: "VBI Data",
}
Functions ¶
func CalculateSteps ¶ added in v0.1.1
func ExtractES ¶ added in v0.3.0
func ExtractES(ctx context.Context, textWriter io.Writer, esWriter io.Writer, f io.Reader, o Options) error
ExtractES extracts elementary stream from a TS file
func FilterPids ¶ added in v0.3.0
func GetDifferenceOfTwoSlices ¶ added in v0.3.0
Return a set that contains those elements of s1 that are NOT in s2
func GetIntersectionOfTwoSlices ¶ added in v0.3.0
Return a set that contains those elements of s1 that are also in s2
func GetVersion ¶
func GetVersion() string
GetVersion - get version and also commitHash and commitDate if inserted via Makefile
func IsTwoSlicesOverlapping ¶ added in v0.3.0
Check if two sets contain same elements
func ParsePacketToPAT ¶ added in v0.3.0
func ParsePidsFromString ¶ added in v0.3.0
func ParseSCTE35 ¶ added in v0.3.0
func ParseSMPTE2038 ¶ added in v0.3.0
func ParseSMPTE2038(jp *JsonPrinter, d *astits.DemuxerData, o Options)
func ReadPMTPackets ¶ added in v0.3.0
func RemoveFileIfExists ¶ added in v0.3.0
func SignedPTSDiff ¶ added in v0.1.1
func UnsignedPTSDiff ¶ added in v0.1.1
Types ¶
type AvcPS ¶ added in v0.2.0
type AvcPS struct {
Statistics StreamStatistics
// contains filtered or unexported fields
}
func ParseAVCPES ¶ added in v0.2.0
func ParseAVCPES(jp *JsonPrinter, d *astits.DemuxerData, ps *AvcPS, o Options) (*AvcPS, error)
type ElementaryStreamInfo ¶ added in v0.1.1
type ElementaryStreamInfo struct {
PID uint16 `json:"pid"`
Codec string `json:"codec"`
Type string `json:"type"`
}
func ParseAstitsElementaryStreamInfo ¶ added in v0.3.0
func ParseAstitsElementaryStreamInfo(es *astits.PMTElementaryStream) *ElementaryStreamInfo
func ParseElementaryStreamInfo ¶ added in v0.3.0
func ParseElementaryStreamInfo(es psi.PmtElementaryStream) *ElementaryStreamInfo
type HevcPS ¶ added in v0.2.0
type HevcPS struct {
Statistics StreamStatistics
// contains filtered or unexported fields
}
func ParseHEVCPES ¶ added in v0.2.0
func ParseHEVCPES(jp *JsonPrinter, d *astits.DemuxerData, ps *HevcPS, o Options) (*HevcPS, error)
type JsonPrinter ¶ added in v0.1.1
func (*JsonPrinter) Error ¶ added in v0.1.1
func (p *JsonPrinter) Error() error
func (*JsonPrinter) Print ¶ added in v0.1.1
func (p *JsonPrinter) Print(data any, show bool)
func (*JsonPrinter) PrintFilter ¶ added in v0.3.0
func (p *JsonPrinter) PrintFilter(s PidFilterStatistics, show bool)
func (*JsonPrinter) PrintSdtInfo ¶ added in v0.1.1
func (p *JsonPrinter) PrintSdtInfo(sdt *astits.SDTData, show bool)
func (*JsonPrinter) PrintStatistics ¶ added in v0.1.1
func (p *JsonPrinter) PrintStatistics(s StreamStatistics, show bool)
type NaluFrameData ¶ added in v0.1.1
type OptionParseFunc ¶ added in v0.1.1
type OptionParseFunc func() Options
type Options ¶ added in v0.1.1
type Options struct {
MaxNrPictures int
Version bool
Indent bool
ShowStreamInfo bool
ShowService bool
ShowPS bool
VerbosePSInfo bool
ShowNALU bool
ShowSEIDetails bool
ShowSMPTE2038 bool
ShowSCTE35 bool
ShowStatistics bool
FilterPids bool
PidsToDrop string
OutPutTo string
WaitForPS bool // Wait for parameter sets (SPS/PPS) before printing NAL units
ExtractPID int // PID to extract for elementary stream extraction (0 = first video PID)
}
func CreateFullOptions ¶ added in v0.1.1
func ParseParams ¶ added in v0.1.1
func ParseParams(function OptionParseFunc) (o Options, inFile string)
type PidFilterStatistics ¶ added in v0.3.0
type RunableFunc ¶ added in v0.1.1
type SCTE35Info ¶ added in v0.3.0
type SCTE35Info struct {
PID uint16 `json:"pid"`
SpliceCommand SpliceCommand `json:"spliceCommand"`
SegDesc []SegmentationDescriptor `json:"segmentationDes,omitempty"`
}
type SMPTE291Identifier ¶ added in v0.3.0
type SMPTE291Identifier struct {
// contains filtered or unexported fields
}
didMap maps SMPTE-20348 [did] values registered by SMPTE [dids]: https://smpte-ra.org/smpte-ancillary-data-smpte-st-291
type SegmentationDescriptor ¶ added in v0.3.0
type SpliceCommand ¶ added in v0.3.0
type StreamStatistics ¶ added in v0.1.1
type StreamStatistics struct {
Type string `json:"streamType"`
Pid uint16 `json:"pid"`
FrameRate float64 `json:"frameRate"`
TimeStamps []int64 `json:"-"`
MaxStep int64 `json:"maxStep,omitempty"`
MinStep int64 `json:"minStep,omitempty"`
AvgStep int64 `json:"avgStep,omitempty"`
// RAI-markers
RAIPTS []int64 `json:"-"`
IDRPTS []int64 `json:"-"`
RAIGOPDuration int64 `json:"RAIGoPDuration,omitempty"`
IDRGOPDuration int64 `json:"IDRGoPDuration,omitempty"`
// Errors
Errors []string `json:"errors,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.