Main Content

mmfileinfo

Information about multimedia file

Syntax

info = mmfileinfo(filename)

Description

info = mmfileinfo(filename) returns a structure, info, with fields containing information about the contents of the multimedia file identified by filename. The filename is specified as a character vector or string scalar.

If filename is a URL, mmfileinfo might take a long time to return because it must first download the file. For large files, downloading can take several minutes. To avoid blocking the MATLAB® command line while this processing takes place, download the file before calling mmfileinfo.

The info structure contains the following fields, listed in the order they appear in the structure.

Field

Description

Filename

Text indicating the name of the file.

Path

Text indicating the absolute path to the file.

Duration

Length of the file in seconds.

Audio

Structure containing information about the audio data in the file. See Audio Data for more information about this data structure.

Video

Structure containing information about the video data in the file. See Video Data for more information about this data structure.

Audio Data

The Audio structure contains the following fields, listed in the order they appear in the structure. If the file does not contain audio data, the fields in the structure are empty.

Field

Description

Format

Text indicating the audio format.

NumChannels

Number of audio channels.

Video Data

The Video structure contains the following fields, listed in the order they appear in the structure. If the file does not contain video data, the fields in the structure are empty.

Field

Description

Format

Text indicating the video format.

Height

Height of the video frame.

Width

Width of the video frame.

Examples

Display information about the example file xylophone.mpg:

info = mmfileinfo('xylophone.mpg')
audio = info.Audio
video = info.Video

MATLAB returns:

info = 
    Filename: 'xylophone.mpg'
        Path: 'matlabroot\toolbox\matlab\audiovideo'
    Duration: 4.7020
       Audio: [1x1 struct]
       Video: [1x1 struct]

audio = 
              Format: 'MPEG'
         NumChannels: 2

video = 
    Format: 'MPEG1'
    Height: 240
     Width: 320

where Path is system-dependent.

Version History

Introduced before R2006a

See Also