Play movies, videos, or image sequences

Use the implay function to open the Video Viewer app, which plays MATLAB® movies, videos, or image sequences (also called image stacks). Using Video Viewer you can select the movie or image sequence that you want to play, jump to a specific frame in the sequence, change the frame rate of the display, or perform other viewing activities. You can open multiple Video Viewers to view different movies simultaneously.

The figure shows the Video Viewer app containing an image sequence.




implay opens the Video Viewer app. To select the movie or image sequence that you want to play, use the Video Viewer File menu.

implay(filename) opens the Video Viewer app, displaying the content of the file specified by filename. The file can be an Audio Video Interleaved (AVI) file. The Video Viewer reads one frame at a time, conserving memory during playback. The Video Viewer does not play audio tracks.

implay(I) opens the Video Viewer app, displaying the first frame in the multiframe image specified by I.

implay(___,fps) specifies the frame rate at which you want to view the movie or image sequence.


Play Three Types of Videos

Animate a sequence of images.

load cellsequence

Visually explore a stack of MRI images.

load mristack

Play an AVI file.


Input Arguments

collapse all

File name of AVI file, specified as a character vector or string scalar.

Data Types: char | string

Multiframe image sequence, specified as one of the following.

  • A MATLAB movie structure

  • A binary or grayscale image sequence, specified as an m-by-n-by-1-by-k array or an m-by-n-by-k array

  • A truecolor (RGB) image sequence, specified as an M-by-N-by-3-by-K array.

I can be numeric but uint8 is preferred. The actual data type used to display pixels may differ from the source data type.

Frame rate, in frames-per-second, specified as a positive number. If omitted, the Video Viewer uses the frame rate specified in the file or the default value, 20.


  • You can also open the Video Viewer app through the Apps tab. Navigate to the Image Processing and Computer Vision group and click Video Viewer.

Introduced in R2007b