フィルターのクリア

Extract frames from a mp4 video and saving in a file

1 回表示 (過去 30 日間)
Nabeel Ahmed
Nabeel Ahmed 2018 年 3 月 16 日
回答済み: Anay Aggarwal 2022 年 7 月 12 日
I want to Extract frames from a video and save them in a file. This is the code I used:
clc;
close all;
workspace;
video = 'test.mp4';
vid = VideoReader(video);
opFolder = fullfile(cd,'Frames');
if ~exist(opFolder,'dir')
mkdir(opFolder);
end
numFrames = vid.CurrentTime;
numFramesWritten = 0;
for t=1:numFrames
currFrame = read(mov,t);
opBaseFileName = sprintf('%3.3d.png', t);
opFullFileName = fullfile(opFolder, opBaseFileName);
imwrite(currFrame, opFullFileName, 'png');
progIndication = sprintf('Wrote frame %4d of %d.', t, numFrames);
fprintf(progIndication);
numFramesWritten = numFramesWritten + 1;
end
progIndication = sprintf('Wrote %d frames to folder "%s"',numFramesWritten, opFolder);
fprintf(progIndication);
  3 件のコメント
Nabeel Ahmed
Nabeel Ahmed 2018 年 3 月 16 日
I want someone to tell me how can i extract the frames from a video and the store these frames in a file
Nabeel Ahmed
Nabeel Ahmed 2018 年 3 月 16 日
First time using matlab, and i need to make my FYP so i need help

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

回答 (1 件)

Anay Aggarwal
Anay Aggarwal 2022 年 7 月 12 日
Hi Nabeel
I have an understanding that you want to extract frames from an mp4 video.
Please check out the following link to get the reference:
Regards

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by