DirectShow Video Source Filter for JPEG and M-JPEG IP Cameras

This implements a DirectShow driver/wrapper over a HTTP based JPEG/M-JPEG streamed video, widely available with IP cameras. Once installed, it provides a Start Menu shortcut to manage video capture devices, where a user can add/remove devices. The devices are automatically registered with DriectShow and are available to applications.

The compatibility list includes:

  • Windows SDK AmCap Sample (reference)
  • VideoLan VLC
  • Skype (see below)
  • Google Talk Video Chat
  • Luxriot (as rather an example as Luxriot has its own generic JPEG/M-JPEG device driver, however this still demonstrates compatibility and interoperability of applications)
  • GraphEdit, GraphStudio and similar tools

For a created device it is required to configure:

  1. JPEG or M-JPEG resource URL on the device, where the driver will access video feed or sequential snapshots
  2. Image/video size on the device

Resource URLs vary from device to device and there is no standard identifier. This has to be looked up for specific model in device API reference or SDK. For JPEG snapshots it is possible to copy image shortcut from web browser and paste address into device settings.

Note that some devices, especially low end IP cameras deliver non-compliant feed which can be decoded either by manufacturer’s ActiveX control or model-specific implementation which this driver does not convert and is unlikely to ever cover. The driver will only work with hardware which honors industry standards.

For example, Stardot NetCam SC cameras make the video feed accessible using /nph-mjpeg.cgi resource, so the full URL will consist of protocol prefix “http://”, optional username and password (see screenshot above), IP address or host name e.g. “demo2.stardotcams.com”, resource identifier on the device “/nph-mjpeg.cgi”.

Hence, http://demo2.stardotcams.com/nph-mjpeg.cgi

It is necessary to provide video size of the footage in advance so that the driver could negotiate content media types without accessing the device. Future versions of the driver might implement auto-detection.

Skype Compatibility

To make the device work with Skype, it is necessary to:

  1. Configure the device (using its web interface) to work at resolution 640×480
  2. Add/configure device with Alax.Info IP video Source as described above, including setting of 640 by 480 pixel resolution in device configuration

Internals

Software implements and registers video input/capture devices, listed under DirectShow CLSID_VideoInputDeviceCategory category. The applications access devices from the list and treat as a regular device such as web camera.

Windows SDK AmCap sample will create the following DirectShow graph where the source filter implemented by this software:

Internally, software creates a worker filter graph in order to stream data from the device:

To decode video, software uses stock MJPEG Decompressor Filter provided with operating system.

Download Information

 

  1. Guest: I am a newbie to Directshow.
    I have an Axis P1347 IP camera and want to play it in Media Player. In fact, I need a DirectShow source filter which can decode JPEG stream to RGB stream available via directshow.
    Could you help me which of your work is suitable for me?

    First of all you can check Axis software, I am sure they provide a filter for this. You can use my filter http://alax.info/blog/1216 and I am pretty sure there are a number of filters available on the net.

    Guest: OK, they have provided , but it doessn’t work in Win 7

    You will need an URL which works for your camera to get M-JPEG stream. I think their API is here http://www.axis.com/files/manuals/VAPIX_3_HTTP_API_3_00.pdf page 29

  2. afshin.hamilton

    Dear Roman,

    Thanks for nice Directshow source filter, the only problem is that it works only with 32 bit applications but I have a 64 bit application and it did not accept it, could you also make the 64 bit version.
    Also as a suggestion if it can accept RTSP URLs I thenk it will be ideal.

Leave a Comment