How can I save individual movie frames from a video?
Mostrar comentarios más antiguos
I want to save individual frames of my video--how can I do this?
I tried the code below but it is not working...
clc
close all
clear all
source='Intellegent.avi';
vidobj=VideoReader(source);
frames=vidobj.Numberofframes;
for f=1:frames
thisframe=read(vidobj,f);
figure(1);imagesc(thisframe);
for K=1:size(thisframe,3)
itframe=thisframe(:,:,K);
thisfile = sprintf('frame_%04d.jpg', K);
imwrite( thisframe, thisfile );
end
end
3 comentarios
Sean de Wolski
el 28 de Mzo. de 2013
What "isn't working" about it? Do you get an error? Do the files nto appear? Do they appear corrupted?
Muluken Birara
el 11 de Mayo de 2017
how to extract image frames form given video file with different number of frame size(like 2 frame per second , 10 FPS
Walter Roberson
el 5 de Oct. de 2017
The demo given by Image Analyst does not need to care what the frame rate was of the original video in order to extract all of the frames into files.
Respuesta aceptada
Más respuestas (2)
Willy
el 24 de Oct. de 2014
clc
close all
clear all
source='/Users/zzzz/Desktop/FILE1739.mov';
vidobj=VideoReader(source);
frames=vidobj.Numberofframes;
for f=1:frames
thisframe=read(vidobj,f);
figure(1);imagesc(thisframe);
thisfile=sprintf('/Users/zzzz/Desktop/FILE1739/frame_%04d.jpg',f);
imwrite(thisframe,thisfile);
end
Does what you asked, did not polish your code further ;-)
Ali Noori
el 25 de Mayo de 2015
0 votos
I have attached a code to convert movie to frames sequences and store them in folder name "aliiiii". Just you need to create the folder name "aliiiii" in matlab directory. Cheers
1 comentario
Ashfaq Ahmed
el 8 de Dic. de 2016
Where is attached code "aliiiii"?
Categorías
Más información sobre Get Started with Computer Vision Toolbox en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!