Skip to main content
This page describes the custom video preset PreOptionCustomVideo, used by the LocalCustomVideoTrack obtained from RTCEngine.getLocalCustomVideoTrack (which pushes external raw YUV frames into a published track). For the general preset structure (capture options + publish options) and PublishCustomOptions used at publish time, see Camera preset.

PreOptionCustomVideo

Purpose: The custom video track preset, combining custom capture parameters with video publish parameters.

Structure

PreOptionCustomVideo(capture: CustomVideoCaptureOptions, publish: VideoPublishOptions)

Capture options CustomVideoCaptureOptions

Purpose: Declares the specifications of the external frame source, which the SDK uses as a reference when creating the published track. The SDK doesn’t capture custom video itself; your app feeds the actual frames through LocalCustomVideoTrack.inputData.

Publish options VideoPublishOptions

Purpose: Same structure as the video publish parameters (for fields, see Camera preset).
  • The default custom video preset uses desc = TRACK_CUSTOM ("custom")
  • The screen scenario preset uses desc = TRACK_SHARE ("screen")
  • Custom video doesn’t use simulcast; simulcasts is always null

Built-in presets

Purpose: The SDK provides two custom video presets, PreOptionCustomVideo.def and PreOptionCustomVideo.screen.

Recommendations

  • Keep the frame resolution you push consistent with publish.width / publish.height to avoid extra scaling overhead; don’t exceed maxFps.
  • To appear as “sharing” to remote users, use PreOptionCustomVideo.screen, or override desc with PublishCustomOptions(desc = TrackDesc.TRACK_SHARE.value) in publishLocalVideo.
  • The SDK caches the track instance as a singleton; getting it again overwrites the old preOpt with the new one, so republish after switching presets.
  • For the full publishing flow, see Custom tracks.