Skip to content

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(width, height, sourceFps, videoFilterManager)

Description

Initializes the video filter with the specified parameters and prepares to process video frames.

Arguments

  • 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.

Returns



applyFilter(frame)

Description

Applies the video filter on a given input video frame.

Arguments

  • frame: RTCVideoFrame - The frame on which the filter logic should be performed.

Returns

  • Promise<void> - Promise that resolves once the filtering logic has been applied to the input frame.



stop()

Description

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.

Arguments

  • none

Returns

  • Promise<void> - Promise that resolves once all resources have been released.

Tutorials

Migration guides

Reference documentation

Clone this wiki locally