movie2avi problems depending on the number of pixels

조회 수: 3 (최근 30일)
Elad
Elad 2013년 1월 7일
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

답변 (1개)

Shuuji Kajita
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');
%----------------------------------------------------------

카테고리

Help CenterFile Exchange에서 Display and Exploration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by