h264

package
v1.1.2 Latest Latest
Warning

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

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

README

H264

Access Unit (AU) can contain one or multiple NAL Unit:

  1. [SEI,] SPS, PPS, IFrame, [IFrame...]
  2. BFrame, [BFrame...]
  3. IFrame, [IFrame...]

RTP H264

Camera NALu
EZVIZ C3S 7f, 8f, 28:28:28 -> 5t, 28:28:28 -> 1t, 1t, 1t, 1t
Sonoff GK-200MP2-B 28:28:28 -> 5t, 1t, 1t, 1t
Dahua IPC-K42 7f, 8f, 28:28:28 -> 5t, 28:28:28 -> 1t, 28:28:28 -> 1t
FFmpeg copy 5t, 1t, 1t, 28:28:28 -> 1t, 28:28:28 -> 1t
FFmpeg h264 24 -> 6:5:5:5:5t, 24 -> 1:1:1:1t, 28:28:28 -> 5f, 28:28:28 -> 5f, 28:28:28 -> 5t
FFmpeg resize 6f, 28:28:28 -> 5f, 28... -> 5t, 24 -> 1:1f, 24 -> 1:1t

WebRTC

Video codec Media string Device
H.264/baseline! avc1.42E0xx Chromecast
H.264/baseline! avc1.42E0xx Chrome/Safari WebRTC
H.264/baseline! avc1.42C0xx FFmpeg ultrafast
H.264/baseline! avc1.4240xx Dahua H264B
H.264/baseline avc1.4200xx Chrome WebRTC
H.264/main! avc1.4D40xx Chromecast
H.264/main! avc1.4D40xx FFmpeg superfast main
H.264/main! avc1.4D40xx Dahua H264
H.264/main avc1.4D00xx Chrome WebRTC
H.264/high! avc1.640Cxx Safari WebRTC
H.264/high avc1.6400xx Chromecast
H.264/high avc1.6400xx FFmpeg superfast

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 EncodeAVC

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

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