Effacer les filtres
Effacer les filtres

movie2avi problems depending on the number of pixels

1 vue (au cours des 30 derniers jours)
Elad
Elad le 7 Jan 2013
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

Réponses (1)

Shuuji Kajita
Shuuji Kajita le 8 Jan 2013
Modifié(e) : Image Analyst le 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');
%----------------------------------------------------------

Catégories

En savoir plus sur Images dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by