Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
Kate J.
Posts:
161
Registered:
6/9/11
|
|
Matlab-generated animation files not playing
Posted:
Feb 7, 2013 10:33 PM
|
|
I have an m-file script that reads in an .out format file and creates an animation from the data. The problem is that, although this output animation file *is* created, each time I try to play the output animation file, I get the error message:
?Your computer is running low on memory. Close other programs and try again.?
Given that I?m only creating small (< 4 MB) animation files, I don?t understand why this error message occurs; I don?t have an excessive number of applications open, and even if close Matlab, I still get the error message above. I?m thinking that there must be something wrong with these animations being generated by my script below; when I generate them on a different computer using the same script, the resultant animations play ok by themselves (i.e. in Windows Media Player), but if I try to insert the animation into a Powerpoint presentation (which is the ultimate intent), the display is extremely choppy, grainy, and otherwise of low quality. There is definitely a problem with the animations that the script below is generating.
My simplified Matlab m-code: (assume that any variable used below has been assigned a valid value)
---------------------------------------------------------------------- load data.out;
nFrames = 20; % Preallocate movie structure. mov(1:nFrames) = struct('cdata', [],'colormap', []); k = 1;
for i=startVal:endVal
set(plot(x,y,'b',x,y,'bo', xtarget, ytarget, 'gx'),'LineWidth',3);
targetZone = line(xtarget,ytarget,'LineStyle','none','Marker','o','Color',... 'g','MarkerSize',14);
set(text(0.4,0.6,time), 'FontWeight', 'bold', 'FontName', 'Arial', 'Color', [0,0,0]); myMovie(k) = getframe(gcf); k = k+1; drawnow; end
movie2avi(myMovie, 'myAnimation.avi', 'compression', 'Indeo3'); ----------------------------------------------------------------------
Note that in developing the above script, I tested all allowed values for the final argument in the call to movie2avi(); I found that only 2 of them work (?Indeo3? and ?Cinepak?), but since the ?Cinepak?-generated animations were about 2x the size of the ?Indeo3?-generated animations, I decided to use the latter.
Thanks in advance for any insights about what might be wrong with my animation-creation script above, such that the resulting animation .avi files won?t play.
|
|
|
|