Ask Your Question

the_phet's profile - activity

2019-07-14 00:32:48 -0600 received badge  Notable Question (source)
2019-07-12 08:59:03 -0600 asked a question Python, when making a video it seems to ignore the set FPS

Python, when making a video it seems to ignore the set FPS I have the following code, which it just created a video of a

2019-03-30 01:46:31 -0600 received badge  Popular Question (source)
2018-07-24 04:06:44 -0600 marked best answer 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...
2018-07-23 06:14:33 -0600 commented answer Last OpenCV update (3.3.1) makes my videos faster

@tetragramm its been some time, but I never got to fix this. setting waitkey to just 1 still makes the videos a 33% fast

2018-07-10 05:07:12 -0600 commented question 3.4.2 cannot open and create videos, but with 3.4.1 I can

@berak thanks I have created a bug in archlinux

2018-07-10 04:22:05 -0600 commented question 3.4.2 cannot open and create videos, but with 3.4.1 I can

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

2018-07-10 03:27:15 -0600 commented question 3.4.2 cannot open and create videos, but with 3.4.1 I can

@berak I have updated my post with what you suggested @sverona if you need it urgently, downgrade to 3.4.1

2018-07-10 03:26:35 -0600 edited question 3.4.2 cannot open and create videos, but with 3.4.1 I can

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

2018-07-10 03:26:35 -0600 received badge  Editor (source)
2018-07-09 12:31:05 -0600 asked a question 3.4.2 cannot open and create videos, but with 3.4.1 I can

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

2018-01-11 05:41:09 -0600 commented question After using a mouse callback (python) matplotlib fails to open

@berak before using destroyWindow I was using destroyAllWindows, which also returned the same error.

2018-01-11 05:28:11 -0600 asked a question After using a mouse callback (python) matplotlib fails to open

After using a mouse callback (python) matplotlib fails to open I have the following class which I use to read clicks fro

2017-11-03 11:37:35 -0600 commented question Last OpenCV update (3.3.1) makes my videos faster

@tetragramm Always aiming for a video of 20 seconds. Using 3.3.0 it writes 614 frames. In VLC it produces a video of 20

2017-11-02 04:53:11 -0600 commented question Last OpenCV update (3.3.1) makes my videos faster

@Tetragramm If I produce a video with that script in 3.3.0, and then I play it with VLC, it will be 20 seconds (as expec

2017-11-02 04:50:36 -0600 received badge  Enthusiast
2017-11-01 07:10:22 -0600 asked a question Last OpenCV update (3.3.1) makes my videos faster

Last OpenCV update (3.3.1) makes my videos faster I have the following code, which just makes videos from a camera. The

2013-11-28 12:09:38 -0600 asked a question houghcircles max radius seems to be off

I am using the Python bindings, and using HoughCircles to detect circles. The code seems to be working OK, but I have detected that there seems to some offset between the max radius parameter and the radius of the circle returned.

For example, I set max radius to 275, and it is not returning anything. I set max radius to 300, and it returns me a circle with a radius of 240, as expected.

This is the way I call it:

circles = cv2.HoughCircles( cimg, cv2.cv.CV_HOUGH_GRADIENT, 2, 60, param1=50, param2=100, minRadius=200, maxRadius=275)

As said, the maxradius seems not to match exactly the radius of the circles

2013-07-08 05:05:42 -0600 answered a question WebCam won't open since 2.4.6

Same problem, my code has been working for a year and now it is not working anymore.

import cv, cv2

vc = cv2.VideoCapture(1)
cv2.namedWindow("video")
vc.set(cv.CV_CAP_PROP_FRAME_WIDTH, 640)
vc.set(cv.CV_CAP_PROP_FRAME_HEIGHT, 480)

while(1):
    ret,frame = vc.read()
    cv2.imshow("video",frame)
    #print len(frame)
    key =  cv2.waitKey(30)

This code was always working, now I get:

python2 play_cam.py 
OpenCV Error: Assertion failed (size.width>0 && size.height>0) in imshow, file /build/opencv/src/opencv-2.4.6/modules/highgui/src/window.cpp, line 269
Traceback (most recent call last):
  File "play_cam.py", line 10, in <module>
    cv2.imshow("video",frame)
cv2.error: /build/opencv/src/opencv-2.4.6/modules/highgui/src/window.cpp:269: error: (-215) size.width>0 && size.height>0 in function imshow
2013-07-08 05:02:06 -0600 received badge  Supporter (source)