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

14 Ansichten (letzte 30 Tage)
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

Akzeptierte Antwort

vishweshwar samba
vishweshwar samba am 20 Jul. 2022
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 Kommentar
krishna Chauhan
krishna Chauhan am 20 Jul. 2022
I dont know what happend previously :
It is perfectly working now, the code which I post.
Thanks

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by