Creating a movie
古いコメントを表示
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 件)
カテゴリ
ヘルプ センター および 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!