View Single Post
  #5   Spotlight this post!  
Unread 09-02-2016, 23:03
Turing'sEgo Turing'sEgo is offline
Registered User
no team
 
Join Date: Jan 2016
Rookie Year: 2010
Location: Boulder
Posts: 47
Turing'sEgo can only hope to improve
Re: OpenCV C++ Bad file descriptor. USB Lifecam

I figured it wouldn't make a difference but you never know.

Would you link to all your vision code so I can take a look at it and play around with it?

A fairly simple thing you could try would be to reinstall opencv through terminal:

sudo apt-get remove --purge opencv
sudo apt-get install libopencv-dev

This won't give you gpu support (I don't think at least), but it's better to have something than nothing.

Edit 1
I found your code on another thread.

A thing I found was that you declare videoCapture, then inside a while loop you say: videoCapture = cv::VideoCapture(); Seems a little redundant. I'm not sure this is the cause to your error or not. Moving on to the next line, videoCapture.open("http://axis-camera.local/mjpg/video.mjpg"); isn't wrong, but it may be incorrect to have it in a while loop....

Edit 2
I just tested calling .open(0) in a while loop. While it did run, it ran at <1fps. I also tested having videoCapture = cv::VideoCapture(); inside a while loop too, and all it did was further bog down the program.

Could you run in debugger mode and let me know which line is causing the error?

Edit 3
Giving this a little more thought: I am not rehearsed in IP cameras, so this could be completely off, but...
Would you test the following code for me? http://pastebin.com/6vrLBVtE

Last edited by Turing'sEgo : 09-02-2016 at 23:37.