Re: MATLAB avi file compressions
- From: Scott <no@xxxxxxxx>
- Date: Thu, 21 Jun 2007 17:54:50 -0400
Matt wrote:
on
bump
Matt wrote:
I can play the movie in Windows Media Player. However, if I
the movie to myself and try to play it in Windows Media Player,it
does not work. I can play any movie in Powerpoint except forthose
that I generate in MATLAB. I've tried using all of the codecs
specified by MATLAB help but the movie still will not play in
powerpoint. I will try turning off the hardware acceleration
my
graphics card. Thanks for your input.Media
Matt
Screwdriver223 wrote:
SNIP> Can't play movies in Powerpoint.
Can you play the movie outside Powerpoint (say, in Windows
movie2avi).Player)? If not, try using a different codec (help
Ifbug.
you can play it outside Powerpoint, but only see a blackrectangle
when you try to play it in the presentation, turn off thehardware
acceleration on your graphics card. This is a Powerpoint
The avi codecs don't seem to be present in the base Windows install
anymore.
Recommend you try mpeg.
Consider the following demo code:
% Movie Demonstration
% create some image data
[X Y Z] = sphere(25);
sz = size(Z);
C = rand(sz(1),sz(2),3);
% stitch data to wrap color around sphere
C(:,end,:) = C(:,1,:);
% render an image
figure('color',[0 0 0]);
sp = surf(X,Y,Z,C,'FaceColor','interp',...
'FaceLighting','phong');
material shiny
axis off vis3d
cl = camlight('right');
camzoom(1.5)
set(sp,'edgecolor','none');
drawnow
% setup the rotation vector for the movie
view_vect_yaw = [-180:3:180];
sz_vect = size(view_vect_yaw);
% "lights, camera, action!"
for f = 1:sz_vect(2)
% set the view, reset light position and render
view([view_vect_yaw(f) 15]);
camlight(cl,'right')
drawnow
% grab a frame
m(f) = getframe(gcf);
end
% % format frames as mpeg and write to file
mpgwrite(m,C,'my_movie.mpg',...
[1, 0, 1, 0, 10, 1, 1, 1]);
% ..or write to an avi file
% movie2avi(m,'my_movie.avi','compression','none','fps',5)
% end of code
This codes utilizes mpgwrite.dll which is available in the File
Exchange. You might find that these files are vastly more compact
than .avi and mpeg is an ISO format so most machines will be able to
view your movies without having to root around for the correct avi
codec.
You just download the .dll and drop it into your working directory.
hth,
Scott
.
- Follow-Ups:
- Re: MATLAB avi file compressions
- From: Peter Boettcher
- Re: MATLAB avi file compressions
- References:
- MATLAB avi file compressions
- From: Matt
- Re: MATLAB avi file compressions
- From: Matt
- MATLAB avi file compressions
- Prev by Date: Re: MATLAB avi file compressions
- Next by Date: tick label in scientific format
- Previous by thread: Re: MATLAB avi file compressions
- Next by thread: Re: MATLAB avi file compressions
- Index(es):
Relevant Pages
|