Cannot read a another video (HELP)

""
obj=VideoReader('222.wmv');
a=read(obj);
frames=get(obj,'numberOfFrames');
for k = 1 : frames
I(k).cdata = a(:,:,:,k);
I(k).colormap = [];
end
implay(I);
""
i have a video with name '111.wmv' this 1 i can read it but when i want to read another video name'222.wmv' it give a an error
"
Dot name reference on non-scalar structure.
Error in VideoReader/read (line 91)
if( ~isempty(obj.NumberOfFrames) )
Error in new (line 3)
a=read(obj);
" what does it mean & how do i solved it????

 채택된 답변

Walter Roberson
Walter Roberson 2012년 10월 20일

0 개 추천

It means the VideoReader() call failed, such as might occur if 222.wmv was not found.

댓글 수: 7

Exton
Exton 2012년 10월 20일
but i place the video in the same path Yet i dont why it call fail???
any solution on that>>??
After you make the call
obj=VideoReader('222.wmv');
what does
class(obj)
report ?
Exton
Exton 2012년 10월 20일
편집: Exton 2012년 10월 20일
% Update the frameIndex only if the total number of frames in the video can % be determined after the read operation
if( ~isempty(obj.NumberOfFrames) )
frameIndex(frameIndex == Inf) = obj.NumberOfFrames;
end
is this what you call class(obj)report??
class() is a MATLAB function. Insert the following line into the code right after your obj=VideoReader('222.wmv'); line:
class(obj)
And tell us what the output is from that line.
Exton
Exton 2012년 10월 21일
ops...sorry get it now,and i get the report is the same
""
ans =
VideoReader
Dot name reference on non-scalar structure.
Error in VideoReader/read (line 91)
if( ~isempty(obj.NumberOfFrames) )
""
Wait, this sounds familiar now. There is a bug, I think it is in R2012b only, that affects structure access.
Edit line 91 to change
if( ~isempty(obj.NumberOfFrames) )
to
if( ~isempty(obj(1).NumberOfFrames) )
and likewise on other lines that encounter the same problem.
Exton
Exton 2012년 10월 21일
Nice man got it... THANKYOU ^_^

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

제품

질문:

2012년 10월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by