movie2avi problems depending on the number of pixels

1 view (last 30 days)
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

Answers (1)

Shuuji Kajita
Shuuji Kajita on 8 Jan 2013
Edited: Image Analyst on 8 Jan 2013
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');
%----------------------------------------------------------

Categories

Find more on Images in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!