Force MATLAB mmreader or avireader to use a different codec?
How do I force MATLAB functions to use a different 开发者_StackOverflowcodec when I need to play an AVI file? I am using windows7 and I find that indeo5 codec is not working properly because of the OS. All code works fine on XP.
Thanks!
If your question is about how to play an avi using a codec other than the one used to create it, you'll have to use some kind of image conversion software ( RAD video tools aka bink and smacker is popular and free ) to recompress the movie using the new codec. There may be some loss of video quality.
If your question is how to tell MATLAB to create an avi using a different codec, type help avifile
to see the full documentation.
If your problem is that MATLAB is choking on a codec it says it supports and if you're using 64 bit MATLAB, I've had this problem. The short answer, unfortunately, is that there are no 64 bit codecs that work with MATLAB. There are two workarounds, and they both suck. One is to install 32 bit MATLAB and use that when you need to access an avi. The other is to use some kind of image conversion software to convert your avi to an image stack, then load that with MATLAB.
(EDIT: In newer versions of MATLAB, you can use the VideoWriter object to write MP4 and other compressed formats in 64 bit windows)
精彩评论