Multi-view Video Streaming

Last Updated on : 2025-01-02 10:22:08download

Create an IThingSmartCameraP2P object and use isSupportVideoSegmentation to determine whether the video stream can be split. If video splitting is supported, the SDK will split the video stream according to the configuration protocol and render the video stream. Otherwise, standard live streaming is displayed.

How it works

Multi-view Video Streaming

Important notes

  • If the video stream is not split or an exception occurs, confirm whether the splitting protocol is configured correctly.
  • When using multithreading, be aware of IThingSmartCameraP2P object management, and avoid frequently calling methods in IThingSmartCameraP2P across threads to prevent deadlocks.

Core code

Create an IThingSmartCameraP2P object

IThingSmartCameraP2P createCameraP2P(String devId);

Check support for video splitting

ThingVideoSplitInfo getCameraVideoSegmentationModel();

boolean isSupportVideoSegmentation();

Bind with a video rendering view

// Bind with a video rendering view
void generateCameraView(T view);

Connect

void connect(String devId, OperationDelegateCallBack callBack);

Start live streaming

// Start live streaming
void startPreview(int definition, OperationDelegateCallBack callBack);

Stop live streaming

// Stop live streaming
void stopPreview(OperationDelegateCallBack callBack);

Disconnect

// Proactively disconnect
void disconnect(OperationDelegateCallBack callBack);

Example

You can refer to the complete process in the SDK sample.