Open SourceLamco Wayland › PipeWire

lamco-pipewire

High-performance PipeWire integration for Wayland screen capture, with DMA-BUF zero-copy

v0.4.2 · MIT/Apache-2.0

Hardware-accelerated frame transport

Once lamco-portal hands you a PipeWire file descriptor, lamco-pipewire turns it into a stream of frames. DMA-BUF zero-copy where the hardware supports it, software fallback where it doesn’t. Multi-monitor, multi-stream, with damage tracking and cursor extraction so downstream consumers only process what changed.

What’s inside

Zero-copy DMA-BUF

Hardware-accelerated frame transfer when available

Multi-monitor streams

Concurrent handling of multiple monitor streams

Format negotiation

Automatic format selection with fallbacks

YUV conversion

Built-in NV12, I420, YUY2 → BGRA

Cursor extraction

Separate cursor tracking for remote desktop

Damage tracking

Region-based change detection for efficient encoding

Adaptive bitrate

Network-aware bitrate control for streaming

Error recovery

Automatic reconnection and stream recovery

Quick start

capture loop
use lamco_pipewire::{PipeWireManager, PipeWireConfig, StreamInfo, SourceType};

// Create manager with default configuration
let mut manager = PipeWireManager::with_default()?;

// Connect using the portal-provided file descriptor (from lamco-portal)
manager.connect(fd).await?;

// Create a stream for a monitor
let stream_info = StreamInfo {
    node_id: 42,
    position: (0, 0),
    size: (1920, 1080),
    source_type: SourceType::Monitor,
};

let handle = manager.create_stream(&stream_info).await?;

// Receive frames
if let Some(mut rx) = manager.frame_receiver(handle.id).await {
    while let Some(frame) = rx.recv().await {
        println!("Frame: {}x{}", frame.width, frame.height);
    }
}

manager.shutdown().await?;

Feature flags

Feature Default Description
dmabufyesDMA-BUF zero-copy support
yuvnoYUV format conversion utilities
cursornoHardware cursor extraction
damagenoRegion damage tracking
adaptivenoAdaptive bitrate control
fullnoAll features enabled