Documentation ¶
Overview ¶
Package h264 - AVCC format related functions
Package h264 - MPEG4 format related functions
Index ¶
- Constants
- func AVCCToCodec(avcc []byte) *core.Codec
- func ConfigToCodec(conf []byte) *core.Codec
- func DecodeAnnexB(b []byte) []byte
- func DecodeConfig(conf []byte) (profile []byte, sps []byte, pps []byte)
- func DecodeStream(annexb []byte) ([]byte, int)deprecated
- func EmitNalus(nals []byte, isAVC bool, emit func([]byte))
- func EncodeConfig(sps, pps []byte) []byte
- func FixPixFmt(sps []byte)
- func GetFmtpLine(avc []byte) string
- func GetParameterSet(fmtp string) (sps, pps []byte)
- func GetProfileLevelID(fmtp string) string
- func IndexFrom(b []byte, sep []byte, from int) int
- func IsKeyframe(b []byte) bool
- func Join(ps, iframe []byte) []byte
- func JoinNALU(nalus ...[]byte) (avcc []byte)
- func NALUType(b []byte) byte
- func NALUTypes(avcc []byte) []byte
- func RTPDepay(codec *core.Codec, handler core.HandlerFunc) core.HandlerFunc
- func RTPPay(mtu uint16, handler core.HandlerFunc) core.HandlerFunc
- func RepairAVCC(codec *core.Codec, handler core.HandlerFunc) core.HandlerFunc
- func SplitNALU(avcc []byte) [][]byte
- type Payloader
- type SPS
Constants ¶
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 )
const ( ProfileBaseline = 0x42 ProfileMain = 0x4D ProfileHigh = 0x64 CapabilityBaseline = 0xE0 CapabilityMain = 0x40 )
https://developers.google.com/cast/docs/media
const PSMaxSize = 128 // the biggest SPS I've seen is 48 (EZVIZ CS-CV210)
const RTPPacketVersionAVC = 0
Variables ¶
This section is empty.
Functions ¶
func AVCCToCodec ¶
func ConfigToCodec ¶
func DecodeAnnexB ¶
DecodeAnnexB - convert AnnexB to AVC format support unknown separator size
func DecodeConfig ¶
DecodeConfig - extract profile, SPS and PPS from MPEG4 config
func DecodeStream
deprecated
func EncodeConfig ¶
func FixPixFmt ¶
func FixPixFmt(sps []byte)
FixPixFmt - change yuvj420p to yuv420p in SPS same as "-c:v copy -bsf:v h264_metadata=video_full_range_flag=0"
func GetFmtpLine ¶
GetFmtpLine from SPS+PPS+IFrame in AVC format
func GetParameterSet ¶
func GetProfileLevelID ¶
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 ¶
IsKeyframe - check if any NALU in one AU is Keyframe
func RTPDepay ¶
func RTPDepay(codec *core.Codec, handler core.HandlerFunc) core.HandlerFunc
func RTPPay ¶
func RTPPay(mtu uint16, handler core.HandlerFunc) core.HandlerFunc
func RepairAVCC ¶
func RepairAVCC(codec *core.Codec, handler core.HandlerFunc) core.HandlerFunc
Types ¶
type Payloader ¶
type Payloader struct { IsAVC bool // contains filtered or unexported fields }
Payloader payloads H264 packets