Ask Your Question

Open RTSP stream results in an error.

asked 2013-04-11 08:46:15 -0500

arjanhgroen gravatar image

updated 2013-04-11 08:47:13 -0500


I am trying to access the RTSP stream from my Bosch IP cam. I have checked if I can open the stream in ffplay and VLC. It works in both.

I receive the following error: warning: Could not find codec parameters (../../modules/highgui/src/cap_ffmpeg_impl.hpp:540). The camera is streaming with a h264 codec.

I am working in windows with a self compiled version of OpenCV 2.4.5. I also tried MPEG-4 SH++ as coded but same error message.

Does anybody have an idea what could be the error?


    CvCapture *camera = cvCreateFileCapture("rtsp://");

if (camera == NULL) {
    printf("camera is null, aborting...");
    return -1;

IplImage *img = cvQueryFrame(camera);

cvNamedWindow( "myWindow", CV_WINDOW_AUTOSIZE );
cvShowImage( "myWindow", img );
edit retag flag offensive close merge delete


Rui Marques gravatar imageRui Marques ( 2013-04-12 04:43:42 -0500 )edit

Thanks, I didn't know about that option! This would be a backup for when don't get the stream working.

arjanhgroen gravatar imagearjanhgroen ( 2013-04-12 09:25:44 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2013-04-11 08:57:51 -0500

Please next time look at the open topics first. A same problem was solved just like 10 topics ago:

Also try first using prebuilt binaries. That way you can be sure that it is not a building problem.

edit flag offensive delete link more


I am using 2.4.5 and still have a issue. I also tried the 2th answer in that topic.

arjanhgroen gravatar imagearjanhgroen ( 2013-04-11 09:11:14 -0500 )edit

I am guessing then that your h264 codec used is not supported by ffmpeg which seems a bit weird. To be just sure. Download the latest ffmpeg version on yourself and build openCV again. Could be that there is still an older ffmpeg version inside openCV contained.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-04-11 09:40:07 -0500 )edit

I have tried the prebuilt binaries. Same issue. I have found the ffmpeg folder in source, I will try to update the ffmpeg library tomorrow and compile OpenCV again. I will let you know

arjanhgroen gravatar imagearjanhgroen ( 2013-04-11 09:49:11 -0500 )edit

I tried to include the newest FFMPEG but had some issues with building it. I am going to try to run it from a Ubuntu machine, and if that works crosscompile it. I will post a update next week

arjanhgroen gravatar imagearjanhgroen ( 2013-04-12 09:26:59 -0500 )edit

I have compiled OpenCV with the most recent FFMPEG on Ubuntu, I can open the RTSP stream now. I will try to get it working on Windows and post the answer here.

arjanhgroen gravatar imagearjanhgroen ( 2013-04-15 02:21:32 -0500 )edit

Nice progress =)

StevenPuttemans gravatar imageStevenPuttemans ( 2013-04-15 08:15:59 -0500 )edit
Login/Signup to Answer

Question Tools


Asked: 2013-04-11 08:46:15 -0500

Seen: 8,239 times

Last updated: Apr 11 '13