[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: aviread from video package does not return correct frame
From: |
shall689 |
Subject: |
Re: aviread from video package does not return correct frame |
Date: |
Tue, 25 Dec 2018 15:49:09 -0600 (CST) |
I forgot to mention that I was able to extract all the frame using Matlab.
Here's the code I used with Matlab:
xyloObj = VideoReader('vid1.avi');
vidWidth = xyloObj.Width;
vidHeight = xyloObj.Height;
mov = struct('cdata',zeros(vidHeight,vidWidth,3,'uint8'),...
'colormap',[]);
k = 1;
while hasFrame(xyloObj)
mov(k).cdata = readFrame(xyloObj);
frameName =
strcat('C:\Users\Melb\Documents\MATLAB\frames_avi\frame',num2str(k),'.jpg')
imwrite(mov(k).cdata,frameName);
k = k+1;
end
hf = figure;
set(hf,'position',[150 150 vidWidth vidHeight]);
movie(hf,mov,1,xyloObj.FrameRate);
--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
Re: aviread from video package does not return correct frame, Andreas Weber, 2018/12/26