Ask Your Question

Revision history [back]

Program works differently from IDE and from system

Using a simple code to open the camera:

// hardcoded for this time
string _pathToCam = "rtsp://192.168.2.2:554/user=admin&password=&channel=1&stream=0.sdp?real_stream--rtp-caching=100";
if (_pathToCam.length() > 1)
    vc.open(_pathToCam);
else
    vc.open(0);

if (!vc.isOpened())
{
    cerr << "Can't open stream!";
    return 1;
}

Using router for connect pc to cam. When I run the program from the IDE - program is operating normally, but when I run programm from system (by clicking at exe file), program can't open the camera. When I connect camera to pc without router - program is operating normally by running exe too.

SYSTEM = IDE = TRUE
IDE + ROUTER = TRUE 
SYSTEM + ROUTER = FALSE

What could be the problem?

Additional info:

  • Full Code: http://pastebin.com/xCX20BLq
  • OS: Windows 7 x64 Ultimate
  • OpenCV: 3.1.0
  • IDE: Visual Studio 2015 Community

P.S.: sorry for my english.