Curiosity on the command movie2avi and frame per second velocity
2 views (last 30 days)
Show older comments
Hello everyone! This is the first time that I use Matlab for a course on Biomedical Imaging. I'm trying to learn as much as possible of this powerful software but I have a lot of problems. At the moment my doubts concern the syntax of the command movie2avi. I'm dealing with a demo exercise which show some images of a magnetic resonance and in the final I have to group all these images and create an animation. The problem is that the video starts with a default velocity of 20fps and I wanted to slow down it to 5fps! I wrote the following:
movie2avi(mov,'mri2.avi','fps',5,'compression','None');
but it doesn't work; it continues to show me the movie at 20fps. For clarity I put all the code so maybe you can help me, because I think that the syntax is correct.
%if true
filename=fullfile(matlabroot,'toolbox','images','imdemos','mri.tif');
file_info=imfinfo(filename);
numframes=size(file_info,1);
width=file_info.Width;
height=file_info.Height;
mri = zeros([height width 1 numframes],'uint8');
for frame=1:numframes
[mri(:,:,:,frame),map]=imread('mri.tif',frame);
end;
%if true
montage(mri,map);colormap('Default')
mov = immovie(mri,map);
implay(mov)
movie2avi(mov,'mri2.avi','fps',5,'compression','None');
%end
Thank you in advance for your help! Regards.
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!