-- JonathanKarpick - 21 Jul 2005

Recently, I've been frustated with MATLAB's movie making capabilities - it generates HUGE avi's or avi's with fairly horrible quality compression.

Best solution I've found is to use ffmpeg, a freely available mp4 encoder (among other things...) A version for windows is attached to this page.

In MATLAB, the commands to generate a movie are then:

max_time = something;
FPS = something;
timeframes = floor(max_time*FPS)+1;
h = figure();
time=0;
videoname='test video';

for i=1:timeframes
    plot(something);
    F(i) = getframe(h);
    time = time + 1./FPS;
end
movie2avi(F,'test.avi','compression','None','fps',FPS,'quality',100,'videoname',videoname)
clear F
!ffmpeg -i test.avi test.mp4
!del test.avi
you just need to ensure that ffmpeg is in the windows (not Matlab) path...

I've also had some issues with these movies looking funny in Windows Media Player (the colors were offset from their intended positions...) This may be a codec issue specific to me, but using Quicktime instead works fine.

  • ffmpeg.exe: ffmpeg v0.4.9 - built on Feb 22, 2005

 
This site is powered by the TWiki collaboration platformCopyright &© by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback