Azzera filtri
Azzera filtri

Creating a movie

1 visualizzazione (ultimi 30 giorni)
James Timana
James Timana il 30 Ott 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 Commento
Amith Kamath
Amith Kamath il 30 Ott 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..

Accedi per commentare.

Risposte (0)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by