Documentation ¶
Overview ¶
Package mpegts contains MPEG-TS utilities.
Index ¶
- type BufferedReader
- type Codec
- type CodecAC3
- type CodecH264
- type CodecH265
- type CodecMPEG1Audio
- type CodecMPEG1Video
- type CodecMPEG4Audio
- type CodecMPEG4Video
- type CodecOpus
- type Reader
- func (r *Reader) OnDataAC3(track *Track, cb ReaderOnDataAC3Func)
- func (r *Reader) OnDataH264(track *Track, cb ReaderOnDataH26xFunc)
- func (r *Reader) OnDataH265(track *Track, cb ReaderOnDataH26xFunc)
- func (r *Reader) OnDataH26x(track *Track, cb ReaderOnDataH26xFunc)deprecated
- func (r *Reader) OnDataMPEG1Audio(track *Track, cb ReaderOnDataMPEG1AudioFunc)
- func (r *Reader) OnDataMPEG4Audio(track *Track, cb ReaderOnDataMPEG4AudioFunc)
- func (r *Reader) OnDataMPEGxVideo(track *Track, cb ReaderOnDataMPEGxVideoFunc)
- 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 ReaderOnDataAC3Func
- type ReaderOnDataH26xFunc
- type ReaderOnDataMPEG1AudioFunc
- type ReaderOnDataMPEG4AudioFunc
- type ReaderOnDataMPEGxVideoFunc
- type ReaderOnDataOpusFunc
- type ReaderOnDecodeErrorFunc
- type TimeDecoder
- type Track
- type Writer
- func (w *Writer) WriteAC3(track *Track, pts int64, frame []byte) error
- func (w *Writer) WriteH264(track *Track, pts int64, dts int64, randomAccess bool, au [][]byte) error
- func (w *Writer) WriteH265(track *Track, pts int64, dts int64, randomAccess bool, au [][]byte) error
- func (w *Writer) WriteH26x(track *Track, pts int64, dts int64, randomAccess bool, au [][]byte) errordeprecated
- func (w *Writer) WriteMPEG1Audio(track *Track, pts int64, frames [][]byte) error
- func (w *Writer) WriteMPEG1Video(track *Track, pts int64, frame []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 ¶
type BufferedReader struct {
// contains filtered or unexported fields
}
BufferedReader is a buffered reader optimized for MPEG-TS.
func NewBufferedReader ¶
func NewBufferedReader(r io.Reader) *BufferedReader
NewBufferedReader allocates a BufferedReader.
type Codec ¶
type Codec interface { IsVideo() bool // contains filtered or unexported methods }
Codec is a MPEG-TS codec.
type CodecMPEG4Audio ¶
type CodecMPEG4Audio struct {
mpeg4audio.Config
}
CodecMPEG4Audio is a MPEG-4 Audio codec.
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader is a MPEG-TS reader.
func (*Reader) OnDataAC3 ¶
func (r *Reader) OnDataAC3(track *Track, cb ReaderOnDataAC3Func)
OnDataAC3 sets a callback that is called when data from an AC-3 track is received.
func (*Reader) OnDataH264 ¶
func (r *Reader) OnDataH264(track *Track, cb ReaderOnDataH26xFunc)
OnDataH264 sets a callback that is called when data from an H264 track is received.
func (*Reader) OnDataH265 ¶
func (r *Reader) OnDataH265(track *Track, cb ReaderOnDataH26xFunc)
OnDataH265 sets a callback that is called when data from an H265 track is received.
func (*Reader) OnDataH26x
deprecated
func (r *Reader) OnDataH26x(track *Track, cb ReaderOnDataH26xFunc)
OnDataH26x sets a callback that is called when data from an H265 or H264 track is received.
Deprecated: replaced by OnDataH264, OnDataH265
func (*Reader) OnDataMPEG1Audio ¶
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 ¶
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) OnDataMPEGxVideo ¶
func (r *Reader) OnDataMPEGxVideo(track *Track, cb ReaderOnDataMPEGxVideoFunc)
OnDataMPEGxVideo sets a callback that is called when data from an MPEG-1/2/4 Video track is received.
func (*Reader) OnDataOpus ¶
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 ¶
func (r *Reader) OnDecodeError(cb ReaderOnDecodeErrorFunc)
OnDecodeError sets a callback that is called when a non-fatal decode error occurs.
type ReaderOnDataAC3Func ¶
ReaderOnDataAC3Func is the prototype of the callback passed to OnDataAC3.
type ReaderOnDataH26xFunc ¶
ReaderOnDataH26xFunc is the prototype of the callback passed to OnDataH26x.
type ReaderOnDataMPEG1AudioFunc ¶
ReaderOnDataMPEG1AudioFunc is the prototype of the callback passed to OnDataMPEG1Audio.
type ReaderOnDataMPEG4AudioFunc ¶
ReaderOnDataMPEG4AudioFunc is the prototype of the callback passed to OnDataMPEG4Audio.
type ReaderOnDataMPEGxVideoFunc ¶
ReaderOnDataMPEGxVideoFunc is the prototype of the callback passed to OnDataMPEGxVideo.
type ReaderOnDataOpusFunc ¶
ReaderOnDataOpusFunc is the prototype of the callback passed to OnDataOpus.
type ReaderOnDecodeErrorFunc ¶
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) WriteH264 ¶
func (w *Writer) WriteH264( track *Track, pts int64, dts int64, randomAccess bool, au [][]byte, ) error
WriteH264 writes a H264 access unit.
func (*Writer) WriteH265 ¶
func (w *Writer) WriteH265( track *Track, pts int64, dts int64, randomAccess bool, au [][]byte, ) error
WriteH265 writes a H265 access unit.
func (*Writer) WriteMPEG1Audio ¶
WriteMPEG1Audio writes MPEG-1 Audio packets.
func (*Writer) WriteMPEG1Video ¶
WriteMPEG1Video writes a MPEG-1/2 Video frame.
func (*Writer) WriteMPEG4Audio ¶
WriteMPEG4Audio writes MPEG-4 Audio access units.
func (*Writer) WriteMPEG4Video ¶
WriteMPEG4Video writes a MPEG-4 Video frame.
Source Files ¶
- buffered_reader.go
- codec.go
- codec_ac3.go
- codec_h264.go
- codec_h265.go
- codec_mpeg1_audio.go
- codec_mpeg1_video.go
- codec_mpeg4_audio.go
- codec_mpeg4_video.go
- codec_opus.go
- mpegts.go
- opus_access_unit.go
- opus_control_header.go
- playback_reader.go
- reader.go
- record_reader.go
- time_decoder.go
- track.go
- writer.go