Effacer les filtres
Effacer les filtres

Creating a movie

1 vue (au cours des 30 derniers jours)
James Timana
James Timana le 30 Oct 2011
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 commentaire
Amith Kamath
Amith Kamath le 30 Oct 2011
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..

Connectez-vous pour commenter.

Réponses (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by