1

I'm working on encoding raw images into avi file on windows possibly using directshow filter. The type of codec used will be selected by user. I've already done a similar thing using video for windows (VFW) which was pretty as it provide simple api to compress the data and write it to a file. This time i want to do this using directshow framework to provide directshow support.

However while checking on MSDN I found there different types of filters for different codecs, so there is no single interface. http://msdn.microsoft.com/en-us/library/windows/desktop/dd375464(v=vs.85).aspx Do I need to switch between different filters each time I switch codec.

Also how DMO is different from Directshow as per MSDN they too can be used for encoding. http://msdn.microsoft.com/en-us/library/windows/desktop/ff819088(v=vs.85).aspx

So which should I use to support maximum number of codecs?

Please share you thoughts.

Hamed
  • 1,175
  • 3
  • 20
  • 46
praks411
  • 1,972
  • 16
  • 23

1 Answers1

3

Different codecs are available with different interfaces because over the course of API developments where have been several APIs.

  • there are Video for Windows VCM video encoders
  • there are video encoding DMOs
  • there are video encoding MFTs (some are possibly dual DMO/MFT objects)
  • there are video encoding DirectShow filters

So the math is that in DirectShow you have most encoders available out of the box.

Other factors like codec specificity and applicability, encoding/container constraints, and the fact decent encoders are not typically freely available - this all seriously limits the use and value of approach when you design an app in a way that it can work with various video encoders of user choice, through standard well known interface/API.

Roman R.
  • 68,205
  • 6
  • 94
  • 158
  • Hi Roman, Thanks for the your inputs I've taken directshow way, by starting with PushSource filter, However I'm not able to pass the frame to the filter each when I receive it. The pushsource filter describe in the sample works by first loading all the image in the memory and then running filter graph. However in my case I want to pass frame be frame to the filter in a loop. – praks411 Sep 06 '13 at 08:28
  • My point is that nevertheless DirectShow offers widest choice of encoders, you would typically not want this flexibility. Instead you want one or a few that work reliably well. And this does not have to be DirectShow at all, although DirectShow makes perfect sense. – Roman R. Sep 06 '13 at 08:32
  • As for PushSource... it demos delivery of a sequence of synthesized video frames, typically from a pool of buffers of pre-agreed media type/format. This is typically compatible with available video encoders, esp. in case of raw uncompressed video. – Roman R. Sep 06 '13 at 08:37
  • Ok, I think I'll take more time to analyse before jumping to implementation. In any case I have one implementation with ffmpeg and other with VFW, both are working fine from encoding but still there is requirement to add Directshow encoder. I think I'll need to discuss more about this internally, as to what extra value addition we are doing by adding directshow. Thanks for your inputs. – praks411 Sep 06 '13 at 10:10