h264

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 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 AVCtoAnnexB added in v1.5.0

func AVCtoAnnexB(b []byte) []byte

func AnnexB2AVC added in v1.2.0

func AnnexB2AVC(b []byte) []byte

func DecodeAnnexB added in v1.3.0

func DecodeAnnexB(b []byte) []byte

DecodeAnnexB - convert AnnexB to AVC format support unknown separator size

func DecodeStream added in v1.3.0

func DecodeStream(annexb []byte) ([]byte, int)

DecodeStream - find and return first AU in AVC format useful for processing live streams with unknown separator size

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 IndexFrom added in v1.3.0

func IndexFrom(b []byte, sep []byte, from int) int

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(codec *core.Codec, handler core.HandlerFunc) core.HandlerFunc

func RTPPay

func RTPPay(mtu uint16, handler core.HandlerFunc) core.HandlerFunc

func RepairAVC

func RepairAVC(codec *core.Codec, handler core.HandlerFunc) core.HandlerFunc

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