Main Content

Video Viewer

View videos and image sequences

Description

The Video Viewer app plays movies, videos, or image sequences. The app offers basic video playback aids, including the ability to jump to a specific frame, to adjust the frame rate of the display, and to play in forwards and reverse directions.

Note

Medical Imaging Toolbox™ extends the functionality of the implay (Image Processing Toolbox™) function to display data from a medicalImage (Medical Imaging Toolbox) object. For more information, see implay (Medical Imaging Toolbox).

Using this app, you can adjust other aspects of the video display and explore video data in more depth.

  • Get information about frame size, color format, data type, and frame count.

  • Change the colormap of grayscale and binary image sequences.

  • Adjust the display range of grayscale image sequences.

  • Open a Pixel Region tool that displays an extreme close-up view of a small region of pixels in the target image.

  • Export a frame to the Image Viewer app.

  • View video signals in Simulink® models (requires Simulink). For more information, see View Video in Simulink (Computer Vision Toolbox).

Video Viewer does not play audio tracks.

Note

The app is not supported in MATLAB® Online™. For details, see Specifications and Limitations.

Video Viewer app

Open the Video Viewer App

  • MATLAB Toolstrip: On the Apps tab, under Image Processing and Computer Vision, click the Video Viewer app icon.

  • MATLAB command prompt: Enter implay.

Examples

expand all

Animate a sequence of grayscale images at 10 frames per second.

load cellsequence
implay(cellsequence,10)

Visually explore a stack of grayscale MRI images.

load mristack
implay(mristack)

Play an AVI file.

implay("rhinos.avi")

Related Examples

Programmatic Use

expand all

implay opens the Video Viewer app in an empty state.

  • To load a video from a file, select File > Open.

  • To load an image sequence stored as a variable in the workspace, select File > Import from Workspace.

implay(filename) opens the Video Viewer app and loads the content of the Audio Video Interleaved (AVI) file with filename filename. Specify filename as a character vector or string scalar. The AVI file determines the default frame rate.

Note

Video Viewer supports reading from AVI files only. To open other video file formats in Video Viewer, such as MP4 files, you can first read the video file using VideoReader and then write the data to an AVI file using VideoWriter. For short videos, you can also write the data to a multiframe image sequence in memory. For more information, see Supported Video and Audio File Formats.

implay(I) opens the Video Viewer app and displays the first frame in the multiframe image sequence I. Specify I as one of these values:

  • An m-by-n-by-k numeric or logical array representing a grayscale or binary image sequence of k frames, respectively.

  • An m-by-n-by-1-by-k numeric or logical array representing a grayscale or binary image sequence of k frames, respectively.

  • An m-by-n-by-3-by-k numeric array representing a truecolor (RGB) image sequence of k frames.

  • A MATLAB movie structure. For more information, see immovie.

For numeric data, the preferred data type of I is uint8. The actual data type used to display pixels may differ from the source data type.

The default frame rate is 20 frames per second. To change the frame rate, specify the second input argument, fps.

implay(___,fps) also specifies the frame rate fps in frames per second. Specify fps as a positive number.

More About

expand all

Version History

Introduced in R2014b