Creating a movie
조회 수: 1 (최근 30일)
이전 댓글 표시
hi!
ineed help on the following problem:
I created a slide-show on GUI by using these codes under axes:
useVideoWriter = ~verLessThan('matlab','7.11');
if useVideoWriter
vid = VideoWriter('vid.avi');
vidObj.Quality = 100;
vid.FrameRate = 80;
open(vid);
else
vid = avifile('vid.avi', 'fps',80, 'quality',100);
end
% Hint: place code in OpeningFcn to populate axes1
for k = 1:10
axes(hObject)
imshow('1.jpg')
pause(0.2)
imshow('2.jpg')
pause(0.2)
imshow('3.jpg')
pause(0.2)
imshow('4.jpg')
pause(0.2)
imshow('5.jpg')
pause(0.2)
imshow('6.jpg')
%# capture frame
if useVideoWriter
writeVideo(vid,getframe);
else
vid = addframe(vid, getframe(gcf));
end
end
%# close and save video output
if useVideoWriter
close(vid);
else
vid = close(vid);
end
%%When I run it, it shows all the pictures and also make a movie but it does not playback the video length is 00.00.00 what could be the problem and how can I solve
Thanks
댓글 수: 1
Amith Kamath
2011년 10월 30일
Could you also mention the OS you are using and how you are trying to playback the video? I suppose the problem is that of the video codec, for I run ubuntu 10.04 and without ffmpeg, I cannot view the videos I generate this way. Also, on windows, the videos usually play on Windows media player, but don't on VLC player and so on..
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Audio and Video Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!