Documentation
¶
Index ¶
- func IsAV1KeyFrame(payload []byte) bool
- func IsH264KeyFrame(payload []byte) bool
- func IsH265KeyFrame(payload []byte) (kf bool)
- func IsKeyFrame(codec string, payload []byte) bool
- func IsVP8KeyFrame(payload []byte) bool
- func IsVP9KeyFrame(vp9 *codecs.VP9Packet, payload []byte) bool
- func VPxPictureIdSizeDiff(mBit1 bool, mBit2 bool) int
- type BitReader
- type SPSInfo
- type VP8
- type VideoSize
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsAV1KeyFrame ¶
IsAV1KeyFrame detects if av1 payload is a keyframe taken from https://github.com/jech/galene/blob/master/codecs/codecs.go all credits belongs to Juliusz Chroboczek @jech and the awesome Galene SFU
func IsH264KeyFrame ¶
IsH264KeyFrame detects if h264 payload is a keyframe this code was taken from https://github.com/jech/galene/blob/codecs/rtpconn/rtpreader.go#L45 all credits belongs to Juliusz Chroboczek @jech and the awesome Galene SFU
func IsH265KeyFrame ¶
func IsKeyFrame ¶
func IsVP8KeyFrame ¶
func IsVP9KeyFrame ¶
IsVP9KeyFrame detects if vp9 payload is a keyframe taken from https://github.com/jech/galene/blob/master/codecs/codecs.go all credits belongs to Juliusz Chroboczek @jech and the awesome Galene SFU
func VPxPictureIdSizeDiff ¶
Types ¶
type BitReader ¶
type BitReader struct {
// contains filtered or unexported fields
}
-------- BitReader --------
func NewBitReader ¶
type SPSInfo ¶
type SPSInfo struct {
ChromaFormatIDC uint
PicWidthInLumaSamples uint
PicHeightInLumaSamples uint
ConformanceWindowFlag bool
ConfWinLeftOffset uint
ConfWinRightOffset uint
ConfWinTopOffset uint
ConfWinBottomOffset uint
CodedWidth, CodedHeight uint // Raw coded resolution
DisplayWidth, DisplayHeight uint // Resolution after conformance window cropping
}
SPSInfo holds parsed SPS parameters
type VP8 ¶
type VP8 struct {
FirstByte byte
S bool
I bool
M bool
PictureID uint16 /* 7 or 15 bits, picture ID */
L bool
TL0PICIDX uint8 /* 8 bits temporal level zero index */
// Optional Header If either of the T or K bits are set to 1,
// the TID/Y/KEYIDX extension field MUST be present.
T bool
TID uint8 /* 2 bits temporal layer idx */
Y bool
K bool
KEYIDX uint8 /* 5 bits of key frame idx */
HeaderSize int
// IsKeyFrame is a helper to detect if current packet is a keyframe
IsKeyFrame bool
}
VP8 is a helper to get temporal data from VP8 packet header
VP8 Payload Descriptor 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ |X|R|N|S|R| PID | (REQUIRED) |X|R|N|S|R| PID | (REQUIRED) +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ X: |I|L|T|K| RSV | (OPTIONAL) X: |I|L|T|K| RSV | (OPTIONAL) +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ I: |M| PictureID | (OPTIONAL) I: |M| PictureID | (OPTIONAL) +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ L: | TL0PICIDX | (OPTIONAL) | PictureID | +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ T/K:|TID|Y| KEYIDX | (OPTIONAL) L: | TL0PICIDX | (OPTIONAL) +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ T/K:|TID|Y| KEYIDX | (OPTIONAL) +-+-+-+-+-+-+-+-+
type VideoSize ¶
VideoSize represents video resolution
func ExtractH264VideoSize ¶
ExtractH264VideoSize extracts resolution from H.264 RTP payload
func ExtractH265VideoSize ¶
func ExtractVP8VideoSize ¶
ExtractVP8VideoSize extracts video resolution from VP8 key frame