TRTCVideoFrame

TRTCVideoFrame

Video frame information

Constructor

new TRTCVideoFrame(videoFormat, bufferType, data, textureId, length, width, height, timestamp, rotation)

TRTCVideoFrame is used to describe the raw data of a frame of the video image, which is the image data before frame encoding or after frame decoding.

Parameters:
Name Type Description
videoFormat TRTCVideoPixelFormat required

video pixel format

bufferType TRTCVideoBufferType required

video data structure type

data ArrayBuffer required

video data when bufferType is TRTCVideoBufferType_Buffer.

textureId Number required

video texture ID, i.e., video data when bufferType is TRTCVideoBufferType_Texture, which carries the texture data used for OpenGL rendering.

length Number required

video data length in bytes. For I420, length = width * height * 3 / 2; for BGRA32, length = width * height * 4.

width Number required

video width. Please enter the width of the video data passed in.

height Number required

video height. Please enter the height of the video data passed in.

timestamp Number required

video frame timestamp in milliseconds

rotation Number required

clockwise rotation angle of video pixels