Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

Problems reading video with mmreader

Asked by Georg Clauss

Georg Clauss (view profile)

on 19 Sep 2013

I want to load a video and work on the single frames. When I read the video it displays "unable to determine the number of frames in this file". I need only the first part of the video using the following code

obj = mmreader('videoname.avi');
for n=1:500
    mov(n).cdata = obj.read(n);
end

now I try to access the single frames in the video and display them with

img1 = mov(1).cdata
imshow(img1)

but every image in mov shows exactly the same (always the first image of the video)

My Questions:

1. Why is Matlab not able to determine the number of frames? Is there a way to work around this problem?

2. Why are always the same images (first image from video file) stored in mov? Is sthat a problem of the read function?

... I use Matlab 7.1, so can't use the VideoReader ... this is a very simplified example, but doesn't really work

0 Comments

Georg  Clauss

Georg Clauss (view profile)

Products

0 Answers

Contact us