sendCustomVideoData abstract method
- TRTCVideoStreamType streamType,
- TRTCVideoFrame frame
Deliver captured video frames to SDK
You can use this API to deliver video frames you capture to the SDK, and the SDK will encode and transfer them through its own network module.
We recommend you enter the following information for the TRTCVideoFrame parameter (other fields can be left empty):
- pixelFormat:
- On Windows and Android, only TRTCVideoPixelFormat.i420 is supported; on iOS and macOS, both TRTCVideoPixelFormat.i420 and TRTCVideoPixelFormat.bgra32 are supported.
- bufferType:
- TRTCVideoBufferType.buffer is recommended.
- data:
- Buffer used to carry video frame data.
- length:
- Video frame data length. If
pixelFormat
is set to I420,length
can be calculated according to the following formula: length = width * height * 3 / 2.
- Video frame data length. If
- width:
- Video image width, such as 640 px.
- height:
- Video image height, such as 480 px.
- timestamp (ms)
Parameters:
- frame(TRTCVideoFrame):
- Video data, which can be in I420 format.
- streamType(TRTCVideoStreamType):
- Specify video stream type (TRTCVideoStreamType.big : HD big image; TRTCVideoStreamType.sub : substream image).
Implementation
void sendCustomVideoData(TRTCVideoStreamType streamType, TRTCVideoFrame frame);