Versions in this module Expand all Collapse all v1 v1.0.7 Feb 13, 2025 v1.0.6 Feb 12, 2025 v1.0.5 Jan 27, 2025 v1.0.4 Jan 27, 2025 v1.0.3 Jan 27, 2025 v1.0.2 Jan 10, 2025 v1.0.1 Jan 10, 2025 v1.0.0 Sep 11, 2024 Changes in this version + const AVC_EOS + const AVC_NALU + const AVC_SEQHDR + const CH_2POINT1 + const CH_2_1 + const CH_3POINT1 + const CH_BACK_CENTER + const CH_BACK_LEFT + const CH_BACK_RIGHT + const CH_FRONT_CENTER + const CH_FRONT_LEFT + const CH_FRONT_RIGHT + const CH_LOW_FREQ + const CH_MONO + const CH_NR + const CH_SIDE_LEFT + const CH_SIDE_RIGHT + const CH_STEREO + const CH_SURROUND + const DBL + const DBLP + const FLT + const FLTP + const FLV_TAG_AUDIO + const FLV_TAG_SCRIPTDATA + const FLV_TAG_VIDEO + const FRAME_INTER + const FRAME_KEY + const S16 + const S16P + const S32 + const S32P + const U32 + const U8 + const U8P + const VIDEO_H264 + var AAC = MakeAudioCodecType(avCodecTypeMagic + 1) + var AV1 = MakeVideoCodecType(avCodecTypeMagic + 6) + var H264 = MakeVideoCodecType(avCodecTypeMagic + 1) + var H265 = MakeVideoCodecType(avCodecTypeMagic + 2) + var HeaderTypeAAC = makeAudioHeaderType(headerTypeBase + 1) + var HeaderTypeH264 = makeVideoHeaderType(headerTypeBase + 1) + var JPEG = MakeVideoCodecType(avCodecTypeMagic + 3) + var MJPEG = MakeVideoCodecType(avCodecTypeMagic + 7) + var NELLYMOSER = MakeAudioCodecType(avCodecTypeMagic + 5) + var OPUS = MakeAudioCodecType(avCodecTypeMagic + 7) + var PCM = MakeAudioCodecType(avCodecTypeMagic + 6) + var PCM_ALAW = MakeAudioCodecType(avCodecTypeMagic + 3) + var PCM_MULAW = MakeAudioCodecType(avCodecTypeMagic + 2) + var SPEEX = MakeAudioCodecType(avCodecTypeMagic + 4) + var VP8 = MakeVideoCodecType(avCodecTypeMagic + 4) + var VP9 = MakeVideoCodecType(avCodecTypeMagic + 5) + type AudioCodecData interface + ChannelLayout func() ChannelLayout + PacketDuration func([]byte) (time.Duration, error) + SampleFormat func() SampleFormat + SampleRate func() int + type AudioDecoder interface + Close func() + Decode func([]byte) (bool, AudioFrame, error) + type AudioEncoder interface + Close func() + CodecData func() (AudioCodecData, error) + Encode func(AudioFrame) ([][]byte, error) + GetOption func(string, interface{}) error + SetBitrate func(int) error + SetChannelLayout func(ChannelLayout) error + SetOption func(string, interface{}) error + SetSampleFormat func(SampleFormat) error + SetSampleRate func(int) error + type AudioFrame struct + ChannelLayout ChannelLayout + Data [][]byte + SampleCount int + SampleFormat SampleFormat + SampleRate int + func (self AudioFrame) Concat(in AudioFrame) (out AudioFrame) + func (self AudioFrame) Duration() time.Duration + func (self AudioFrame) HasSameFormat(other AudioFrame) bool + func (self AudioFrame) Slice(start int, end int) (out AudioFrame) + type AudioResampler interface + Resample func(AudioFrame) (AudioFrame, error) + type ChannelLayout uint16 + func (self ChannelLayout) Count() (n int) + func (self ChannelLayout) String() string + type CodecData interface + Type func() CodecType + type CodecType uint32 + func MakeAudioCodecType(base uint32) (c CodecType) + func MakeVideoCodecType(base uint32) (c CodecType) + func (self CodecType) IsAudio() bool + func (self CodecType) IsVideo() bool + func (self CodecType) String() string + type DemuxCloser interface + Close func() error + type Demuxer interface + Streams func() ([]CodecData, error) + type Header struct + Data interface{} + Type HeaderType + type HeaderType uint32 + func (ht HeaderType) IsAudio() bool + func (ht HeaderType) IsVideo() bool + type MuxCloser interface + Close func() error + type Muxer interface + WriteHeader func([]CodecData) error + WriteTrailer func() error + type Option func(*Options) + func WithAfterReadHeaders(f func([]CodecData) error) Option + func WithAfterReadPacket(f func(*Packet) error) Option + func WithAfterWriteHeaders(f func([]CodecData) error) Option + func WithAfterWritePacket(f func(*Packet) error) Option + func WithConnectedTimestamp(t time.Time) Option + func WithHandlerName(name string) Option + func WithSID(id string) Option + type Options struct + AfterReadHeaders func([]CodecData) error + AfterReadPacket func(*Packet) error + AfterWriteHeaders func([]CodecData) error + AfterWritePacket func(*Packet) error + ConnectedTimestamp time.Time + HandlerName string + SID string + type Packet struct + AVCPacketType uint8 + AbsoluteTime time.Duration + CompositionTime time.Duration + Data []byte + DataType int8 + Drop bool + Duration time.Duration + First bool + HeaderBeginAt int + HeaderChanged bool + Idx int8 + IsKeyFrame bool + SliceFrameCnt uint16 + SliceId uint32 + SliceTimeStamp uint64 + Time time.Duration + func (pkt *Packet) EarlierThen(confirmedPktTime time.Duration) bool + func (pkt *Packet) IsScriptData() bool + func (pkt *Packet) IsSequenceHeader() bool + func (pkt *Packet) IsVideo() bool + func (pkt *Packet) IsVideoNalu() bool + func (pkt *Packet) String() string + type PacketReader interface + ReadPacket func() (Packet, error) + type PacketWriter interface + WritePacket func(Packet) error + type SampleFormat uint8 + func (self SampleFormat) BytesPerSample() int + func (self SampleFormat) IsPlanar() bool + func (self SampleFormat) String() string + type Transport struct + func NewTransport(opt ...Option) *Transport + func (t *Transport) CopyAV(ctx context.Context, dst Muxer, src Demuxer) error + func (t *Transport) CopyHeaders(ctx context.Context, dst Muxer, src Demuxer) (err error) + func (t *Transport) CopyPackets(ctx context.Context, dst Muxer, src Demuxer) (err error) + type VideoCodecData interface + Height func() int + Width func() int