3.4.2 cannot open and create videos, but with 3.4.1 I can
I am using ArchLinux. My system just got updated to OpenCV 3.4.2-1. When I try to read or create a video, it outputs this error message:
python:15977): GStreamer-CRITICAL **: 18:19:37.484: gst_element_get_state: assertion 'GST_IS_ELEMENT (element)' failed Unable to stop the stream: Inappropriate ioctl for device
If I downgrade Opencv to 3.4.1-3 then it works fine.
I am using *XVID.
Running with export OPENCV_VIDEOIO_DEBUG=TRUE
[juanma@juanmahostname img_proc]$ export OPENCV_VIDEOIO_DEBUG=TRUE
[juanma@juanmahostname img_proc]$ python test_svm.py pat00100_2_fast15.avi
[ WARN:0] VIDEOIO(createGStreamerCapture(filename)): trying ...
(python:11745): GStreamer-CRITICAL **: 09:24:32.751: gst_element_get_state: assertion 'GST_IS_ELEMENT (element)' failed
[ WARN:0] VIDEOIO(createGStreamerCapture(filename)): result=(nil) isOpened=-1 ...
[ WARN:0] VIDEOIO(cvCreateCameraCapture_V4L(filename.c_str())): trying ...
Unable to stop the stream: Inappropriate ioctl for device
[ WARN:0] VIDEOIO(cvCreateCameraCapture_V4L(filename.c_str())): result=(nil) ...
[ WARN:0] VIDEOIO(cvCreateFileCapture_Images(filename.c_str())): trying ...
[ WARN:0] VIDEOIO(cvCreateFileCapture_Images(filename.c_str())): result=(nil) ...
[ WARN:0] VIDEOIO(createMotionJpegCapture(filename)): trying ...
[ WARN:0] VIDEOIO(createMotionJpegCapture(filename)): result=(nil) isOpened=-1 ...
[ WARN:0] VIDEOIO(createGPhoto2Capture(filename)): trying ...
[ WARN:0] VIDEOIO(createGPhoto2Capture(filename)): result=(nil) isOpened=-1 ...
[ WARN:0] VIDEOIO(cvCreateVideoWriter_GStreamer (filename.c_str(), fourcc, fps, frameSize, isColor)): trying ...
(python:11745): GStreamer-CRITICAL **: 09:24:32.792: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed
[ WARN:0] VIDEOIO(cvCreateVideoWriter_GStreamer (filename.c_str(), fourcc, fps, frameSize, isColor)): result=0x564e3cfc57d0...
export OPENCV_VIDEOIO_DEBUG=TRUE
, and run your prog again ? (it should show, in which order the various video backends are tried) append the output to your question, please.Also running 3.4.2 on Arch. I get the following output:
After this it calls
cvCreateFileCapture_Images
,createMotionJpegCapture
, andcreateGPhoto2Capture
in that order, with similar results as the last and third-to-last lines. Appending that output would exceed the max comment length.@berak I have updated my post with what you suggested
@sverona if you need it urgently, downgrade to 3.4.1
how did you folks install that ? are you sure, the same gstreamer / plugins setup was used for building cv2.so and running on your boxes ?
(we can't help much with prebuilt (not maintained from opencv) packages)
@berak in my case everything was installed from Arch Linux package manager (pacman).
"gst_element_get_state: assertion 'GST_IS_ELEMENT (element)'" -- that's usually a problem with gst plugins (verson) .
you should complain with the maintainer of that package, if there was a regression with 3.4.2.
@berak thanks I have created a bug in archlinux
I have the same problem on Ubuntu 18.04 with Opencv 4.0 with a C++ program. all the gstreamer libraries needed should be installed.