From: Tim on 1 Aug 2010 08:53 Problem: The default compression method for movie2avi is Indeo5. However, by default, Windows 7 does not include Indeo5 (nor most other codecs). So, when using the simplest implementation of movie2avi [e.g. movie2avi(mov, filename);] we get the following warning: Warning: Cannot locate Indeo5 compressor, using 'None' as the compression type. See Mathworks Technical Solution 1-4G50RI for more information. In short, Technical Solution 1-4G50RI suggests: 1) use a patch (for Windows XP users) 2) use a workaround: movie2avi(mov, filename, 'compression', 'Cinepak'); These solutions do not work for default Windows 7 installations: the 1st solution is a patch for XP (not Windows 7) and the 2nd solution requires the user to use Cinepak which also is not available on Windows 7. The only "out of the box" way to use mov2avi is to use 'none' compression [e.g. movie2avi(mov, filename, 'compression', 'none');] but doing so obviously prevents us from compressing the file (MATLAB doesn't allow using RLE or MSVC encoding for truecolor images). This can be a problem since uncompressed avi files get big very quickly, especially with large frame sizes. We have found a very quick and easy solution to this problem using "ffdshow". Our solution produces a warning: (Warning: Not a supported compression method.), but it works. We are posting the solution here in the hopes that others will find it useful (searching online for a solution turned up many people with the same problem). Solution: Download and install ffdshow: (http://sourceforge.net/projects/ffdshow-tryout/files/) Note that we are using 64 bit Windows 7 and used the 64 bit version of ffdshow (we didn't try the 32 bit version so it might not work). In the call to movie2avi(), use FFDS as the compression type as in: movie2avi((mov, filename, 'compression', 'FFDS'); That's it. With that, you get a decently compressed file. Below we give an example. The FFDS compression in this example generates a 856Kb file as opposed to a 265MB(!) file that would be generated without compression. Note that the avi file size is screen size dependent in this example. NUMBER_OF_FRAMES = 100; filename = 'mymovie.avi'; scrsz = get(0,'ScreenSize'); myfig=figure('Position',[1 1 scrsz(3) scrsz(4)]); %make the frame size fixed figure(myfig); for x=1:NUMBER_OF_FRAMES y = sin(x); plot(x,y, '.b', 'LineWidth', 2); hold on; axis equal; %not necessary but easier to follow the sin() video visually mov(x) = getframe(myfig); end; movie2avi(mov, filename, 'compression', 'FFDS');
|
Pages: 1 Prev: solutions manual Next: spectrum of laplacian of graph _urgent |