onPreEncodeVideoFrame property

void Function(VideoSourceType sourceType, VideoFrame videoFrame)? onPreEncodeVideoFrame
final

Gets the video data before local encoding.

After successfully registering the video data observer, the SDK triggers this callback each time a video frame is captured. You can get the video data before encoding in the callback and process it as needed for your scenario. Due to framework limitations, this callback does not support sending the processed video data back to the SDK. The video data obtained here has already undergone preprocessing such as cropping, rotation, and beauty effects. It is recommended that you ensure the modified parameters in videoFrame match the actual video frame in the buffer; otherwise, unexpected rotation, distortion, etc., may occur in the local preview or remote video.

  • sourceType Type of video source. See VideoSourceType.
  • videoFrame Video frame data. See VideoFrame. The default format of the video frame data obtained through this callback is as follows: Android: I420 iOS: I420 macOS: I420 Windows: YUV420

Implementation

final void Function(VideoSourceType sourceType, VideoFrame videoFrame)?
    onPreEncodeVideoFrame;