raymanfx / libv4l-rs

Video4Linux2 bindings for Rust
MIT License
145 stars 62 forks source link

Failed to start media pipeline #59

Open thedodd opened 2 years ago

thedodd commented 2 years ago

First, thanks for the great work on this crate.

I'm running into a bit of a strange issue where my video stream is refusing to start. My settings for the device:

let mut fmt = dev.format()?;
fmt.fourcc = FourCC::new(b"BA81");
fmt.width = 640;
fmt.height = 480;
fmt.stride = 640;
fmt.size = 640 * 480;
fmt.field_order = FieldOrder::Progressive;
fmt.colorspace = Colorspace::RAW;
dev.set_format(&fmt)?;

// Using an mmap stream:
mmap::Stream::with_buffers(&dev, Type::VideoCapture, 8)

When I check syslog, I see a bunch of the following:

Jul 23 00:08:38 pi3 kernel: [33785.523627] unicam 3f801000.csi: Wrong width or height 640x480 (remote pad set to 3280x2464)
Jul 23 00:08:38 pi3 kernel: [33785.523643] unicam 3f801000.csi: Failed to start media pipeline: -22

Versions and such:

# v4l-utils package
1.20.0-2

# uname -a
Linux pi3 5.15.32-v8+ #1538 SMP PREEMPT Thu Mar 31 19:40:39 BST 2022 aarch64 GNU/Linux

The main question I have is: how can I configure that remote pad setting? Seems to be part of the issue here.

MarijnS95 commented 2 years ago

@thedodd If I have to guess, the "remote pad" here is part of the Media API (use media-ctl -p to print the layout of your camera hardware). Fortunately I had written some support for this API and hope to finish + PR it one day, when there's interest:

https://github.com/MarijnS95/libv4l-rs/tree/media

thedodd commented 2 years ago

Nice, thanks for the response. I'll give it a try.