Pause a Frame in an Animation
21 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I am trying to create an animation using VideoWriter. In between the animation, I want a frame to be paused for 10 seconds. Can anybody help me with this?
Also, is it possible to have a different frame rate for a single video object? Like, the initial frames have fps 20 while the other part have fps 10. If yes, how?
( PS: If you have answer to only one of the question, you are still welcome to answer. )
回答 (1 件)
KALYAN ACHARJYA
2021 年 3 月 15 日
編集済み: KALYAN ACHARJYA
2021 年 3 月 15 日
Adjust the frame rate this way?
video_data=VideoWriter('test_video');
video_data.FrameRate=5;
open(video_data)
for i=1:50
clf;
data=uint8(randi([0,255],[500,500]));
imshow(data);
pause(randi(3)); % You have to adjust this accordingly
frame=getframe(gcf);
writeVideo(video_data,frame);
end
close(video_data);
参考
カテゴリ
Help Center および File Exchange で Animation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!