xcamera 0.0.2
xcamera: ^0.0.2 copied to clipboard
A lightweight Flutter camera plugin for Linux supporting high-performance V4L2 streaming and synchronized H.264/AAC video recording.
XCamera #
A high-performance, lightweight Flutter camera plugin built exclusively for Linux platforms.
It uses a Clean Architecture design with Flutter Method Channels, Event Channels, and Flutter Textures to provide efficient real-time camera streaming with low CPU and memory overhead.
Features #
- Device Discovery: Enumerate connected camera devices and their hardware capabilities.
- High-Performance Live Preview: Render real-time camera streams using optimized Flutter Textures.
- Video Recording: Capture and encode video in H.264 format with optional AAC audio support, producing standard MP4 files.
- Configurable Audio Recording: Enable or disable audio capture using the
enableAudiosetting. - Multi-Camera Support: Create multiple
CameraControllerinstances to preview and record from multiple camera devices simultaneously. - Raw Stream Access: Access raw image frames directly in Dart for processing, computer vision, or custom analytics.
Prerequisites #
To build and compile the native C++ engine, ensure the following tools and development headers are installed on your Linux host:
sudo apt update
sudo apt install -y libgtk-3-dev libudev-dev libopenh264-dev libyuv-dev
Platform Support #
This package is designed exclusively for Linux (requires Kernel headers and V4L2 subsystem). It is not supported on Windows, macOS, Android, or iOS.
Native Implementation & Dependencies #
The native Linux C++ library is built directly into the app bundle using CMake. It leverages:
- Video4Linux2 (V4L2): Low-level Linux video capture.
- OpenH264: Real-time H.264 video compression (system package dependency).
- VisualOn AAC Encoder (
vo-aacenc): Bundled locally inthird_party/for offline-ready compilation. - miniaudio & minimp4: Low-overhead microphone recording and container muxing (bundled locally in
third_party/). - libyuv: High-speed pixel format conversions (system package dependency).