-
Notifications
You must be signed in to change notification settings - Fork 214
[BUG] MJPEGEncoder - TypeError: memoryview: casts are restricted to C-contiguous views #959
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
Comments
Hi, thanks for the report. Yes, there do seem to be some problems passing images to libav when there is padding on the end of each row of pixels (as hardware often requires for alignment purposes). Specifically it's the PyAV wrapper that doesn't like non-contiguous arrays. Doing yet another copy to make them contiguous seems quite painful, so it would probably be better to patch PyAV to cope - I'll have a look. |
OK, I think the top commit here https://github.com/davidplowman/PyAV should do it. Obviously that'll have to get built into a package and distributed to our apt repo. |
Hi, Now all stream sizes, listed in the sensor modes, can be successfully configured. Thank you very much |
Thanks for the confirmation. I'll get the version in our apt repository updated. |
I think the apt repo for Bookworm has also been updated now if that helps. |
Hello,
Bug Description
I am working on a web server for controlling Raspberry Pi cameras with picamera2 (raspi-cam-srv)
This includes an MJPEG live stream.
Working with camera module 2, I try to use several stream sizes which are available in the 7 sensor modes.
The following sizes have been tested:
(640, 480) - OK
(1640, 1232) - NOK
(1920, 1080) - OK
(3280, 2464) - NOK
For stream sizes marked above with NOK, I get the following exception:
To Reproduce
To reproduce the issue, I have attached the following test program which is an excerpt of the streaming server of raspiCamSrv.
testPicamera2MJPEGEncoder.py.txt
Expected behaviour
The MJPEGEncoder should support all stream sizes of the available sensor modes.
Console Output, Screenshots
This is the output obtained when running the test program:
testOutput.txt
Hardware
RPi 5
Attached cameras:
OS: Bookworm
Debian version: 12.5
Additional Context
The above error does not occur when using the different stream sizes with camera module 3.
The text was updated successfully, but these errors were encountered: