RegisterVideoEncodedFrameObserver

Registers a receiver object for the encoded video image.

Details

If you only want to observe encoded video frames (such as h.264 format) without decoding and rendering the video, Agora recommends that you implement one IVideoEncodedFrameObserver class through this method.

If you want to obtain the original video data of some remote users (referred to as group A) and the encoded video data of other remote users (referred to as group B), you can refer to the following steps:
  1. Call RegisterVideoFrameObserver to register the raw video frame observer before joining the channel.
  2. Call RegisterVideoEncodedFrameObserver to register the encoded video frame observer before joining the channel.
  3. After joining the channel, get the user IDs of group B users through FOnUserJoined, and then call SetRemoteVideoSubscriptionOptions to set the encodedFrameOnly of this group of users to true.
  4. Call MuteAllRemoteVideoStreams(false)to start receiving the video streams of all remote users. Then:
    • The raw video data of group A users can be obtained through the callback in IVideoFrameObserver, and the SDK renders the data by default.
    • The encoded video data of group B users can be obtained through the callback in IVideoEncodedFrameObserver.
Attention:
  • Call this method before joining a channel.

Parameters

observer
The video frame observer object. See IVideoEncodedFrameObserver.

Returns

  • 0: Success.
  • < 0: Failure.