This is machine translation

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

Reading and Writing Files

Import and export audio and video files


audioinfo Information about audio file
audioread Read audio file
audiowrite Write audio file
VideoReader Create object to read video files
VideoWriter Create object to write video files
mmfileinfo Information about multimedia file
lin2mu Convert linear audio signal to mu-law
mu2lin Convert mu-law audio signal to linear

Using Objects

VideoReader Read video files
VideoWriter Write video files

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 Select 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

Was this topic helpful?