Menu

DirectShow Uncompressed

Help
2009-02-09
2013-02-21
  • Monte Owens

    Monte Owens - 2009-02-09

    The current version of VideoIO with DirectShow doesn't seem to support the creation of uncompressed AVIs.  Or at least I can't get it to work on my system.  Is this supported?

     
    • Gerald Dalley

      Gerald Dalley - 2009-02-09

      For most combinations of OS version, Matlab version, and DirectShow version, it should work.  What happens if you try the following:

      vw = videoWriter('foo.avi', 'codec',''); addframe(vw, rand(128)); close(vw);

       
      • Monte Owens

        Monte Owens - 2009-02-09

        It creates an AVI but the compression type is MS-WMV9

         
    • Gerald Dalley

      Gerald Dalley - 2009-02-10

      Thanks for identifying a bug.  I'm working on a quick patch. 

      In the mean time, you can try using the 'Vfw' plugin.  It should allow you to create uncompressed AVI files right now.

      % make a quick test video
      vw = videoWriter('foo.avi', 'plugin','Vfw', 'codec','');
      for i=1:30; addframe(vw, rand(128)); end; close(vw);
      % check to see that it's uncompressed (fourcc is "")
      vr = videoReader('foo.avi'); fprintf('fourcc: "%s"\n', get(vr, 'fourcc')); vr = close(vr);

       
    • Gerald Dalley

      Gerald Dalley - 2009-02-11

      Please verify that the r718 nightly build fixes the problems you've been experiencing with producing uncompressed AVI files (or post what problems still occur).

       
      • Monte Owens

        Monte Owens - 2009-02-11

        That seems to have fixed it.  Thanks. 

        I've dreamed for years of being able to write unlimited sized uncompressed AVIs in Matlab.  I thought about writing something myself years ago because I had written code using VFW, but DirectShow is so much more complex I never had the time.  Thanks for creating this toolbox!

         
        • Gerald Dalley

          Gerald Dalley - 2009-02-11

          No problem. 

          BTW, if you just want to avoid compression artifacts, you might consider one of the lossless codecs out there such as lossless JPEG, H.264 lossless, or HuffYUV.  These will make the read times much faster since your CPU can probably decode these much faster than your disk can read an uncompressed frame.  The three that I mentioned ship with ffdshow-tryouts (http://ffdshow-tryout.sourceforge.net/). 

          If you care about precise random seeks, you'll need to test them... I don't know if ffdshow's implementation of these codecs does precise seeks. 

          Note that if you use HuffYUV, note that it uses a YV12 or YUY2 colorspace (http://www.fourcc.org/).  Most video data is actually converted to one of these colorspaces by the camera or by the original codec, so this colorspace change may not actually result in any (additional) data loss.

           

Log in to post a comment.