Streaming over RTSP (Bug #3494)

Added by Matheus Castro Rocha over 3 years ago. Updated almost 2 years ago.

Status:Incomplete Start date:2014-01-21
Priority:Normal Due date:
Assignee:Matheus Castro Rocha % Done:


Target version:Next Hackathon
Affected version:2.4.0 - 2.4.7 Operating System:Windows
Difficulty:Easy HW Platform:x64
Pull request:


Hello guys !

I have been trying to access an IP Camera through RTSP in Visual Studio 2012. Here is my code:

VideoCapture cap("rtsp://IP_ADRRESS/play1.sdp/?tcp");

if (!cap.isOpened()) {
cout << "Cannot open the video file" << endl;
return -1;
double dWidth = cap.get(CV_CAP_PROP_FRAME_WIDTH); double dHeight = cap.get(CV_CAP_PROP_FRAME_HEIGHT); cout << "Frame size : " << dWidth << " x " << dHeight << endl;


while (1) {
Mat frame;

bool bSuccess =; 
cout << "esc key is pressed by user" << endl;
if (!bSuccess) 
cout << "Cannot read a frame from video file" << endl;
imshow("MyVideo", frame);
if (waitKey(30) == 27)

When I run it in debug mode, it works just fine, but when I run it in realese , it doesn't work. Any ideas ?
I was able to access the camera using only ffmpeg.

if i didn't post any useful informantion, let me know !

Thanks a lot !


Updated by Andrew Senin over 3 years ago

Matheus, thank you for posting this issue!

Could you please let us know what version of OpenCV you use? If it is not the latest - please try with the latest. Also, please describe how it does not work (crash or no image etc.).

Since our resources now are limited it would be greatly appreciated if you could try to debug this issue locally and send as a fixing push request. You can find all details here:

Thank you

  • Target version set to Next Hackathon
  • Category set to highgui-camera
  • Difficulty changed from Hard to Easy
  • Priority changed from High to Normal
  • Assignee set to Matheus Castro Rocha
  • Status changed from New to Incomplete

Updated by Maksim Shabunin almost 2 years ago

Issue has been transferred to GitHub:

Also available in: Atom PDF