Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble acquiring stream on Raspberry Pi (Raspbian) #12

Open
DoctorWhoof opened this issue May 12, 2024 · 2 comments
Open

Trouble acquiring stream on Raspberry Pi (Raspbian) #12

DoctorWhoof opened this issue May 12, 2024 · 2 comments

Comments

@DoctorWhoof
Copy link

Hi, thanks so much for this crate!
I managed to get it running without issues on MacOS, and I can compile on a raspberry Pi.

When I run the program on a raspberry Pi "device.streams()" returns an empty vector, even though I get these devices listed when I print out "ctx.devices()":

Available devices:
    Description { uri: "v4l:///dev/video0", product: "mmal service 16.1" }
    Description { uri: "v4l:///dev/video22", product: "bcm2835-isp" }
    Description { uri: "v4l:///dev/video21", product: "bcm2835-isp" }
    Description { uri: "v4l:///dev/video15", product: "bcm2835-isp" }
    Description { uri: "v4l:///dev/video14", product: "bcm2835-isp" }

There's a camera connected and it is functional, I believe it's the "/dev/video0", listed above. Is there anything I'm missing?
The repo with the program, a single main.rs file, is here:

https://github.com/DoctorWhoof/motion-detect

Any help would be appreciated, thanks!

@RakuJa
Copy link

RakuJa commented Jul 12, 2024

I have the same problem with raspberry pi 4. When i fetch video stream or images using the picamera software it works without problems. (And also if i try to get the stream from a usb camera attached to the raspberry it works, only with the camera module it won't fetch anything). I'm stuck as well

@raymanfx
Copy link
Owner

raymanfx commented Aug 8, 2024

The device.streams() function is here: https://github.com/raymanfx/eye-rs/blob/master/eye-hal/src/platform/v4l2/device.rs#L54. It calls enum_formats() on the V4L2 platform device eventually, which is defined here: https://github.com/raymanfx/libv4l-rs/blob/master/src/video/macros.rs#L82.

The Raspberry Pi camera may only support multiplanar capture formats. In that case, they would not be enumerated here and thus be missing as you observed. I don't have a Pi camera for testing, so I hope these pointers are enough to get you going :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants