movie2avi problems depending on the number of pixels
2 次查看(过去 30 天)
显示 更早的评论
Hey all, I'm making a movie from jpeg images using movie2avi function and FFDS compression, depending on the resolution (x and y number of pixels) of the images I get either a good movie, a deformed one (rotated and cut in diagonally) or a noisy one. any idea why , or suggestion for other compression ? Thanks
0 个评论
回答(1 个)
Shuuji Kajita
2013-1-8
编辑:Image Analyst
2013-1-8
Hi Elad, I have the same problem with Matlab R2010a on Windows7. In my environment, the figure size affects as follows.
(x y) (resulted movie)
560x420 : Good
558x420 : rotated and cut in diagonally
556x420 : strange color
Following is the code that I've tested.
% ffds_test_fix.m
close all
clear
NUMBER_OF_FRAMES = 100;
filename = [mfilename,'.avi'];
myfig = figure;
fig_pos = get(myfig,'Position');
%fig_rect = [1 1 fig_pos(3) fig_pos(4)]; % good result 560x420
fig_rect = [1 1 fig_pos(3)-2 fig_pos(4)]; % rotated and cut in diagonally
%fig_rect = [1 1 fig_pos(3)-4 fig_pos(4)]; % strange color
omega = 3*2*pi;
Dtime = 0.01;
time = 0:Dtime:1.0;
ToRad = pi/180;
for x=1:NUMBER_OF_FRAMES
newplot;
y = sin(omega*time + ToRad*x);
plot(time,y);
axis equal;
mov(x) = getframe(myfig,fig_rect);
end;
movie2avi(mov, 'ffds_test_fix', 'compression', 'FFDS');
%----------------------------------------------------------
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!