GStreamer: pipeline have not been created
Hello!
Great project! I am just having a bit of an issue with openCV and GStreamer. Any suggestions would be much appreciated
[ WARN:0] global ../modules/videoio/src/cap_gstreamer.cpp (1824) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module v4l2src0 reported: Failed to allocate required memory. [ WARN:0] global ../modules/videoio/src/cap_gstreamer.cpp (914) open OpenCV | GStreamer warning: unable to start pipeline [ WARN:0] global ../modules/videoio/src/cap_gstreamer.cpp (501) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
What OS are you using for this?
Les
On Tuesday, July 19, 2022, jresch @.***> wrote:
Hello!
Great project! I am just having a bit of an issue with openCV and GStreamer. Any suggestions would be much appreciated
[ WARN:0] global ../modules/videoio/src/cap_gstreamer.cpp (1824) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module v4l2src0 reported: Failed to allocate required memory. [ WARN:0] global ../modules/videoio/src/cap_gstreamer.cpp (914) open OpenCV | GStreamer warning: unable to start pipeline [ WARN:0] global ../modules/videoio/src/cap_gstreamer.cpp (501) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
— Reply to this email directly, view it on GitHub https://github.com/leswright1977/PySpectrometer/issues/27, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG5IEE4TFNAUFOEPCFD4N4LVU3YGNANCNFSM54A52PNA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Using Raspberry Pi 4 with Raspberry Pi OS (32 bit)
https://www.raspberrypi.com/software/
That explains it. The Software was developed on Raspbian Buster (still available) the latest Pi OS breaks the camera. At some point I will have to recode a section of this, but I am on vacation just now.
Les
On Thu, 21 Jul 2022, 19:36 jresch, @.***> wrote:
raspberry pi OS (32 bit) https://www.raspberrypi.com/software/
— Reply to this email directly, view it on GitHub https://github.com/leswright1977/PySpectrometer/issues/27#issuecomment-1191810328, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG5IEE2A7WTRJ3PHSRGGIITVVGKBBANCNFSM54A52PNA . You are receiving this because you commented.Message ID: @.***>
Well thank you so much for answering while you are on vacation! I will give it a try it with Raspbian Buster.
Have you come across this warning before (this is using Raspbian Buster)
[ WARN:[email protected]] global /tmp/pip-wheel-8c7uejek/opencv-python_88dbbad412c5416b992ae69de26299d6/opencv/modules/videoio/src/cap_v4l.cpp (902) open VIDEOIO(V4L2:/dev/video0): can't open camera by index Traceback (most recent call last): File "pyspectrometer-v3.1.py", line 512, in <module> App(arg_parser().parse_args(), tkinter.Tk(), "PySpectrometer V3.0") File "pyspectrometer-v3.1.py", line 79, in __init__ self.vid = MyVideoCapture(args.calibration or App.DEFAULT_CALIBRATION, self.video_source) File "pyspectrometer-v3.1.py", line 302, in __init__ raise ValueError("Unable to open video source", video_source) ValueError: ('Unable to open video source', 0)
Weird, is the picamera connected, verified and working?
Les
On Monday, July 25, 2022, jresch @.***> wrote:
Have you come across this warning before (this is using Raspbian Buster)
[ @.*** global /tmp/pip-wheel-8c7uejek/opencv-python_ 88dbbad412c5416b992ae69de26299d6/opencv/modules/videoio/src/cap_v4l.cpp (902) open VIDEOIO(V4L2:/dev/video0): can't open camera by index Traceback (most recent call last): File "pyspectrometer-v3.1.py", line 512, in
App(arg_parser().parse_args(), tkinter.Tk(), "PySpectrometer V3.0") File "pyspectrometer-v3.1.py", line 79, in init self.vid = MyVideoCapture(args.calibration or App.DEFAULT_CALIBRATION, self.video_source) File "pyspectrometer-v3.1.py", line 302, in init raise ValueError("Unable to open video source", video_source) ValueError: ('Unable to open video source', 0) — Reply to this email directly, view it on GitHub https://github.com/leswright1977/PySpectrometer/issues/27#issuecomment-1194334583, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG5IEE3IRCNPQLQJBS7BWHTVV27WXANCNFSM54A52PNA . You are receiving this because you commented.Message ID: @.***>
Yes, yes and yes.
As suggested online, I tried doing the cv2.VideoCapture(1) and cv2.VideoCapture(-1) and the cv2.VideoCapture(cv2.CAP_V4L2). Didn't work
So....I switched out the camera and it worked with Raspbian Buster.
any updates?
For me at least, not on the newest OS.
I got similar warning with my picamera when I used cv2.VideoCapture() to open it. However, the following statement fixed these errors (Refer to this link for original source):
import cv2
cap = cv2.VideoCapture(0, cv2.CAP_V4L)
print(cap.isOpened())
I am using NoIR Camera V2 Raspberry Pi 4B with Raspbian Buster 32bit OS, opencv 4.5.5, python 2.7.16 as well as python 3.7.3. The option cv2.CAP_V4L2 also works for me.
I have the same problem, 'pipeline have not been created' but i using the Jetson Nano Developer Kit and the imx219 camera. Someone knows help me?
@swagatk for me your suggested method dont work. I'm using Bullseye 64-bit. @bycmlla I've read a lot of Issues and still struggle with the new RPi OS and the OV5647.
@swagatk for me your suggested method dont work. I'm using Bullseye 64-bit. @bycmlla I've read a lot of Issues and still struggle with the new RPi OS and the OV5647.
Hi, I have only tested this with Buster.
Update: I figured out, that with two settings you can run a camera with OpenCV (RPi or other manufacturer), BUT you very likely you will disable the new camera stack "libcamera".
Method 1:
sudo nano /boot/config.txt
#camera_auto_detect=1
gpu_mem=128 (minimum memory for camera)
start_x=1 (enable the camera module)
sudo reboot
Method 2:
sudo raspi-config
Interface Options
Enable legay camera options
It's just a workaround and not a solution using cameras with the new Bullseye OS, but I think the guys from OpenCV will need just some time to fix that, so we aren't forced to use that.
Tks @Petros626 !! It worked for me!!