cv::VideoCapture of RTSP stream claims to be open when connection is refused (Bug #3867)
Description
OpenCV version: 3.0 built from git repo
OS: Ubuntu 14.04
Compiler: Gcc 4.8.2
I use the following code to create a video capture object of an RTSP stream based on a server on my network.
@ try
{
m_cam = new cv::VideoCapture(m_address);
}catch(cv::Exception &e)
{
emit log("Failed to open RTSP stream at: " + QString::fromStdString(m_address));
return -3;
}
if (!m_cam->isOpened())
{
emit log("Failed to open RTSP stream at: " + QString::fromStdString(m_address));
return -3;
}else
{
emit log("RTSP stream opened at: " + QString::fromStdString(m_address));
}@
Sometimes the server works and sometimes it doesn't. When it doesn't work, I get the following error at the command line:
[tcp
0x2432c40] TCP connection to 10.0.0.12:8554 failed: Connection refused@
However none of the checks above indicate that there is an issue, and then my program hangs when I try to read a frame.
The object clearly knows that the connection has been refused, thus at the very least isOpened() should return false.
Related issues
related to Bug #3880: New VideoCapture is broken | Done | 2014-08-23 |
Associated revisions
Merge pull request #3867 from RafaRuiz:patch-1
History
Updated by Philipp Hasper over 10 years ago
Hi Daniel, please try again with the current master branch. The VideoCapture class had a (now fixed) bug which was most likely the reason for your issue.
Updated by Dmitry Retinskiy over 10 years ago
Daniel, please check if the problem is resolved with the Philipp's fix.
- Category set to imgproc, video
- Assignee set to Daniel Moodie
Updated by Daniel Moodie about 10 years ago
Sorry I've changed jobs and no longer have access to the same rtsp server to test this.
- Status changed from New to Cancelled