Ask Your Question
0

3.4.2 cannot open and create videos, but with 3.4.1 I can

asked 2018-07-09 12:31:05 -0600

the_phet gravatar image

updated 2019-03-30 02:54:50 -0600

LBerger gravatar image

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...
edit retag flag offensive close merge delete

Comments

  • python -- how did you install that ?
  • can you try to 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.
berak gravatar imageberak ( 2018-07-09 12:34:35 -0600 )edit

Also running 3.4.2 on Arch. I get the following output:

[ WARN:0] VIDEOIO(createGStreamerCapture(filename)): trying ...
(python:2104): GStreamer-CRITICAL **: 15:42:26.532: 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) ...

After this it calls cvCreateFileCapture_Images, createMotionJpegCapture, and createGPhoto2Capture in that order, with similar results as the last and third-to-last lines. Appending that output would exceed the max comment length.

sverona gravatar imagesverona ( 2018-07-09 15:46:58 -0600 )edit

@berak I have updated my post with what you suggested

@sverona if you need it urgently, downgrade to 3.4.1

the_phet gravatar imagethe_phet ( 2018-07-10 03:27:15 -0600 )edit

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 gravatar imageberak ( 2018-07-10 03:33:39 -0600 )edit

@berak in my case everything was installed from Arch Linux package manager (pacman).

the_phet gravatar imagethe_phet ( 2018-07-10 04:22:05 -0600 )edit

"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 gravatar imageberak ( 2018-07-10 04:25:15 -0600 )edit

@berak thanks I have created a bug in archlinux

the_phet gravatar imagethe_phet ( 2018-07-10 05:07:12 -0600 )edit

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.

fra gravatar imagefra ( 2018-10-02 03:30:45 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2018-07-23 09:32:23 -0600

sverona gravatar image

The Arch bug report mentioned in the above comments is located here.

Installing gst-libav corrects the error.

edit flag offensive delete link more

Comments

Is there any solution for the same problem on Ubuntu 18.04?

fra gravatar imagefra ( 2018-10-02 03:31:25 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-07-09 12:31:05 -0600

Seen: 4,917 times

Last updated: Jul 23 '18