convert video to frames and then delete some frames???
2 ビュー (過去 30 日間)
古いコメントを表示
i have a video,i need to divide video into different frames..and then delete some of the frames below some threshold??please help me
0 件のコメント
回答 (2 件)
John Rogers
2019 年 7 月 10 日
Here is an example:
% speedUpVideo
% Keeps one out of ten frames
clear;clc
videoIn = VideoReader('hangar_free_air.mp4');
videoOut = VideoWriter('hangar_free_airFAST.mp4','MPEG-4');
open(videoOut);
frameNum = 0;
while hasFrame(videoIn)
videoFrame = readFrame(videoIn);
frameNum = frameNum+1;
if frameNum == 10
writeVideo(videoOut,videoFrame);
frameNum = 0;
end
end
close(videoOut)
0 件のコメント
Walter Roberson
2014 年 3 月 3 日
VideoReader() to read each frame, then process it, then VideoWriter() to save the frame if it is one that needs saving.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!