Borrar filtros
Borrar filtros

how to convert video in to image frames using matlab?

129 visualizaciones (últimos 30 días)
Akhil krishnan
Akhil krishnan el 7 de En. de 2013
Comentada: Image Analyst el 10 de Mayo de 2021
how to convert video in to image frames using matlab?
  5 comentarios
Walter Roberson
Walter Roberson el 11 de Abr. de 2019
H.264 is generally adaptive to determine GOP structure.
That said, there is also choice in the matter. For some purposes, the exact structure can be important and GOP that follow a fixed pattern can be generated. There are tradeoffs to be made for bitrate considerations (how fast does your media read information?); or for CPU speed considerations (slower CPUs are less expensive and might produce less heat, but require less complicated video streams); or for how quickly you can seek to arbitrary points (e.g. chapter search or user fast forward or (more difficult) reverse)
Rose Mohammed
Rose Mohammed el 12 de Abr. de 2019
Thank you very much prof

Iniciar sesión para comentar.

Respuestas (3)

Lalit Patil
Lalit Patil el 7 de En. de 2013
vid=mmreader('video.avi');
numFrames = vid.NumberOfFrames;
n=numFrames;
for i = 1:2:n
frames = read(vid,i);
imwrite(frames,['Image' int2str(i), '.jpg']);
im(i)=image(frames);
end
  14 comentarios
BHANU SRINIVASA
BHANU SRINIVASA el 27 de En. de 2020
can i get this mmreader file
im not able to find on the net
Walter Roberson
Walter Roberson el 27 de En. de 2020
mmreader was removed sometime around 2011. You can use VideoReader to replace it in most cases.

Iniciar sesión para comentar.


Image Analyst
Image Analyst el 17 de Mzo. de 2016
Namith:
You can use the VideoReader class to set the starting time of the video, then use read() to extract a frame from the video at exactly that time. Then use imwrite() to save it to disk. Attached is a demo that does something similar (but not exactly what you want). The demo writes out every single frame to files. You just need to set the time with the method for doing that before you extract the frame.
  7 comentarios
Randall Ang
Randall Ang el 10 de Mayo de 2021
Hi, I tried using the demo that you provided, and it worked well. However, is there a way to ensure that the aspect ratio of the images remain the same as the video?
Image Analyst
Image Analyst el 10 de Mayo de 2021
If you say
axis('image');
after you display an image, it will show it pixel-for-pixel and the aspect ratio will be the same.

Iniciar sesión para comentar.


mae magdadaro
mae magdadaro el 7 de Dic. de 2016
thank you it run

Community Treasure Hunt

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

Start Hunting!

Translated by