| Crates.io | lamco-video |
| lib.rs | lamco-video |
| version | 0.1.2 |
| created_at | 2025-12-15 20:42:11.122287+00 |
| updated_at | 2025-12-23 18:13:39.156021+00 |
| description | Video frame processing and RDP bitmap conversion for Wayland screen capture |
| homepage | https://lamco.ai |
| repository | https://github.com/lamco-admin/lamco-wayland |
| max_upload_size | |
| id | 1986705 |
| size | 117,792 |
Video frame processing and RDP bitmap conversion for Wayland screen capture.
use lamco_video::{FrameProcessor, ProcessorConfig, BitmapConverter};
use lamco_pipewire::VideoFrame;
use tokio::sync::mpsc;
// Create frame processor
let config = ProcessorConfig::default();
let processor = std::sync::Arc::new(FrameProcessor::new(config, 1920, 1080));
// Create channels
let (input_tx, input_rx) = mpsc::channel(30);
let (output_tx, mut output_rx) = mpsc::channel(30);
// Start processor
let processor_clone = processor.clone();
tokio::spawn(async move {
processor_clone.start(input_rx, output_tx).await
});
// Send frames from lamco-pipewire, receive bitmap updates
while let Some(bitmap_update) = output_rx.recv().await {
for rect in &bitmap_update.rectangles {
println!("Update region: {:?}", rect.rectangle);
}
}
use lamco_video::ProcessorConfig;
let config = ProcessorConfig {
target_fps: 60, // Target frame rate
max_queue_depth: 30, // Max frames in queue before dropping
adaptive_quality: true, // Enable adaptive quality
damage_threshold: 0.05, // Minimum damage area to process (5%)
drop_on_full_queue: true, // Drop frames when queue is full
enable_metrics: true, // Enable statistics collection
};
use lamco_video::DispatcherConfig;
let config = DispatcherConfig {
channel_size: 30, // Buffer size per stream
priority_dispatch: true, // Enable priority-based dispatch
max_frame_age_ms: 150, // Drop frames older than 150ms
enable_backpressure: true, // Enable backpressure handling
high_water_mark: 0.8, // Trigger backpressure at 80%
low_water_mark: 0.5, // Release backpressure at 50%
load_balancing: true, // Enable load balancing
};
The processing pipeline:
┌────────────────────┐
│ lamco-pipewire │
│ (VideoFrame) │
└─────────┬──────────┘
│
▼
┌────────────────────┐
│ FrameDispatcher │ ◄── Multi-stream routing
│ (priority queue) │ Backpressure handling
└─────────┬──────────┘
│
▼
┌────────────────────┐
│ FrameProcessor │ ◄── Frame rate limiting
│ (rate control) │ Age-based dropping
└─────────┬──────────┘
│
▼
┌────────────────────┐
│ BitmapConverter │ ◄── Pixel format conversion
│ (format conv) │ Damage region tracking
└─────────┬──────────┘ Buffer pooling
│
▼
┌────────────────────┐
│ BitmapUpdate │ ◄── RDP-ready rectangles
│ (RDP output) │
└────────────────────┘
The converter supports these RDP-compatible output formats:
| Format | BPP | Description |
|---|---|---|
| BgrX32 | 4 | 32-bit BGRX (most common) |
| Bgr24 | 3 | 24-bit BGR |
| Rgb16 | 2 | 16-bit RGB 5:6:5 |
| Rgb15 | 2 | 15-bit RGB 5:5:5 |
| Feature | Default | Description |
|---|---|---|
damage |
No | Full damage region tracking |
full |
No | All features enabled |
[dependencies]
lamco-video = { version = "0.1", features = ["full"] }
Typical performance on modern hardware:
lamco-portal - XDG Desktop Portal integrationlamco-pipewire - PipeWire screen captureLicensed under either of:
at your option.