hevc

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2021 License: MIT Imports: 4 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NALUStartCode4 = []byte{0x0, 0x0, 0x0, 0x1}

	// aud nalu
	AUDNALU = []byte{0x00, 0x00, 0x00, 0x01, 0x46, 0x01, 0x10}
)
View Source
var (
	NALUTypeSliceTrailN uint8 = 0  // 0x0
	NALUTypeSliceTrailR uint8 = 1  // 0x01
	NALUTypeSliceIDR    uint8 = 19 // 0x13
	NALUTypeSliceIDRNLP uint8 = 20 // 0x14
	NALUTypeSliceCRANUT uint8 = 21 // 0x15
	NALUTypeVPS         uint8 = 32 // 0x20
	NALUTypeSPS         uint8 = 33 // 0x21
	NALUTypePPS         uint8 = 34 // 0x22
	NALUTypeAUD         uint8 = 35 // 0x23
	NALUTypeSEI         uint8 = 39 // 0x27
	NALUTypeSEISuffix   uint8 = 40 // 0x28
)

ISO_IEC_23008-2_2013.pdf Table 7-1 – NAL unit type codes and NAL unit type classes

View Source
var ErrHEVC = errors.New("lal.hevc: fxxk")
View Source
var NALUTypeMapping = map[uint8]string{
	NALUTypeSliceTrailN: "TrailN",
	NALUTypeSliceTrailR: "TrailR",
	NALUTypeSliceIDR:    "IDR",
	NALUTypeSliceIDRNLP: "IDRNLP",
	NALUTypeSliceCRANUT: "CRANUT",
	NALUTypeVPS:         "VPS",
	NALUTypeSPS:         "SPS",
	NALUTypePPS:         "PPS",
	NALUTypeAUD:         "AUD",
	NALUTypeSEI:         "SEI",
	NALUTypeSEISuffix:   "SEISuffix",
}

Functions

func BuildSeqHeaderFromVPSSPSPPS added in v0.15.0

func BuildSeqHeaderFromVPSSPSPPS(vps, sps, pps []byte) ([]byte, error)

返回的内存块为新申请的独立内存块

func ParseNALUType added in v0.13.0

func ParseNALUType(v uint8) uint8

@param v 第一个字节

func ParseNALUTypeReadable added in v0.13.0

func ParseNALUTypeReadable(v uint8) string

func ParseSPS added in v0.15.0

func ParseSPS(sps []byte, ctx *Context) error

func ParseVPS added in v0.15.0

func ParseVPS(vps []byte, ctx *Context) error

func ParseVPSSPSPPSFromSeqHeader added in v0.15.0

func ParseVPSSPSPPSFromSeqHeader(payload []byte) (vps, sps, pps []byte, err error)

从HVCC格式的Seq Header中得到VPS,SPS,PPS内存块

@param <payload> rtmp message的payload部分或者flv tag的payload部分

注意,包含了头部2字节类型以及3字节的cts

@return 注意,返回的vps,sps,pps内存块指向的是传入参数<payload>内存块的内存

func VPSSPSPPSSeqHeader2AnnexB added in v0.15.0

func VPSSPSPPSSeqHeader2AnnexB(payload []byte) ([]byte, error)

HVCC Seq Header -> AnnexB 注意,返回的内存块为独立的内存块,不依赖指向传输参数<payload>内存块

Types

type Context added in v0.15.0

type Context struct {
	PicWidthInLumaSamples  uint32 // sps
	PicHeightInLumaSamples uint32 // sps
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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