-
Notifications
You must be signed in to change notification settings - Fork 0
VideoFilter
Adnan Mujagić edited this page Jul 5, 2024
·
2 revisions
Note: Your video filter implementation needs to implement this interface. For example implementations that fit common use cases, take a look at our
RTC extensions library
.
start(witdh: number, height: number, sourceFps: number, videoFilterManager: VideoFilterManager): Promise<MediaStreamVideoTrack>
applyFilter(frame: RTCVideoFrame): Promise<void>
stop(): Promise<void>
Initializes the video filter with the specified parameters and prepares to process video frames.
-
width
:number
- The width of the source camera stream. -
height
:number
- The height of the source camera stream. -
sourceFps
:number
- The framerate of the source camera stream. -
videoFilterManager
:VideoFilterManager
- The video filter manager currently using this video filter.
-
Promise<MediaStreamVideoTrack>
-Promise that resolves to the filtered video media track.
Applies the video filter on a given input video frame.
-
frame
:RTCVideoFrame
- The frame on which the filter logic should be performed.
-
Promise<void>
- Promise that resolves once the filtering logic has been applied to the input frame.
Stops the video filter. All associated resources should be deallocated as the video
filter may not be started again and the instance could be discarded.
A stopped filter may be started again, using the start
method. This method is guaranteed to be
called exactly once after each invocation of start
, including if the initialization fails.
none
-
Promise<void>
- Promise that resolves once all resources have been released.