onPreEncodeVideoFrame property
Occurs each time the SDK receives a video frame before encoding.
After you successfully register the video frame observer, the SDK triggers this callback each time it receives a video frame. In this callback, you can get the video data before encoding and then process the data according to your particular scenarios. It is recommended that you ensure the modified parameters in videoFrame are consistent with the actual situation of the video frames in the video frame buffer. Otherwise, it may cause unexpected rotation, distortion, and other issues in the local preview and remote video display. Due to framework limitations, this callback does not support sending processed video data back to the SDK. The video data that this callback gets has been preprocessed, with its content cropped and rotated, and the image enhanced.
videoFrame
The video frame. See VideoFrame. The default value of the video frame data format obtained through this callback is as follows: Android: I420 iOS: I420 macOS: I420 Windows: YUV420sourceType
The type of the video source. See VideoSourceType.
Implementation
final void Function(VideoSourceType sourceType, VideoFrame videoFrame)?
onPreEncodeVideoFrame;