简体   繁体   中英

Crash when trying to get Video Stream from IP Camera

I'm using C++ opencv 2.4.10 with QTCreator 3.3.0 (Based on QT 5.4.0) on ubuntu 14.04

I tryed to play the stream from the IP Camera's URL on VLC, it works fine. When trying to get video stream in the application, it crashes without any error in the output.

when reading from the webcam it works fine too, works also with a local mp4 file.

Here's the code:

Mat feed;
VideoCapture cap("http://IP_ADDRESS/video.cgi");
if(cap.isOpened())
{
  while(1)
  {
    cap>>feed; //it crashes when reaching this line
  }
}

I had the same problem in Qt. I had to use a Qtimer to view the frames instead of the 'while' loop.

I still have some issues with delay and picture issues when doing a lot of processing for recognition.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM