-
-
Notifications
You must be signed in to change notification settings - Fork 55.8k
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
OpenCV 3.1.0 simple VideoCapture and waitKey crashes after a while on OS X 10.11.2 #5874
Comments
I can confirm issues with waitkey crashing frequently on OS X. |
Please add result of |
Attached |
Thanks! |
I'm seeing a similar problem with a similar program and what I thought was the Cocoa backend. A slightly censored file is attached with the output from cv::getBuildInformation() and the stacktraces. One thing I noticed is when I step through in a debugger is I get breakpoints triggered at constant locations in cap_qtkit.mm. Line 335 always triggers twice, then line 299 triggers twice, then 435 triggers once, then the program works as intended. edit: osx 10.10.5, opencv commit version 92387b1 |
@kesinger Thanks for information! QT framework is not used in your build, but problem is still here. Looks like, both QTKit capture + cv::waitKey are required to reproduce this bug. |
Hi, I am also have the same issue, The error occurs after a couple of minutes my video capture c++ program. I even tried on a simple video capture program, and it repeats the same error. |
Same install as OP, same stack trace, same problem. I did not see this in OpenCV 3.0. However, I also upgraded to 10.11 (El Capitan) near same time (which now I regret - SIP in OS X complicated the build process for latest versions of OpenCV+CUDA/cuDNN+Caffe w/Python2.7). |
I'm using Yosemite 10.10, and I just downgraded to 3.0.0 and works pretty good. I need to run the program for longer period of time to see. But at the moment everything seems fine. |
Reverting to 3.0 also solved the problem for me under OSX 10.11. |
Also experiencing this problem with OpenCV 3.1.0, OSX version 10.11.2. |
Same problem with OpenCV 3.1.0, OSX version 10.11.2. Not using cv::waitKey(). |
Same problem with OpenCV 3.0.0, OSX version 10.11.2. Not using cv::waitKey(). Should I be? |
Found this in: "opencv-3.1.0/modules/videoio/src/cap_qtkit.mm" This looks like it runs about 100sec then looks for nil and sends it doFireTimer:. on a site called fossies.org, the same line has "capture" as a target. |
I can confirm consistent crash exactly 100 seconds after starting my program. I also have OS X 10.11.2 and OpenCV 3.1.0 using the VideoCapture class. |
This code doesn't make sense to me: The first line : " [NSTimer scheduledTimerWithTimeInterval ... " adds a timer to the current run loop, which isn't created until the while loop is executed. The "while" loop creates run loops to act essentially like sleep(). I don't think run loops act that way. [NSThread sleepForTimeInterval:] might work if there is a separate thread running. Also, if the timer is needed, it should be invalidated when no longer needed, and fixed so it references a valid object. |
There is a patch for file cap_qtkit.mm between OpenCV 3.0.0 and OpenCV 3.1.0: @mron Could you try to use dummy cv::waitKey call (OpenCV 3.0.0):
|
I'm very new to opencv and github, so please bear with me. I did try putting the waitKey() call in. The timer still fires and crashes. Changing "nil" to "capture" will not help unless a "doFireTimer:" method is added to the capture's ( CaptureDelegate? ) class. I'm also new to objc.. sorry. |
@rtielking did you fix this? I timed the code, and it crashes in exactly 100 seconds. |
yes i was able to fix the crash at 100sec by commenting out the following line [NSTimer scheduledTimerWithTimeInterval:100 target:capture selector:@selector(doFireTimer:) userInfo:nil repeats:YES]; in the /modules/videoio/src/cap_qtkit.mm file and recompiling |
@rtielking I believe I installed OpenCV through Homebrew + Luarocks - how would I recompile it manually? |
Download the source at https://github.com/Itseez/opencv/archive/3.1.0.zip brew install cmake Then it should work for you on the mac. |
@rtielking following these instructions should theoretically allow my program to know which OpenCV version to use right? Should I remove my existing OpenCV installation first? |
Might be a good idea to remove existing installation first just to be sure. I always built from source, so don't know where brew puts things when it installs. |
@rtielking I compiled it.. commented out the line with the |
I was able to recompile with the line commented out. The crashes have stopped. I did have the same problem of Xcode using the old framework. I'm not sure exactly how I got Xcode to use the new library. I "make uninstall" on both 3.0 and 3.1, deleted both 3.0 and 3.1 frameworks, "make clean" on both 3.0 and 3.1. In Xcode I did Project->Clean and deleted "Derived Data" folder and removed the framework reference. Rebuilt 3.1, rebuilt the framework, add the framework. The changes were then used and new changes show up as I make them. |
Having the same issue |
Same issue here. Reverting to 3.0.... |
Could someone check this fix: #6051? |
Same error and same stack trace here. Did the following: |
thanks mateuszmikusz and LukasKalinski (and everyone) ... i've just updated my SO answer with your better advice |
patch contains upstream commit opencv/opencv@a2bda99 which fixes opencv/opencv#5874
patch contains upstream commit opencv/opencv@a2bda99 which fixes opencv/opencv#5874
Hi guys. Thank you for all the advices. I reinstall the opencv yet I still have the problem. Im running Yosemite version 10.10.5 and I also install opencv_contrib. Any suggestions? Or perhaps downgrading is the only way to go. How to downgrade it? Thank you |
I’m not familiar with github enough to help. Maybe send a more descriptive message about your install procedure and someone with more understanding can help.
|
I am using this (https://github.com/Itseez/opencv_contrib) to install. Oh and initially i use this (https://www.youtube.com/watch?v=U49CVY8yOxw) to install openCV 3.1.0 on Mac. I am not sure whether the openCV installed this way is removed when using |
hi, is this issue already solved? |
Same problem, after a few captures the opencv crashes. I am using python bindings in Mac. This makes video capture unusable. I have to rely on some other frameworks to do the job. |
any fixes for python bindings ? Deleting derived data is irrelevant in this case unfortunately.. cheers. |
I have same problem in Sierra 10.12. v3.1.0 installed from anaconda |
There was a very simple fix that was never folded into the main branch. Look back into the bug history and you'll find it.
Ron
… On Dec 31, 2016, at 7:39 AM, Afif Hendrawan ***@***.***> wrote:
I have same problem in Sierra 10.12. v3.1.0 installed from anaconda
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Having this same problem on OSX 10.10.5. Any update on the fix? |
Wow,
It was never folded in?
Ron
… On Feb 23, 2017, at 7:42 PM, Johnnie Kearse III ***@***.***> wrote:
Having this same problem on OSX 10.10.5. Any update on the fix?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Having the same problem on OSX 10.11.5 . I am using the python interface for opencv2 |
Bumping the issue. By any chance could this be reopened so that a fix can happen to the repo? |
I know this was “fixed” over a year ago. I didn’t know github and how it works to pursue getting the fix folded into the main line of the code.
Ron
… On Mar 8, 2017, at 7:34 AM, Johnnie Kearse III ***@***.***> wrote:
Bumping the issue. By any chance could this be reopened so that a fix can happen to the repo?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#5874 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AEnvt8dQKK7ReubCjo6JzexIEIQZ7hDbks5rjsp4gaJpZM4G7JnK>.
|
I use Anaconda for Python and Opencv on my Mac. How shall I recompile if that's the case? |
How did you download OpenCV?
Ron
… On Jun 13, 2017, at 2:52 AM, nuksss ***@***.***> wrote:
I use Anaconda for Python and Opencv on my Mac. How shall I recompile if that's the case?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
in anaconda prompt, type in: conda install -c menpo opencv3 according to this website: |
I created #8931 so hopefully it can actually be fixed. :-) |
This issue still occurs. OSX 10.12.5 with python 2.7.13 and python-opencv2 |
me too. |
Is someone looking at this issue? |
If you're still having this problem with the latest release say so on #8931 |
OpenCV 3.1.0 is installed through
brew install opencv3 --with-contirb --with-qt5
and the following program crashes after a while:The stack trace is the following:
The text was updated successfully, but these errors were encountered: