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

GStreamer: pipeline have not been created #27

Open
jresch opened this issue Jul 19, 2022 · 16 comments
Open

GStreamer: pipeline have not been created #27

jresch opened this issue Jul 19, 2022 · 16 comments

Comments

@jresch
Copy link

jresch commented Jul 19, 2022

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

@leswright1977
Copy link
Owner

leswright1977 commented Jul 21, 2022 via email

@jresch
Copy link
Author

jresch commented Jul 21, 2022

Using Raspberry Pi 4 with Raspberry Pi OS (32 bit)
https://www.raspberrypi.com/software/

@leswright1977
Copy link
Owner

leswright1977 commented Jul 21, 2022 via email

@jresch
Copy link
Author

jresch commented Jul 21, 2022

Well thank you so much for answering while you are on vacation!
I will give it a try it with Raspbian Buster.

@jresch
Copy link
Author

jresch commented Jul 25, 2022

Have you come across this warning before (this is using Raspbian Buster)

[ WARN:0@1.005] 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)

@leswright1977
Copy link
Owner

leswright1977 commented Jul 26, 2022 via email

@jresch
Copy link
Author

jresch commented Jul 26, 2022

Yes, yes and yes.

@jresch
Copy link
Author

jresch commented Jul 27, 2022

As suggested online, I tried doing the cv2.VideoCapture(1) and cv2.VideoCapture(-1) and the cv2.VideoCapture(cv2.CAP_V4L2).
Didn't work

@jresch
Copy link
Author

jresch commented Jul 31, 2022

So....I switched out the camera and it worked with Raspbian Buster.

@Bra1nsen
Copy link

any updates?

@jresch
Copy link
Author

jresch commented Aug 16, 2022

For me at least, not on the newest OS.

@swagatk
Copy link

swagatk commented Jan 18, 2023

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.

@bycmlla
Copy link

bycmlla commented Feb 15, 2023

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?

@Petros626
Copy link

Petros626 commented Mar 7, 2023

@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
Copy link

swagatk commented Mar 7, 2023

@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.

@Petros626
Copy link

Petros626 commented Mar 8, 2023

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.

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

6 participants