Class: shaka.codec.VP9

Members

CHROMA_420_COLOCATED :number

Values of the chroma subsampling field of the VP9 codec string.
Type:
  • number
Source:

CHROMA_422 :number

Type:
  • number
Source:

CHROMA_444 :number

Type:
  • number
Source:

COLOR_SPACE_RGB_ :number

@const
Type:
  • number
Source:

DEFAULT_FRAME_RATE_ :number

Frame rate assumed to pick a level when the stream does not say.
Type:
  • number
Source:

FRAME_MARKER_ :number

Fields of the uncompressed header of a VP9 frame: the marker every frame starts with, the profile whose header has one reserved bit, the value of frame_type for a key frame, the sync code of key frames and RGB's color space.
Type:
  • number
Source:

KEY_FRAME_ :number

@const
Type:
  • number
Source:

LEVELS_ :Array<!Array<number>>

VP9 levels: [level, MaxLumaSampleRate, MaxLumaPictureSize], from Annex A of the VP9 bitstream specification. Levels 4/4.1 and 5/5.1/5.2 differ only in the bitrate and the sample rate limits.
Type:
  • Array<!Array<number>>
Source:

MIN_KEYFRAME_SIZE_ :number

The bytes needed to read the uncompressed header of a key frame up to the frame size: marker, profile and flags, sync code, color config and size.
Type:
  • number
Source:

PROFILE_WITH_RESERVED_BIT_ :number

@const
Type:
  • number
Source:

SYNC_CODE_ :number

@const
Type:
  • number
Source:

UNSPECIFIED_ :number

The value of the color primaries, transfer and matrix fields when the stream does not say (H.273 "unspecified").
Type:
  • number
Source:

Methods

buildVpcC(codecs) → {Uint8Array}

Builds the payload of the vpcC box (VP Codec Configuration) from a VP9 codec string.
Parameters:
Name Type Description
codecs string 'vp09.PP.LL.DD', optionally followed by '.CC.cp.tc.mc.FF'.
Source:
See:
Returns:
Type
Uint8Array

getCodecs(info, width, height, frameDurationnullable) → {string}

Builds the codec string of a VP9 stream.
Parameters:
Name Type Attributes Description
info {profile: number, bitDepth: number, chroma: number}
width number
height number
frameDuration number <nullable>
Seconds per frame, if known.
Source:
Returns:
Type
string

getLevel_(width, height, frameDurationnullable) → {number}

Picks the lowest VP9 level whose limits hold the picture size and the sample rate.
Parameters:
Name Type Attributes Description
width number
height number
frameDuration number <nullable>
Source:
Returns:
Type
number

parseKeyFrame(framenon-null) → {?{profile: number, bitDepth: number, chroma: number, width: number, height: number}}

Reads what the codec string of a stream needs from a key frame, for the containers that do not carry it apart from the frames.
Parameters:
Name Type Description
frame Uint8Array A VP9 frame; only key frames are usable.
Source:
See:
Returns:
Type
?{profile: number, bitDepth: number, chroma: number, width: number, height: number}