Video Processor - Flutter
VideoSDK allows you to add custom effects to your video stream before it's transmitted during video calls. This lets you enhance your video in creative ways or achieve specific functionalities.
Understanding Video Processing​
Video processing involves manipulating raw video data (frames) captured by your camera. You can create native processors for Android and iOS to enhance video streams during meetings.
- Currently, Video Processing is supported only on Android and iOS devices.
The VideoProcessor
Interface​
The VideoProcessor
Interface defines a way for your code to interact with the video stream. It essentially lets you intercept each frame before it's sent and apply your processing logic.
Key Function: onFrameReceived
​
This is the heart of video processing with VideoSDK. Whenever a new video frame is captured by your camera, the onFrameReceived
function is called. This function provides you with the raw frame data, allowing you to modify it as needed.
How it Works:​
-
Implement the Interface: Create a class that implements the
VideoProcessor
interface. Within this class, define theonFrameReceived
function. -
Process the Frame: In the
onFrameReceived
function, access the raw video frame data. Apply your desired effects or manipulations to this data. -
Return the Processed Frame: After processing the frame, return the modified version to VideoSDK. This processed frame will then be transmitted during the video call.
-
Register Your Processor: Create instances of all the processors you plan to use during the meeting and register them with the
registerVideoProcessor()
method from theVideoSDK
class during your app's initialization. -
Apply the Processor: Select the desired processor and apply it during the meeting using the
applyVideoProcessor()
method from theVideoSDK
class to utilize its features. -
Remove the Processor: Stop applying the selected video processor during the meeting, using the
removeVideoProcessor()
method from theVideoSDK
class allowing you to switch to a different effect or processor as needed.
API Reference​
The API references for all the methods utilized in this guide are provided below.
Got a Question? Ask us on discord