h264

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	NALUTypePFrame = 1 // Coded slice of a non-IDR picture
	NALUTypeIFrame = 5 // Coded slice of an IDR picture
	NALUTypeSEI    = 6 // Supplemental enhancement information (SEI)
	NALUTypeSPS    = 7 // Sequence parameter set
	NALUTypePPS    = 8 // Picture parameter set
	NALUTypeAUD    = 9 // Access unit delimiter
)
View Source
const PSMaxSize = 128 // the biggest SPS I've seen is 48 (EZVIZ CS-CV210)
View Source
const RTPPacketVersionAVC = 0

Variables

This section is empty.

Functions

func AnnexB2AVC added in v1.2.0

func AnnexB2AVC(b []byte) []byte

func EmitNalus added in v1.2.0

func EmitNalus(nals []byte, isAVC bool, emit func([]byte))

func EncodeAVC

func EncodeAVC(nals ...[]byte) (avc []byte)

func GetFmtpLine added in v1.2.0

func GetFmtpLine(avc []byte) string

GetFmtpLine from SPS+PPS+IFrame in AVC format

func GetParameterSet

func GetParameterSet(fmtp string) (sps, pps []byte)

func GetProfileLevelID

func GetProfileLevelID(fmtp string) string

GetProfileLevelID - get profile from fmtp line Some devices won't play video with high level, so limit max profile and max level. And return some profile even if fmtp line is empty.

func IsKeyframe

func IsKeyframe(b []byte) bool

IsKeyframe - check if any NALU in one AU is Keyframe

func Join

func Join(ps, iframe []byte) []byte

func NALUType

func NALUType(b []byte) byte

func RTPDepay

func RTPDepay(track *streamer.Track) streamer.WrapperFunc

func RTPPay

func RTPPay(mtu uint16) streamer.WrapperFunc

func RepairAVC

func RepairAVC(track *streamer.Track) streamer.WrapperFunc

func SplitAVC

func SplitAVC(data []byte) [][]byte

func Types

func Types(data []byte) []byte

Types

type Payloader

type Payloader struct {
	IsAVC bool
	// contains filtered or unexported fields
}

Payloader payloads H264 packets

func (*Payloader) Payload

func (p *Payloader) Payload(mtu uint16, payload []byte) [][]byte

Payload fragments a H264 packet across one or more byte arrays

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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