PDA

View Full Version : Initializing IP Cameras Using DirectShow



couvill
February 9, 2007, 23:13:48
Hi:

I'm writing a C++ DirectShow app in Visual Studio.NET. I'm trying to construct a graph with an MVIPCameraSource filter, connected to an MVMJPEGDecompressor, the output of the latter to go to a samplegrabber filter.

I've created filters using CoCreateInstance, and then gotten the IMVIPCameraSource interface using IBaseFilter::QueryInterface. I use that to set the URL of the camera to the same value I used in the WorkBench graph, which does display an image.

Unfortunately, when I go to connect the output pin of the IPCameraSource to the MJPEGDecompressor, I get an error. I suspect that this is because the camera's not initialized. The documentation says to call IMVIPCameraSource::Initialize, but Visual Studio doesn't see that method. I can call IMVIPCameraSource::Reconnect, but that doesn't seem to do any good.

Does setting the URL initialize the camera filter, like it does in the workbench? If not how do you initialize IP cameras? Why doesn't VisualStudio see the Initialize method?

Has anybody else had this problem? Any help would be appreciated.

Marc Cymontkowski
February 10, 2007, 18:36:08
Hi,

You're right, this is a bit confusing. put_URL actually initializes the filter. Make sure to provide the real URL to the MJPEG stream like http://123.123.123.123/axis-cgi/video.cgi for some AXIS cameras.


Best Regards,

Marc Cymontkowski

couvill
February 12, 2007, 15:03:54
Thanks. The URL used in the Workbench app is:
129.162.129.217/axis-cgi/mjpg/video.cgi?camera=%resolution=640x480

In my program, should I put in that full URL, or set the CGI/Image File and CGI Parameters separately, using those put_* methods? I've tried both way, and still I can't get the camera source filter to connect to the mjpeg decompression filter.

How long does initialization take? Immediately after setting the URL, I create the mjpeg decompressor and try to connect them. Is this too soon?

Marc Cymontkowski
February 12, 2007, 16:28:02
Please contact support@montivision.com for an updated MV IP Camera Source Filter. It is a bit easier to handle since it only returns from put_URL once the camera is initialized.

Marc