cannot read all the frame in a video

2 views (last 30 days)
Exton
Exton on 24 Oct 2012
"""""
obj=VideoReader('333.wmv'); %read video
class(obj);
a=read(obj);
frames=get(obj,'numberOfFrames');
for k = 1 : frames
I(k).cdata = a(:,:,:,k);
I(k).colormap = [];
end
for j = 1: obj.NumberOfFrame-1
b=read(obj,j);
c=read(obj,j+1);
end
"""
this is my coding to read the video and it is success to read the video but my PROBLEM is i when i used a for loop to read the number of frame it pop out some error
"""""
Error using VideoReader/read (line 86)
The frame index requested is beyond the end of the file.
Error in tryerror (line 15)
b=read(obj,j);
""""""""
anyone can help me to solved this problem My aim is try to extract out each of the frame and by running a loop i can calculate the different between different frame....

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!