Problems using mmreader with struct

2 visualizaciones (últimos 30 días)
Bran
Bran el 8 de Sept. de 2014
Respondida: Geoff Hayes el 9 de Sept. de 2014
I am trying to use mmreader to upload a video into MATLAB. I am trying to follow the example in the documentation, however at the line move(1:nFrames) = struct('cdata',zeros(vidHeight,vidWidth,3,'uint8'),'colormap',[]);
I get the following error:
??? The following error occurred converting from struct to mmreader: Error using ==> which Argument must contain a string.
Error in ==> VIDEO2 at 16 mov(1:nFrames) = struct('cdata', zeros(vidHeight, vidWidth, 3, 'uint8'),'colormap',[]);
Any ideas what may be wrong?

Respuestas (1)

Geoff Hayes
Geoff Hayes el 9 de Sept. de 2014
Bran - you must be using an older version of MATLAB; on R2014a, if I try to run through the example at mmreader, I observe the error message MMREADER has been removed. Use VIDEOREADER instead.
Using the same example in R2013a, it works fine and the xylophone video is played. Though if I do the following, after I've run through the example and NOT cleared any variables
mov=xyloObj;
mov(1:nFrames) = ...
struct('cdata',zeros(vidHeight,vidWidth,3,'uint8'),'colormap',[]);
Warning: MMREADER will be removed in a future release. Use VIDEOREADER
instead.
> In mmreader.mmreader>mmreader.mmreader at 120
The following error occurred converting from struct to mmreader:
Argument must contain a string.
So nearly the same error message as you observed. Could it be that you accidentally set mov to an instance of the mmreader class?
Before running your VIDEO2 script, run the following command
clear mov
clear move
to clear the variable mov (and move since you reference both in your question). Now try your script again. Do you still observe the error message?

Categorías

Más información sobre Large Files and Big Data en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by