codecs

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertAVCCToAnnexB

func ConvertAVCCToAnnexB(avccReader io.Reader, annexBWriter io.Writer) error

ConvertAVCCToAnnexB length -> 00 00 00 01

func ConvertAVCCToAnnexBData

func ConvertAVCCToAnnexBData(data []byte) ([]byte, error)

ConvertAVCCToAnnexBData length -> 00 00 00 01

func ConvertAnnexBToAVCC

func ConvertAnnexBToAVCC(annexbReader io.Reader, avccWriter io.Writer) error

ConvertAnnexBToAVCC 00 00 00 01 -> length

func ConvertAnnexBToAVCCData

func ConvertAnnexBToAVCCData(data []byte) ([]byte, error)

ConvertAnnexBToAVCCData 00 00 00 01 -> length

func EmitNALUData

func EmitNALUData(data []byte, withStartCode NALUFormatType, emit func(data []byte))

func EmitNALUH264Data

func EmitNALUH264Data(data []byte, withStartCode NALUFormatType, emit func(t h264.NALUType, data []byte)) error

func EmitNALUH264Reader

func EmitNALUH264Reader(r io.Reader, typ NALUFormatType, withStartCode NALUFormatType, emit func(t h264.NALUType, data []byte)) error

func EmitNALUH265Data

func EmitNALUH265Data(data []byte, withStartCode NALUFormatType, emit func(t h265.NALUType, data []byte)) error

func EmitNALUH265Reader

func EmitNALUH265Reader(r io.Reader, typ NALUFormatType, withStartCode NALUFormatType, emit func(t h265.NALUType, data []byte)) error

func EmitNALUReaderAVCC

func EmitNALUReaderAVCC(r io.Reader, withStartCode NALUFormatType, emit func(data []byte)) error

EmitNALUReaderAVCC length

func EmitNALUReaderAnnexB

func EmitNALUReaderAnnexB(r io.Reader, withStartCode NALUFormatType, emit func(data []byte))

EmitNALUReaderAnnexB 00 00 00 01

func H264NALUType

func H264NALUType(firstByte byte) h264.NALUType

func H265NALUType

func H265NALUType(firstByte byte) h265.NALUType

func IsH264KeyFrame

func IsH264KeyFrame(t h264.NALUType) bool

func IsH265KeyFrame

func IsH265KeyFrame(t h265.NALUType) bool

func IsRTPKeyFrame

func IsRTPKeyFrame(data []byte) bool

IsRTPKeyFrame data: rtp.Packet.Payload github.com\pion\webrtc\v3@v3.1.43\pkg\media\h264writer

func NALUAVCCFormatValid

func NALUAVCCFormatValid(data []byte) bool

NALUAVCCFormatValid valid AVCC format data

Types

type H264Param

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

func NewH264Param

func NewH264Param(sps []byte, pps []byte, packetMode ...int) *H264Param

func (*H264Param) GetCodecData

func (c *H264Param) GetCodecData() (h264parser.CodecData, error)

func (*H264Param) GetExtraData

func (c *H264Param) GetExtraData() ([]byte, error)

func (*H264Param) GetFmtpString

func (c *H264Param) GetFmtpString() string

func (*H264Param) GetSpsPps

func (c *H264Param) GetSpsPps() ([]byte, []byte)

func (*H264Param) Load

func (c *H264Param) Load(fmtp string)

Load a=fmtp:98 profile-level-id=42A01E;packetization-mode=1;sprop-parameter-sets=<parameter sets data>

func (*H264Param) ParseSPS

func (c *H264Param) ParseSPS() (h264parser.SPSInfo, error)

type H265Param

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

func NewH265Param

func NewH265Param(vps []byte, sps []byte, pps []byte) *H265Param

func (*H265Param) GetCodecData

func (c *H265Param) GetCodecData() (h265parser.CodecData, error)

func (*H265Param) GetExtraData

func (c *H265Param) GetExtraData() ([]byte, error)

func (*H265Param) GetFmtpString

func (c *H265Param) GetFmtpString() string

func (*H265Param) GetVpsSpsPps

func (c *H265Param) GetVpsSpsPps() ([]byte, []byte, []byte)

func (*H265Param) Load

func (c *H265Param) Load(fmtp string)

func (*H265Param) ParseSPS

func (c *H265Param) ParseSPS() (h265parser.SPSInfo, error)

type NALUFormatType

type NALUFormatType int
const (
	NALUFormatNo     NALUFormatType = 0
	NALUFormatAVCC   NALUFormatType = 1 // length
	NALUFormatAnnexB NALUFormatType = 2 // 00 00 00 01 / 00 00 01
)

func GetNALUFormatType

func GetNALUFormatType(data []byte) (int, NALUFormatType)

Jump to

Keyboard shortcuts

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