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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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);
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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?
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);
It creates an AVI but the compression type is MS-WMV9
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);
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).
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!
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.