-
Notifications
You must be signed in to change notification settings - Fork 196
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
[HOW-TO] high resolution streaming with raspberry pi 4B + arducam 64MP (imx477) #1181
Comments
Hi, I think I've already answered this question on the forum. My advice was to avoid the "lores" image because you have to have a "main" image, so you may as well just use that. Also reduce the Although If it still isn't working, please post a short but self-contained code snippet - configuring and starting the recording should be less than a dozen lines, I would think. |
Hi, thanks for reply! I still haven't solved the problem. I wasn't able to make main stream work with MJPEG encoder. here is a code snipped: from picamera2 import Picamera2 class StreamingOutput(io.BufferedIOBase): camera = Picamera2() streamOut = StreamingOutput() camera.start() |
Hi, you don't say in what way it doesn't work. I would start with the absolute simplest example possible, such as
Does that recording anything? If not, in what way does it fail? |
Just tried and this is the output. [1:17:07.323424285] [1312] INFO Camera camera_manager.cpp:325 libcamera v0.3.2+124-e0a2304e-dirty (2024-12-09T06:48:46GMT) the file test.mjpeg is saved but is empty |
Hi,
I'm working on a raspberry pi 4B and I'm trying to perform a video streaming with a resolution equal to 3840x2160
My goal is basically to reach the same performance of the following libcamera command:
libcamera-vid --codec mjpeg --flush 1 -n -t 0 -k --inline --listen --quality 85 --width 3840 --height 2160 --framerate 20
but I need to do it through picamera2.
To reach this goal, ideally I need to have just the "lores" stream but I'm not able to find a way to deactivate the "main" stream.
Indeed, keeping active both streams is not possible if we need an high resolution because of memory issues due to the fact that if "lores" stream resolution is set to 3840x2160, "main" stream resolution must be higher or the following error will be raised:
" File "/usr/local/lib/python3.11/dist-packages/picamera2/picamera2.py", line 830, in check_camera_config
raise RuntimeError("lores stream dimensions may not exceed main stream")
RuntimeError: lores stream dimensions may not exceed main stream "
I already set cma memory to 512 in the config.txt but memory is still not enough.
I hope someone have some suggestion to deactivate "main" stream and keep just "lores" which seams to be faster.
(to delete main stream, It seams not enough to define just "lores" stream in the configuration like in the following command: create_video_configuration(lores={"size": (3840, 2160), "format": "YUV420"}, encode="lores"))
I also tried to define main stream with same configuration of the example above:
however, the use of "yuv420" format and MJPEGencoder on "main" stream raises the following error:
File "/usr/local/lib/python3.11/dist-packages/picamera2/encoders/v4l2_encoder.py", line 149, in _start
fcntl.ioctl(self.vd, VIDIOC_STREAMON, typev)
ProcessLookupError: [Errno 3] No such process
If you have any suggestion let me know.
thank you in advance for your help.
The text was updated successfully, but these errors were encountered: