Open sobczakDev opened 2 weeks ago
Try replacing v4l2src device=/dev/video0
with libcamerasrc
.
Thanks for quick response. I changed v4l2src device=/dev/video0
to libcamerasrc
and now the error is different:
pi@raspberrypi:~/GStreamer-1.18.4-RPi_64-bits $ ./main
Using pipeline:
libcamerasrc0 ! video/x-raw, width=(int)1280, height=(int)720, framerate=(fraction)30/1 ! videoconvert ! videoscale ! video/x-raw, width=(int)640, height=(int)360 ! appsink
(main:3095): GStreamer-CRITICAL **: 10:50:17.727: gst_caps_get_structure: assertion 'GST_IS_CAPS (caps)' failed
(main:3095): GStreamer-CRITICAL **: 10:50:17.727: gst_structure_get_int: assertion 'structure != NULL' failed
[ WARN:0@30.021] global cap_gstreamer.cpp:1714 open OpenCV | GStreamer warning: cannot query video width/height
(main:3095): GStreamer-CRITICAL **: 10:50:17.727: gst_structure_get_fraction: assertion 'structure != NULL' failed
[ WARN:0@30.021] global cap_gstreamer.cpp:1722 open OpenCV | GStreamer warning: cannot query video fps
[ WARN:0@30.021] global cap_gstreamer.cpp:1777 open OpenCV | GStreamer warning: Cannot query video position: status=0, value=-1, duration=-1
Hit ESC to exit
(main:3095): GStreamer-CRITICAL **: 10:51:22.833: gst_sample_get_caps: assertion 'GST_IS_SAMPLE (sample)' failed
[ERROR:0@95.127] global cap_gstreamer.cpp:934 retrieveVideoFrame GStreamer: gst_sample_get_caps() returns NULL
Capture read error
Maybe I need to downgrade GStreamer
? Because I'm using 1.22
but your code requires 1.18
🤔
I just checked whether the default rpicam-hello
works on my RPi 5, and it works as expected:
pi@raspberrypi:~/GStreamer-1.18.4-RPi_64-bits $ rpicam-hello
[0:15:34.108728668] [3646] INFO Camera camera_manager.cpp:325 libcamera v0.3.2+27-7330f29b
[0:15:34.119938437] [3652] INFO RPI pisp.cpp:695 libpisp version v1.0.7 28196ed6edcf 29-08-2024 (16:33:32)
[0:15:34.144413149] [3652] INFO RPI pisp.cpp:1154 Registered camera /base/axi/pcie@120000/rp1/i2c@88000/imx708@1a to CFE device /dev/media0 and ISP device /dev/media1 using PiSP variant BCM2712_C0
Made X/EGL preview window
Mode selection for 2304:1296:12:P
SRGGB10_CSI2P,1536x864/0 - Score: 3400
SRGGB10_CSI2P,2304x1296/0 - Score: 1000
SRGGB10_CSI2P,4608x2592/0 - Score: 1900
Stream configuration adjusted
[0:15:35.279229067] [3646] INFO Camera camera.cpp:1197 configuring streams: (0) 2304x1296-YUV420 (1) 2304x1296-BGGR_PISP_COMP1
[0:15:35.279361511] [3652] INFO RPI pisp.cpp:1450 Sensor: /base/axi/pcie@120000/rp1/i2c@88000/imx708@1a - Selected sensor format: 2304x1296-SBGGR10_1X10 - Selected CFE format: 2304x1296-PC1B
I've tested the libcamerasrc
on my Rpi 4.
On the Rpi 5, I'm running into issues also. A quick google scan reveals that it a common issue, the Rpi5 + 12 Mp Raspicam + Gstreamer. I have to spend more time to the issue. Hopefully in the weekend. Right now, I'm too busy.
Hi,
First of all, I would like to greet the entire Qengineering team! You are doing an amazing job, and the fact that you make everything open-source is incredibly valuable!
Recently, I bought a Raspberry Pi 5 with 8GB of RAM, and I wanted to set up a stream using the Raspberry Pi Camera HD v3 12MPx. Of course, I would like to do this in C++.
I cloned your repository using:
git clone git@github.com:Qengineering/GStreamer-1.18.4-RPi_64-bits.git
I opened it in Code::Blocks and followed all the instructions you provided in Readme Unfortunately, after compilation, I encountered the following error:
I am a bit surprised by the
Failed to allocate required memory error
, considering I have the 8GB version of the Raspberry Pi 5.I would be grateful if someone could help me with this issue 🙏
===== I'm using
OpenCV 4.9.0
installed from here My stack: