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..
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
回答(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!