I'm trying to just run the code to get to learn how to mess with video files. Unfortunately, one of the functions (hasFrame) doesn't seem to be working . Every time I try to use it it seems to think that the file type VideoReader is not a legitimate input. the code :
vidObj = VideoReader('xylophone.mp4');vidHeight = vidObj.Height;vidWidth = vidObj.Width;s = struct('cdata',zeros(vidHeight,vidWidth,3,'uint8'),... 'colormap',[]);k = 1;while hasFrame(vidObj) s(k).cdata = readFrame(vidObj); k = k+1;end
error says :
Undefined function 'hasFrame' for input arguments of type 'VideoReader'.
is there some package I should have downloaded ? what's up with this?
Best Answer