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. To view these properties, or store them in a structure, use the get method. For example, get the properties of the file xylophone.mp4:

xyloObj = VideoReader('xylophone.mp4');
info = get(xyloObj)

The get function returns:

info = 

        Duration: 4.7000
            Name: 'xylophone.mp4'
            Path: 'matlabroot\toolbox\matlab\audiovideo'
             Tag: ''
        UserData: []
    BitsPerPixel: 24
       FrameRate: 30
          Height: 240
     VideoFormat: 'RGB24'
           Width: 320
     CurrentTime: 0

To access a specific property of the object, such as Duration, use dot notation as follows:

duration = xyloObj.Duration;

See Also

Was this topic helpful?