|
Hi,
I am reading in an AVI file using mmreader. I need to captuire certain frames and convert then to an image file (format not important). So far I have managed to read in the file but whenever I try to 'read' a specific frame I can only read frame 1.
In fact when I use 'last=read(ValveObj, inf)' I still only get frame 1. The number of frames variable says there are 330 frames.
I did thnk that there might be an issue with variable frame rate but this wouldnt account for there only being one frame to read in though would it?
I can watch the avi in Windows Media Player with no problem.
I tried to use this example file from the online help........
MVObj = cannon;
nFrames = MVObj.NumberOfFrames;
vidHeight = MVObj.Height;
vidWidth = MVObj.Width;
% Preallocate movie structure.
mov(1:nFrames) = ...
struct('cdata', zeros(vidHeight, vidWidth, 3, 'uint8'),...
'colormap', []);
% Read one frame at a time.
for k = 1 : nFrames
mov(k).cdata = read(MVObj, k);
end
% Size a figure based on the video's width and height.
hf = figure;
set(hf, 'position', [150 150 vidWidth vidHeight])
% Play back the movie once at the video's frame rate.
movie(hf, mov, 1, MVObj.FrameRate);
.............to reconstruct the movie but oddly the file returned an error when it got to k=192.
Can somebody explain what's going on please.
Yours perplexed
Nic
|