I am using cap = cv.VideoCapture(0) When opening the camera to record video, the program will work but he prompts me ((process:10728): GStreamer-CRITICAL **: gst_element_get_state: assertion 'GST_IS_ELEMENT (element)' failed ) I don't know what the reason is, is it because of a problem with your cmake or a problem with the installation?
Asked
Active
Viewed 3,258 times
2 Answers
1
I had similar issue in version 3.4.4, compiled with gstreamer support. Syntax "cv2.VideoCapture(0)" just stopped working. I had all gst-* libraries installed, so most of answers wasn't helpful. But finally changing VideoCapture argument to full device path ("/dev/video0") helped.

dervan
- 26
- 1
- 3
-
You're right ! I was using cv::VideoCapture::open(int index)and it sometimes worked, sometimes not ... I followed your advice and used cv::VideoCapture::open(device_filename) and it seems to wrok 100% of time ! Thanks a lot :) – Steven Dec 02 '18 at 22:55
1