Class: VideoReader

Query property values for video reader object


Value = get(obj,Name)
Values = get(obj,{Name1,...,NameN})
allValues = get(obj)


Value = get(obj,Name) returns the value of the property with the specified Name for object obj.

Values = get(obj,{Name1,...,NameN}) returns the values of the specified properties in a 1-by-N cell array.

allValues = get(obj) returns a scalar structure that contains the values of all properties of obj. Each field name corresponds to a property name.

get(obj) displays all property names and their current values.

Input Arguments


VideoReader object created by the VideoReader function.


String enclosed in single quotation marks that specifies a VideoReader property.

Output Arguments


String containing the value associated with the specified VideoReader property.


Cell array containing the values associated with the specified VideoReader properties. Values is a row vector, with one column for each property.


Scalar (1-by-1) structure array that contains the values of all properties of VideoReader object obj.


collapse all

Display All Object Properties

Display all properties of an object associated with the example file, xylophone.mp4.

xyloObj = VideoReader('xylophone.mp4');
obj = 

  VideoReader with properties:

   General Properties:
           Name: 'xylophone.mp4'
           Path: 'matlabroot\toolbox\matlab\audiovideo'
       Duration: 4.7000
    CurrentTime: 0
            Tag: ''
       UserData: []

   Video Properties:
           Width: 320
          Height: 240
       FrameRate: 30
    BitsPerPixel: 24
     VideoFormat: 'RGB24'

Store Specific Object Properties

Create a 1-by-3 cell array that contains the values of the Height, Width, and Duration properties of an object associated with xylophone.mp4.

xyloObj = VideoReader('xylophone.mp4');
xyloProp = get(xyloObj,{'Height','Width','Duration'})
xyloProp = 

    [240]    [320]    [4.7000]


To access a single property, you can use dot notation. Reference each property as though it is a field of a structure array. For example, find the value of the Duration property for object xyloObj (as created in the Examples):

D = xyloObj.Duration;

This command is equivalent to:

D = get(xyloObj,'Duration');

See Also


Was this topic helpful?