This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals 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. 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.

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.

System Objects

vision.BinaryFileReader Read video data from binary files
vision.BinaryFileWriter Write binary video data to files
vision.DeployableVideoPlayer Display video
vision.VideoPlayer Play video or display image
vision.VideoFileReader Read video frames and audio samples from video file
vision.VideoFileWriter Write video frames and audio samples to video file


Read Binary File Read binary video data from files
Video From Workspace Import video signal from MATLAB workspace
Video To Workspace Export video signal to MATLAB workspace
Frame Rate Display Calculate average update rate of input signal
To Video Display Display video data
Video Viewer Display binary, intensity, or RGB images or video streams
Write Binary File Write binary video data to files

Examples and How To

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.


Video Formats

Video data is a series of images over time.

Image Formats

In the Computer Vision System Toolbox software, images are real-valued ordered sets of color or intensity data.

Was this topic helpful?