www.gusucode.com > vision 源码程序 matlab案例代码 > vision/ReadAndPlayAVideoFileExample.m

    %% Read and Play a Video File
% 
%%
% Load the video using a video reader object.
videoFReader = vision.VideoFileReader('ecolicells.avi');
%%
% Create a video player object to play the video file.
videoPlayer = vision.VideoPlayer;
%%
% Use a while loop to read and play the video frames.
while ~isDone(videoFReader)
  videoFrame = videoFReader();
  videoPlayer(videoFrame);
end
%%
% Release the objects.
release(videoPlayer);
release(videoFReader);