Video Processor - Android
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 to enhance video streams during meetings.
The VideoFrameProcessor
Interface
The VideoFrameProcessor
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: onFrameCaptured
This is the heart of video processing with VideoSDK. Whenever a new video frame is captured by your camera, the onFrameCaptured
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
VideoFrameProcessor
interface. Within this class, define theonFrameCaptured
function. -
Process the Frame: In the
onFrameCaptured
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.
-
Apply the Processor: To apply a processor, pass an object of your class as a parameter to the
applyVideoProcessor()
method of theVideoSDK
class. -
Remove the Processor: To stop applying the selected video processor, use the
removeVideoProcessor()
method of theVideoSDK
class.
API Reference
The API references for all the methods utilized in this guide are provided below.
Got a Question? Ask us on discord