Skip to content
pubscout

flutter_ffi_uvc

1.2.0, released 6 days ago by cornpip.dev

Control USB UVC cameras for live preview, capture, recording, and raw frames.

$ flutter pub add flutter_ffi_uvc
Source repository

What it does

Allows connecting to one or several USB UVC cameras to stream live video onto a Flutter Texture, take JPEG pictures, record MP4 videos, read raw RGBA frames, and adjust camera settings.

AI-written summary of version 1.1.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to connect external USB webcams or UVC cameras to a Flutter app.
  • You require raw frame access from a UVC camera for custom processing or ML.
  • You want to control camera settings like focus, pan, and tilt programmatically.

Skip it when

  • You only need the built-in device cameras rather than external USB UVC cameras.
  • You are developing for a platform not supported by the package.

Strengths

  • Supports multiple simultaneous USB cameras.
  • Provides raw frame access, picture capture, and MP4 video recording.
  • Includes stall detection, auto-recovery, and stream diagnostics.

Weaknesses

  • Requires specific platform setups for permissions and device access on Linux and macOS.
  • Video recording is not supported on Linux.

Setup

Kind
Plugin (native code)
Effort
Medium
Code generation
No
Direct dependencies
1

Android requires USB permissions. macOS requires Info.plist and entitlements configuration for camera access. Linux requires appropriate permissions for camera device nodes.

import 'package:flutter_ffi_uvc/flutter_ffi_uvc.dart';

Future<void> main() async {
  final devices = await uvcCamera.listUsbDevices();
  if (devices.isNotEmpty) {
    await uvcCamera.openUsbDevice(devices.first.deviceId);
    final int textureId = await uvcCamera.createPreviewTexture();
    final result = await uvcCamera.startPreviewAuto();
    if (result.success) {
      await uvcCamera.attachPreviewTexture(
        textureId,
        width: result.mode!.width,
        height: result.mode!.height,
      );
    }
  }
}

Alternatives

Packages that do the same job and could replace flutter_ffi_uvc.

  • camera

    Pick this if you need to use built-in mobile/desktop cameras rather than external USB UVC cameras.

Works with

Packages commonly used together with flutter_ffi_uvc: ones it builds on, ones built on it, and its own family.