How to extract frames from a vedio file in avi format?

조회 수: 2 (최근 30일)
krishna Chauhan
krishna Chauhan 2022년 7월 20일
댓글: krishna Chauhan 2022년 7월 20일
I tried the code below in both mp4 and avi files. The obj.NumFrames file is blank. There is not error messgae the object is created but the parameters are 0.
obj = VideoReader('k.avi');
vid = read(obj);
Can any one guide here.
Thanks

채택된 답변

vishweshwar samba
vishweshwar samba 2022년 7월 20일
Try this
frameNo = 10;
videoReader = VideoReader('k.avi');
for i = 1:frameNo
frame = readFrame(videoReader); % read the next video frame
end
figure;
imshow(frame);
title('Video Frame 10');
  댓글 수: 1
krishna Chauhan
krishna Chauhan 2022년 7월 20일
I dont know what happend previously :
It is perfectly working now, the code which I post.
Thanks

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

추가 답변 (0개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by