VideoCapture blocked after loosing connection
Hi everybody,
I have this problem, I am using opencv 2.4.10 to read a rtsp stream.
I used the VideoCapture end everything is going fine.
The problem is that I need to handle connection lost and failure during the opening of the connection.
At the moment I have two similar problem:
1) When I am trying to open the stream ( cv::VideoCapture inputVideo("rtsp://..."); ) and the streaming server is not available the program stay blocked forever without any error message.
2) If during the reading of the stream the connection is lost the program stay blocked forever without any error message.
There is a way to handle this problem?
Cheers,
Yari
@yari this is a known problem with rstp streams in the VideoCapture interface. It just assumes that the stream is open and stable and gives limited streaming functionality. If you want to avoid that and have error handling, you are better off with a third party c++ package for the streaming handling.
Since you are using OpenCV2.4.10 the possibility is large that there is already some update that fixed this. First look at the latest 2.4 branch or the latest master branch, compile that one and see if it still exists.