convert video to frames and then delete some frames???

4 visualizaciones (últimos 30 días)
Ankur Singh
Ankur Singh el 3 de Mzo. de 2014
Respondida: John Rogers el 10 de Jul. de 2019
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

Respuestas (2)

John Rogers
John Rogers el 10 de Jul. de 2019
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)

Walter Roberson
Walter Roberson el 3 de Mzo. de 2014
VideoReader() to read each frame, then process it, then VideoWriter() to save the frame if it is one that needs saving.

Categorías

Más información sobre Import, Export, and Conversion en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by