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. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Reading and Writing Files

Import and export audio and video files


audioinfoInformation about audio file
audioreadRead audio file
audiowriteWrite audio file
VideoReaderRead video files
VideoWriterWrite video files
mmfileinfoInformation about multimedia file
lin2muConvert linear audio signal to mu-law
mu2linConvert mu-law audio signal to linear

Examples and How To

Read and Write Audio Files

This example shows how to write data to an audio file, get information about the file, and then read data from the audio file.

Get Information about Video Files

VideoReader creates an object that contains properties of the video file, including the duration, frame rate, format, height, and width.

Read Video Files

This example shows how to read and store data from all frames in a video file, display one frame, and then play all frames at the video's frame rate.

Convert Between Image Sequences and Video

This example shows how to convert between video files and sequences of image files using VideoReader and VideoWriter.

Export to Video

To create an Audio/Video Interleaved (AVI) file from MATLAB® graphics animations or from still images, follow these steps:

Import Images, Audio, and Video Interactively

For information on importing text files, see Import Text File Data Using Import Tool.

Import or Export a Sequence of Files

To import or export multiple files, create a control loop to process one file at a time.


Characteristics of Audio Files

The audio signal in a file represents a series of samples that capture the amplitude of the sound over time.

Supported Video File Formats

For video data, the term “file format” often refers to either the container format or the codec.

Supported File Formats for Import and Export

Table of file formats that MATLAB can read and write, and recommended functions