mpegts

package
v0.0.0-...-0619cdb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package mpegts contains a MPEG-TS reader and writer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Track

type Track struct {
	ES    *astits.PMTElementaryStream
	Track gortsplib.Track
}

Track is a MPEG-TS track.

func FindTracks

func FindTracks(byts []byte) ([]*Track, error)

FindTracks finds the tracks in a MPEG-TS stream.

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

Writer is a MPEG-TS writer.

func NewWriter

func NewWriter(
	videoTrack *gortsplib.TrackH264,
	audioTrack *gortsplib.TrackMPEG4Audio,
) *Writer

NewWriter allocates a Writer.

func (*Writer) GenerateSegment

func (w *Writer) GenerateSegment() []byte

GenerateSegment generates a MPEG-TS segment.

func (*Writer) WriteAAC

func (w *Writer) WriteAAC(
	pcr time.Duration,
	pts time.Duration,
	au []byte,
) error

WriteAAC writes an AAC AU.

func (*Writer) WriteH264

func (w *Writer) WriteH264(
	pcr time.Duration,
	dts time.Duration,
	pts time.Duration,
	idrPresent bool,
	nalus [][]byte,
) error

WriteH264 writes a group of H264 NALUs.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL