enableVideoObjectSegmentation method

Future<void> enableVideoObjectSegmentation(
  1. bool enable,
  2. ZegoObjectSegmentationConfig config,
  3. ZegoPublishChannel channel
)

Enable video object segmentation.

Available since: 3.6.0 Description: Video object segmentation and transmission is a technology that separates the video object (in most cases, a person) in a rectangular video through an AI algorithm at the push end, transmits it in the RTC network, and renders it at the stream playing end. Use cases: Scenes where the object in the video needs to be separated from the background, such as mixed reality, multi-person interaction scenes, and so on. When to call: After the engine is created createEngine. Restrictions: Enabling object segmentation is a time-consuming operation, and it is not necessary to turn it on and off frequently. Caution: This feature requires special braiding, please contact ZEGO Technical Support Related callbacks: When the object segmentation is turned on or off, the notification of the object segmentation state can be received through onVideoObjectSegmentationStateChanged. Related APIs: Use enableAlphaChannelVideoEncoder to support the transparent background encoding of the divided object, and then publish the stream, you can render the object with a transparent background effect on the stream playing side. Note: This function is only available in ZegoExpressVideo SDK!

  • enable Whether to enable video object segmentation, off by default.
  • config The type of object segmentation.
  • channel Publish stream channel.

Implementation

Future<void> enableVideoObjectSegmentation(bool enable,
    ZegoObjectSegmentationConfig config, ZegoPublishChannel channel) async {
  return await ZegoExpressImpl.instance
      .enableVideoObjectSegmentation(enable, config, channel);
}