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 throughLocalCustomVideoTrack.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;
simulcastsis alwaysnull
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.heightto avoid extra scaling overhead; don’t exceedmaxFps. - To appear as “sharing” to remote users, use
PreOptionCustomVideo.screen, or overridedescwithPublishCustomOptions(desc = TrackDesc.TRACK_SHARE.value)inpublishLocalVideo. - The SDK caches the track instance as a singleton; getting it again overwrites the old
preOptwith the new one, so republish after switching presets. - For the full publishing flow, see Custom tracks.