Documentation ¶
Overview ¶
Package mpegts contains MPEG-TS utilities.
Index ¶
- type BufferedReader
- type Codec
- type CodecH264
- type CodecH265
- type CodecMPEG1Audio
- type CodecMPEG4Audio
- type CodecMPEG4Video
- type CodecOpus
- type Reader
- func (r *Reader) OnDataH26x(track *Track, cb ReaderOnDataH26xFunc)
- func (r *Reader) OnDataMPEG1Audio(track *Track, cb ReaderOnDataMPEG1AudioFunc)
- func (r *Reader) OnDataMPEG4Audio(track *Track, cb ReaderOnDataMPEG4AudioFunc)
- func (r *Reader) OnDataMPEG4Video(track *Track, cb ReaderOnDataMPEG4VideoFunc)
- func (r *Reader) OnDataOpus(track *Track, cb ReaderOnDataOpusFunc)
- func (r *Reader) OnDecodeError(cb ReaderOnDecodeErrorFunc)
- func (r *Reader) Read() error
- func (r *Reader) Tracks() []*Track
- type ReaderOnDataH26xFunc
- type ReaderOnDataMPEG1AudioFunc
- type ReaderOnDataMPEG4AudioFunc
- type ReaderOnDataMPEG4VideoFunc
- type ReaderOnDataOpusFunc
- type ReaderOnDecodeErrorFunc
- type TimeDecoder
- type Track
- type Writer
- func (w *Writer) WriteH26x(track *Track, pts int64, dts int64, randomAccess bool, au [][]byte) error
- func (w *Writer) WriteMPEG1Audio(track *Track, pts int64, frames [][]byte) error
- func (w *Writer) WriteMPEG4Audio(track *Track, pts int64, aus [][]byte) error
- func (w *Writer) WriteMPEG4Video(track *Track, pts int64, frame []byte) error
- func (w *Writer) WriteOpus(track *Track, pts int64, packets [][]byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BufferedReader ¶ added in v1.0.0
type BufferedReader struct {
// contains filtered or unexported fields
}
BufferedReader is a buffered reader optimized for MPEG-TS.
func NewBufferedReader ¶ added in v1.0.0
func NewBufferedReader(r io.Reader) *BufferedReader
NewBufferedReader allocates a BufferedReader.
type Codec ¶ added in v0.2.0
type Codec interface { IsVideo() bool // contains filtered or unexported methods }
Codec is a MPEG-TS codec.
type CodecMPEG1Audio ¶ added in v1.0.0
type CodecMPEG1Audio struct{}
CodecMPEG1Audio is a MPEG-1 Audio codec.
func (CodecMPEG1Audio) IsVideo ¶ added in v1.0.0
func (CodecMPEG1Audio) IsVideo() bool
IsVideo implements Codec.
type CodecMPEG4Audio ¶ added in v0.2.0
type CodecMPEG4Audio struct {
mpeg4audio.Config
}
CodecMPEG4Audio is a MPEG-4 Audio codec.
func (CodecMPEG4Audio) IsVideo ¶ added in v1.0.0
func (CodecMPEG4Audio) IsVideo() bool
IsVideo implements Codec.
type CodecMPEG4Video ¶ added in v1.1.0
type CodecMPEG4Video struct{}
CodecMPEG4Video is a MPEG-4 Video codec.
func (CodecMPEG4Video) IsVideo ¶ added in v1.1.0
func (CodecMPEG4Video) IsVideo() bool
IsVideo implements Codec.
type CodecOpus ¶ added in v0.2.0
type CodecOpus struct {
ChannelCount int
}
CodecOpus is a Opus codec.
type Reader ¶ added in v0.7.0
type Reader struct {
// contains filtered or unexported fields
}
Reader is a MPEG-TS reader.
func (*Reader) OnDataH26x ¶ added in v0.7.0
func (r *Reader) OnDataH26x(track *Track, cb ReaderOnDataH26xFunc)
OnDataH26x sets a callback that is called when data from an H26x track is received.
func (*Reader) OnDataMPEG1Audio ¶ added in v1.0.0
func (r *Reader) OnDataMPEG1Audio(track *Track, cb ReaderOnDataMPEG1AudioFunc)
OnDataMPEG1Audio sets a callback that is called when data from an MPEG-1 Audio track is received.
func (*Reader) OnDataMPEG4Audio ¶ added in v0.7.0
func (r *Reader) OnDataMPEG4Audio(track *Track, cb ReaderOnDataMPEG4AudioFunc)
OnDataMPEG4Audio sets a callback that is called when data from an MPEG-4 Audio track is received.
func (*Reader) OnDataMPEG4Video ¶ added in v1.1.0
func (r *Reader) OnDataMPEG4Video(track *Track, cb ReaderOnDataMPEG4VideoFunc)
OnDataMPEG4Video sets a callback that is called when data from an MPEG-4 Video track is received.
func (*Reader) OnDataOpus ¶ added in v0.7.0
func (r *Reader) OnDataOpus(track *Track, cb ReaderOnDataOpusFunc)
OnDataOpus sets a callback that is called when data from an Opus track is received.
func (*Reader) OnDecodeError ¶ added in v1.0.0
func (r *Reader) OnDecodeError(cb ReaderOnDecodeErrorFunc)
OnDecodeError sets a callback that is called when a non-fatal decode error occurs.
type ReaderOnDataH26xFunc ¶ added in v1.0.0
ReaderOnDataH26xFunc is the prototype of the callback passed to OnDataH26x.
type ReaderOnDataMPEG1AudioFunc ¶ added in v1.0.0
ReaderOnDataMPEG1AudioFunc is the prototype of the callback passed to OnDataMPEG1Audio.
type ReaderOnDataMPEG4AudioFunc ¶ added in v1.0.0
ReaderOnDataMPEG4AudioFunc is the prototype of the callback passed to OnDataMPEG4Audio.
type ReaderOnDataMPEG4VideoFunc ¶ added in v1.1.0
ReaderOnDataMPEG4VideoFunc is the prototype of the callback passed to OnDataMPEG4Video.
type ReaderOnDataOpusFunc ¶ added in v1.0.0
ReaderOnDataOpusFunc is the prototype of the callback passed to OnDataOpus.
type ReaderOnDecodeErrorFunc ¶ added in v1.0.0
type ReaderOnDecodeErrorFunc func(err error)
ReaderOnDecodeErrorFunc is the prototype of the callback passed to OnDecodeError.
type TimeDecoder ¶
type TimeDecoder struct {
// contains filtered or unexported fields
}
TimeDecoder is a MPEG-TS timestamp decoder.
func NewTimeDecoder ¶
func NewTimeDecoder(start int64) *TimeDecoder
NewTimeDecoder allocates a TimeDecoder.
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer is a MPEG-TS writer.
func (*Writer) WriteH26x ¶ added in v0.7.0
func (w *Writer) WriteH26x( track *Track, pts int64, dts int64, randomAccess bool, au [][]byte, ) error
WriteH26x writes a H26x access unit.
func (*Writer) WriteMPEG1Audio ¶ added in v1.0.0
WriteMPEG1Audio writes MPEG-1 Audio packets.
func (*Writer) WriteMPEG4Audio ¶ added in v0.7.0
WriteMPEG4Audio writes MPEG-4 Audio access units.
func (*Writer) WriteMPEG4Video ¶ added in v1.1.0
WriteMPEG4Video writes a MPEG-4 Video frame.