how to convert video in to image frames using matlab?

조회 수: 127 (최근 30일)
Akhil krishnan
Akhil krishnan 2013년 1월 7일
댓글: Image Analyst 2021년 5월 10일
how to convert video in to image frames using matlab?
  댓글 수: 5
Walter Roberson
Walter Roberson 2019년 4월 11일
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 2019년 4월 12일
Thank you very much prof

댓글을 달려면 로그인하십시오.

답변 (3개)

Lalit Patil
Lalit Patil 2013년 1월 7일
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
BHANU SRINIVASA
BHANU SRINIVASA 2020년 1월 27일
can i get this mmreader file
im not able to find on the net
Walter Roberson
Walter Roberson 2020년 1월 27일
mmreader was removed sometime around 2011. You can use VideoReader to replace it in most cases.

댓글을 달려면 로그인하십시오.


Image Analyst
Image Analyst 2016년 3월 17일
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
Randall Ang
Randall Ang 2021년 5월 10일
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 2021년 5월 10일
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.

댓글을 달려면 로그인하십시오.


mae magdadaro
mae magdadaro 2016년 12월 7일
thank you it run

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by