-
Notifications
You must be signed in to change notification settings - Fork 202
Description
Description
Currently, the Flutter SDK exposes a processor parameter in CameraCaptureOptions:
CameraCaptureOptions({ this.cameraPosition = CameraPosition.front, this.focusMode = CameraFocusMode.auto, this.exposureMode = CameraExposureMode.auto, String? deviceId, double? maxFrameRate, VideoParameters params = VideoParametersPresets.h720_169, this.stopCameraCaptureOnMute = true, TrackProcessor<VideoProcessorOptions>? processor, // <-- here })
However, the internal implementation still uses AudioProcessorOptions when initializing the processor:
var processorOptions = AudioProcessorOptions( track: mediaStreamTrack, ); await _processor!.init(processorOptions);
Problem
The API suggests that a VideoProcessor can be attached to a camera track, but in practice, this does not work for video.
Any attempt to attach a blur processor or other video frame manipulation fails because it is initialized with AudioProcessorOptions.
Effectively, video frame processing is not supported, despite the API appearing to allow it.
Suggested Enhancement
Implement proper VideoProcessorOptions support for LocalVideoTrack / CameraCaptureOptions.
setProcessor() for video tracks should initialize the processor with VideoProcessorOptions instead of AudioProcessorOptions.
This would allow developers to:
Intercept video frames from the camera track
Apply custom processing (e.g.,blurring, filters)
Publish the processed video frames to the room
Example Desired Usage
`class BlurProcessor extends VideoProcessor {
@OverRide
Future process(VideoFrame frame) async {
// Run Blur
// Apply blur to detected objects
return frame;
}
}
final cameraTrack = await LocalVideoTrack.createCameraTrack(
CameraCaptureOptions(
processor: BlurProcessor(),
),
);
await room.localParticipant.publishTrack(cameraTrack);`
This would allow real-time video frame processing in Flutter Web / mobile apps, similar to what is currently possible in LiveKit JS or Python SDKs.
Priority / Impact
High — this feature is essential for applications that require real-time video frame processing, such as:
Content moderation (blur offensive content)
Real-time video filters for privacy or AR effects
References / Related:
LocalVideoTrack.setProcessor() in Flutter SDK
CameraCaptureOptions.processor API
Current implementation uses AudioProcessorOptions incorrectly