none
Axis IP camera using DirectShow

    Question

  • Hi,

    I'm working in development of a software that until now are using USB Webcams with DirectShow.

    Now we have to support IP cams, starting by Axis 207W.

    Axis provides a DirectShow source driver (AxisVideoCaptureDriverSetup.msi in Axis Support Page), easy to implement like any other webcam. Except the IAMVideoProcAmp that isn't supported by the driver, all things works well.


    But my software needs to know when it's an IP/Axis cam. I need to track IP address of all cameras then put it into a database.

    In Axis I set IP address in the Driver's Advanced Settings Page, that I call using ISpecifyPropertyPages. I can't get or set this value (the ip addr) programmatically in main application. I'm looking for an interface to do this.

    Do you know how can I do it?

    Thank you,
    Daniel Koch



    Thursday, March 12, 2009 7:45 PM

All replies

  • This is a proprietary interface, so you must get the interface definition and parameters from the vendor. Normally it is supplied in the vendor's SDK. 
    Michel Roujansky, http://www.roujansky.com
    Thursday, March 12, 2009 8:59 PM
    Moderator
  • Okay, it isn't so easy, I need to be member of Application Development Partner from Axis to have access to get this documentation.


    I think I need to create my own custom filter to get it, maybe I can use Axis MJPEG Decoder DMO to convert MJPEG stream to RGB24.

    My doubt is: Need I create a custom filter to do this?

    Because I've to deal with sockets, HTTP request/response (Axis is based in VAPIX).


    If don't, where can I found some library to work with HTTP/VAPIX inside filter? I think it will be hard to do working directly with sockets to do this.

    Thank you again,

    Daniel Koch
    Friday, March 13, 2009 3:36 PM
  • " I think I need to create my own custom filter to get it, maybe I can use Axis MJPEG Decoder DMO to convert MPEG stream to RGB24.

    My doubt is: Need I create a custom filter to do this?"

    Probably not, if they provide the decoder DMO, you should try to use it.

    Regarding the rest of your problem (configuring/getting info from the IP cameras), there is no reason to use DirectShow for this and go through a filter. Use the APIs directly from your app, it will be much, much easier.
    OK, it might be a little less clean than everything routed through DirectShow objects, but you will save an awful lot of time and effort...... IMHO

    Michel Roujansky, http://www.roujansky.com
    Friday, March 13, 2009 4:52 PM
    Moderator
  • But Axis MJPEG Decoder DMO is plugged in the graph after AXIS MJPEG Capture Driver.

    As you said, can I get frames from camera inside my application (not using DirectShow) and then put it directly to Axis MJPEG Decoder DMO without using the capture driver?

    Is it possible?

    Thank you,
    Daniel Koch
    Friday, March 13, 2009 5:24 PM
  • I did not say this.
    What I mean is  : use DirectShow to process the video, but try the other APIs directly from your app to control the camera.
    Michel Roujansky, http://www.roujansky.com
    Friday, March 13, 2009 10:53 PM
    Moderator
  • MSDN Library says: "Writing audio and video capture filters is no longer recommended. Instead, DirectShow provides automatic support for audio and video capture devices, using wrapper filters and the System Device Enumerator."

    Maybe this capture filter can be a wrapper filter.

    What wrapper filter can I use to do this?

    Thank you,
    Daniel Koch
    Monday, March 16, 2009 1:38 PM
  • Maybe this capture filter can be a wrapper filter.
    What wrapper filter can I use to do this?

    There is a mix of many [unrelated] things here.

    MSDN does not recommend writing fully featured capture devices because it provides stock capture filters that wrap devices available/implemented through underlying APIs. However this is not the case with IP cameras - there is no suitable API to implement camera through, and have some MS wrapper filter exposed it as a capture device. So it is most natural for IP camera vendor, or independent vendor who implements support for this kind of devices, to provide full capture device. This is what we see with Axis M-JPEG Capture Driver (alternatively, a proper google query will give you a number of alternate M-JPEG video source filters).

    Axis M-JPEG Decoder DMO - if it is what I can think of judging by its name - is a JPEG decoder, which takes a JPEG frame and outputs RGB and/or YUV uncompressed image. DMO (DirectX Media Object) is itself a simplified API, for which there is a wrapper (again!) filter from Microsoft, DMO Wrapper Filter. So you can use this DMO through a wrapper filter as an ordinary DirectShow transformation filter, or use DMO directly from your code outside of DirectShow graph.

    Mentioned filters exchange with JPEG frames, which are basically memory JPEG files. So you are free to choose the best way for you, whether to use these as DirectShow Filters, or capture JPEGs yourself and feed to M-JPEG DMO Decoder as a filter, or as a DMO, or capture using Axis filter and decode youself.


    http://alax.info/blog/tag/directshow
    Monday, March 16, 2009 9:21 PM
  • Roman,

    Thank you for the help.

    Yesterday I'd looked into your HTTP Stream Source Filter, which should be nice to my proposes, because it haves IHttpStreamSourceFilter, then I can set camera IP address programmatically in my application.

    But I haven't Intel IPP 6.0 library, then I can't use it with JPEG Decoder Filter.

    I've tried to use too your HTTP Stream Source Filter and JPEG HTTP Stream Parser Filter with Axis M-JPEG Decoder DMO, but pins are incompatible types.

    Then I'd looked to your code, and today I've created an Axis class that get image from camera using WinHttp.

    Now I need to create a filter that will wrapper this class and must be compatible with Axis M-JPEG Decoder DMO, furthermore creating something like IHttpStreamSourceFilter interface.


    I'd looked at google but I can't found a M-JPEG source filter with some interface like IHttpStreamSourceFilter.

    Do you know?

    Thank you,
    Daniel Koch
    Monday, March 16, 2009 10:24 PM
  • Yesterday I'd looked into your HTTP Stream Source Filter, which should be nice to my proposes, because it haves IHttpStreamSourceFilter, then I can set camera IP address programmatically in my application.

    But I haven't Intel IPP 6.0 library, then I can't use it with JPEG Decoder Filter.

    I've tried to use too your HTTP Stream Source Filter and JPEG HTTP Stream Parser Filter with Axis M-JPEG Decoder DMO, but pins are incompatible types.

    Then I'd looked to your code, and today I've created an Axis class that get image from camera using WinHttp.

    Now I need to create a filter that will wrapper this class and must be compatible with Axis M-JPEG Decoder DMO, furthermore creating something like IHttpStreamSourceFilter interface.

    I'd looked at google but I can't found a M-JPEG source filter with some interface like IHttpStreamSourceFilter.

    1. IHttpStreamSourceFilter is a custom/private interface specific to my DLL only, for example Axis has their private interface which is probably documented somewhere in their docs
    2. you don't need Intel IPP for capturing M-JPEG feed, only for decoding; also you can download Intel IPP demo from their website
    3. pins are most likely incompatible because of different FOURCC codes, mine is AIJ0, Axis uses a different one


    http://alax.info/blog/tag/directshow
    Monday, March 16, 2009 10:45 PM
  • Roman,

    Only members of Application Development Partner from Axis have access to get this documentation (if it exists).

    It's why I'm here.

    But it's okay, there isn't other way: I'm doing my own filter :)

     

    Thank you,

    Daniel Koch

    Tuesday, March 17, 2009 12:11 AM
  • Hello:

    May be this is useful (I don´t know).

    I was working also with Axis ip-cameras (a different model, I don´t remember exactly which one) some time ago and I had to retrieve and process also the M-JPEG stream. I think that all the ip-cameras from Axis implement zero-configuration feature, which can save you a lot of headaches with the ip address. I used it for detecting Axis ip-cameras regardless of their ip address. And concerning to the M-JPEG stream: I didn´t  use Directshow at all, I built my own parser that chopped the M-JPEG stream in JPEG frames, which in turn can be easily converted to RGB through DMO.  Well, I hope this gives you some ideas.

    Marcos.
    Tuesday, March 17, 2009 7:36 AM
  • Marcos,

    The zeroconf will be easy if all cameras are in the same network.

    How did you to send JPEG frames to Filter Graph without a capture filter?


    Thank you,
    Daniel Koch
    Tuesday, March 17, 2009 1:07 PM
  • How did you to send JPEG frames to Filter Graph without a capture filter?

    You don't need to use DMO as a filter. You can use it via its IMediaObject interface, just like DMO Wrapper Filter does.


    http://alax.info/blog/tag/directshow
    Tuesday, March 17, 2009 1:08 PM
  • "The zeroconf will be easy if all cameras are in the same network" 

    Yes, you are right.

    "How did you to send JPEG frames to Filter Graph without a capture filter?"

    I tried to implement my own push source filter to push the JPEG´s into the graph. There is a sample Source Filter in c:\Program Files\Microsoft SDKs\Windows\v6.1\Samples\Multimedia\Directshow\Filters\ . I used it as a reference, but since it became too complicated I gave up. However you could take a look , although I´m afraid that this approach is quite tedious.

    Marcos.
    Tuesday, March 17, 2009 2:31 PM
  • Does anyone have any axis capture code they would like to share?  It would be GREATLY appreciated.
    Saturday, December 07, 2013 2:59 AM