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) OnDataH26x(track *Track, cb ReaderOnDataH26xFunc)
- 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) 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) 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 ¶ 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 CodecMPEG1Video ¶ added in v1.2.0
type CodecMPEG1Video struct{}
CodecMPEG1Video is a MPEG-1/2 Video codec.
func (CodecMPEG1Video) IsVideo ¶ added in v1.2.0
func (CodecMPEG1Video) 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) OnDataAC3 ¶ added in v1.4.0
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) 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) OnDataMPEGxVideo ¶ added in v1.2.0
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 ¶ 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 ReaderOnDataAC3Func ¶ added in v1.4.0
ReaderOnDataAC3Func is the prototype of the callback passed to OnDataAC3.
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 ReaderOnDataMPEGxVideoFunc ¶ added in v1.2.0
ReaderOnDataMPEGxVideoFunc is the prototype of the callback passed to OnDataMPEGxVideo.
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) WriteMPEG1Video ¶ added in v1.3.0
WriteMPEG1Video writes a MPEG-1/2 Video frame.
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.
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