Custom video source
Custom video capture refers to the collection of a video stream from a custom source. Unlike the default video capture method, custom video capture enables you to control the capture source, and precisely adjust video attributes. You can dynamically adjust parameters such as video quality, resolution, and frame rate to adapt to various application scenarios. For example, you can capture video from high-definition cameras, and drone cameras.
Agora recommends default video capture for its stability, reliability, and ease of integration. Custom video capture offers flexibility and customization for specific video capture scenarios where default video capture does not fulfill your requirements.
Try out the online demo for Custom video source.
Understand the tech
Video SDK provides support for creating local video tracks by passing in a MediaStreamTrack object to createCustomVideoTrack
.
Prerequisites
Ensure that you have implemented the SDK quickstart in your project.
Implement the logic
You implement custom video capture or preprocessing by obtaining the MediaStreamTrack
object. For example, you can manually call the getUserMedia
method to get the MediaStreamTrack
and then use createCustomVideoTrack
to create a local video track object that you use in Video SDK.
You can also use HTMLMediaElement.captureStream or HTMLCanvasElement.captureStream to obtain the MediaStreamTrack
object.
The MediaStreamTrack
object refers to the browser-native supported MediaStreamTrack
object. For specific usage and browser support, refer to the MediaStreamTrack
API documentation.
Reference
This section contains content that completes the information on this page, or points you to documentation that explains other aspects to this product.