VideoReader error 'Error using message/getString'

9 views (last 30 days)
hi all im quite new to matlab and i wanted to use the VideoReader to read a video file.
info = mmfileinfo('80A Expo300 Diaph2.8 200Hz.avi');
xyloObj = VideoReader('80A Expo300 Diaph2.8 200Hz.avi');
get(xyloObj)
nFrames = xyloObj.NumberOfFrames;
vidHeight = xyloObj.Height;
vidWidth = xyloObj.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(xyloObj, 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, xyloObj.FrameRate);
i used the code in the matlab HELP to get started and when i run it i received error as follow:
Error using message/getString
Incorrect number of parameters supplied for
'MATLAB:nomem'. Expected 0 but found 1.
Error in VideoReader.handleImplException (line
375)
throwAsCaller(MException(implException.identifier,
msgObj.getString));
Error in VideoReader/read (line 145)
VideoReader.handleImplException(err);
Error in testing_video (line 20)
mov(k).cdata = read(xyloObj, k);
can someone please tell me what is the problem with it? thanks.

Answers (1)

Geoff Hayes
Geoff Hayes on 23 May 2014
I took your code and was able to use it to read the first 30 frames of an avi that I have. So there doesn't appear to be anything incorrect with what you have implemented. However, if I tried to process all 1308 frames, the following error was generated when the movie command was invoked:
Error using movie (line 44)
Java exception occurred:
java.lang.OutOfMemoryError: Java heap space
I can't help but wonder if you are running into the same problem (but earlier in the code). You have noted above the
Incorrect number of parameters supplied for
'MATLAB:nomem'. Expected 0 but found 1.
message. nomem seems to imply no memory. How many frames are you trying to process in your avi? What is the size of each frame? At which k (frame) is the error thrown? It could be that you don't have enough memory to process all frames in the video. Try processing the first 30 frames only - does that work?

Community Treasure Hunt

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

Start Hunting!