vid3

gh = mmfileinfo('test3.avi')
info = gh.Video
clear
gh = 

    Filename: 'test3.avi'
        Path: 'C:\classes\ece595b\work2011\vid'
    Duration: 19.5333
       Audio: [1x1 struct]
       Video: [1x1 struct]


info = 

    Format: 'YUY2'
    Height: 480
     Width: 640

obj = mmreader('test3.avi')
get(obj)
nframes = obj.NumberOfFrames;
Summary of Multimedia Reader Object for 'test3.avi'.

  Video Parameters:  30.00 frames per second, RGB24 640x480.
                     586 total video frames available.

  General Settings:
    Duration = 19.5333
    Name = test3.avi
    Path = C:\classes\ece595b\work2011\vid
    Tag = 
    Type = mmreader
    UserData = []

  Video Settings:
    BitsPerPixel = 24
    FrameRate = 30.0000
    Height = 480
    NumberOfFrames = 586
    VideoFormat = RGB24
    Width = 640

img = read(obj,1);
imshow(img);
img = read(obj,100);
imshow(img);
img = read(obj,300);
imshow(img);
try
    img = read(obj,nframes);
    imshow(img);
catch exception
    disp(exception.message)
end
MATLAB:read:readTimedOut
data = read(obj,[550 580]);
size(data)
Warning: The end of file was reached before the requested
frames were read completely.  Frames 550 through 567 were
returned. 

ans =

   480   640     3    18

img = read(obj,567);
imshow(img)