This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materials including this page, select Japan from the country navigator on the bottom of this page.

Video Loading, Saving, and Display

Read and save multimedia files

Computer Vision System Toolbox™ provides algorithms and tools for video processing. The Computer Vision System Toolbox, together with Image Processing Toolbox™, enables you to view video streams in the loop as you process data, view any video signal within your code or block diagram, and use multiple video viewers at the same time. You can also freeze the display to evaluate the current frame, display pixel information for a region in the frame, and pan, zoom, start, stop, pause and step through simulations one frame at a time. You can:

  • Read, write, and view multimedia files in a wide range of formats, including AVI, MPEG, and WMV.

  • Stream video to and from MMS sources over the Internet or a local network.

  • Acquire video directly from web cameras, frame grabbers, DCAM-compatible cameras, and other imaging devices using Image Acquisition Toolbox™. When using Simulink®, you can use the MATLAB® workspace as a video source or sink.

System Objects

vision.BinaryFileReaderRead video data from binary files
vision.BinaryFileWriterWrite binary video data to files
vision.DeployableVideoPlayerDisplay video
vision.VideoPlayerPlay video or display image
vision.VideoFileReaderRead video frames and audio samples from video file
vision.VideoFileWriterWrite video frames and audio samples to video file


Write Binary FileWrite binary video data to files
Video ViewerDisplay binary, intensity, or RGB images or video streams
To Video DisplayDisplay video data
Frame Rate DisplayCalculate average update rate of input signal
Video To WorkspaceExport video signal to MATLAB workspace
Video From WorkspaceImport video signal from MATLAB workspace
Read Binary FileRead binary video data from files


MATLAB Workflow

Read and Play a Video File

Create a video reader and player objects to read and play a video.

Batch Process Image Files

Import a sequence of images from a folder into the MATLAB workspace and display the sequence using the Computer Vision System Toolbox software.

Transmit Audio and Video Content Over Network

MATLAB and Simulink support network streaming via the Microsoft® MMS protocol (which is also known as the ASF, or advanced streaming format, protocol).

Video Display in a Custom User Interface

This example shows how to display multiple video streams in a custom graphical user interface (GUI).

Face Detection and Tracking Using Live Video Acquisition

This example shows how to automatically detect and track a face in a live video stream, using the KLT algorithm.

Simulink Workflow

Import from Video Files

In this example, you use the From Multimedia File source block to import a video stream into a Simulink model and the To Video Display sink block to view it.

Export to Video Files

The Computer Vision System Toolbox blocks enable you to export video data from your Simulink model.

Display a Sequence of Images

This example displays a sequence of images, which were saved in a folder, and then stored in a variable in the MATLAB workspace.

Partition Video Frames to Multiple Image Files

In this example, you use the To Multimedia File block, the Enabled Subsystem block, and a trigger signal, to save portions of one AVI file to three separate AVI files.

Combine Video and Audio Streams

In this example, you use the From Multimedia File blocks to import video and audio streams into a Simulink model.

Import MATLAB Workspace Variables

Import video from the MATLAB workspace.