PushVideoFrame

Pushes the external raw video frame to the SDK through video tracks.

Details

To publish a custom video source, see the following steps:
  1. Call CreateCustomVideoTrack to create a video track and get the video track ID.
  2. Call JoinChannel to join the channel. In FChannelMediaOptions, set customVideoTrackId to the video track ID that you want to publish, and set publishCustomVideoTrack to true.
  3. Call this method and specify videoTrackId as the video track ID set in step 2. You can then publish the corresponding custom video source in the channel.
DANGER: After calling this method, even if you stop pushing external video frames to the SDK, the custom video stream will still be counted as the video duration usage and incur charges. Agora recommends that you take appropriate measures based on the actual situation to avoid such video billing.
  • If you no longer need to capture external video data, you can call DestroyCustomVideoTrack to destroy the custom video track.
  • If you only want to use the external video data for local preview and not publish it in the channel, you can call MuteLocalVideoStream to cancel sending video stream or call UpdateChannelMediaOptions to set publishCustomVideoTrack to false.

Parameters

frame

The external raw video frame to be pushed. See ExternalVideoFrame.

videoTrackId
The video track ID returned by calling the CreateCustomVideoTrack method. The default value is 0.

Returns

  • 0: Success.
  • < 0: Failure.