writevideo skipping last frame

6 ビュー (過去 30 日間)
Leyon
Leyon 2014 年 8 月 1 日
コメント済み: Leyon 2014 年 8 月 1 日
I am using writevideo to make a movie while creating the images. I have gotten it to work before however, this time it is skipping the last frame although I haven't changed the code. the code is:
if true
narr_anim(7) = struct('cdata',[],'colormap',[]);
myVideo = VideoWriter('dove_anim.avi');
myVideo.FrameRate = 1;
open(myVideo);
for m = 1 : 7
narr_anim(m) = getframe(gcf)
writeVideo(myVideo, narr_anim);
end
close(myVideo);
end
Am I missing something?

採用された回答

Ben11
Ben11 2014 年 8 月 1 日
Maybe use
narr_anim(m).cdata
in your loop? Other than that your code looks fine to me
  7 件のコメント
Leyon
Leyon 2014 年 8 月 1 日
vlc doesn't even play the video. It opens the first frame, runs the length of the movie but doesn't show the other images.
Leyon
Leyon 2014 年 8 月 1 日
videowriter captured all the frames and if I stop WMP it shows the last frame. But during playback, WMP goes black before the last frame is rendered.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAudio and Video Data についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by