# getinfo

## PURPOSE

INFO=GETINFO(VR)

## SYNOPSIS

function info = getinfo(vr)

## DESCRIPTION

    INFO=GETINFO(VR)
      Returns a structure whose fields contain information about the opened
      video object.  The (minimum) set of fields in the INFO structure is
      shown below:
        url        String specifying the data source, in the format preferred
                   by the plugin being used.  Sometimes this will be a true
                   URL, sometimes it will be a filename.

        fps        Non-negative number indicating the number of frames per
                   second.

        height     Integer indicating the height of the video frames in
                   pixels.

        width      Integer indicating the width of the video frames in pixels.

        numFrames  Integer indicating an estimate of the total number of
                   frames in the video.  For typical videos, this number is
                   exact.  Users may attempt to read more than numFrames
                   frames at their own risk.  If nHiddenFinalFrames is
                   non-zero, this will typically fail (meaning next/step/seek
                   will return 0) or worse, corrupted data such as an
                   all-black frame may be returned by the codec.  Some plugins
                   and/or their codecs do not supply this information.  If the
                   number of frames is unknown, a negative number is returned.
                   Older ffmpeg versions (notably version 0.4.9-pre1) do not
                   supply this number.

        fourcc     4- or fewer-character string roughly indicating the codec
                   used encode the video.  See http://www.fourcc.org for
                   additional background information and an extensive, but
                   non-comprehensive list of FourCC codes.

        nHiddenFinalFrames
                   Non-negative integer.  Many codecs make it difficult or
                   impossible to read the last few frames of a file.  When
                   videoReader thinks that the last few cannot be read, it
                   automatically guesses how many frames cannot be read,
                   records this number as nHiddenFinalFrames, and sets
                   numFrames to be the number of frames the file claims to
                   contain minus nHiddenFinalFrames.  An individual
                   videoReader plugin (like the ffmpegPopen2 plugin) may choose
                   to allow the user to try reading the frames that might be
                   hidden or it may choose not to allow even trying to read
                   them (like the DirectShow plugin).

      Due to limitations in some file formats, it is not always possible to
      determine all of these values (or sometimes they are not constant).  In
      these cases, numerical values are given a value of NaN and string values
      are blank.

    SEE ALSO
      videoReader

    Copyright (c) 2006 Gerald Dalley
    See "MIT.txt" in the installation directory for licensing details (especially
    when using this library on GNU/Linux).

## CROSS-REFERENCE INFORMATION

This function calls:

This function is called by:

- FTrack FTRACK
- FlyTracker FLYTRACKER
- videoread VIDEOREAD Read an video file in a mannter compatible with Matlab's
- videoread VIDEOREAD Read an video file in a mannter compatible with Matlab's
- videoread VIDEOREAD Read an video file in a mannter compatible with Matlab's

## SOURCE CODE

    0001 function info = getinfo(vr)
    0002 %INFO=GETINFO(VR)
    0003 %  Returns a structure whose fields contain information about the opened
    0004 %  video object.  The (minimum) set of fields in the INFO structure is
    0005 %  shown below:
    0006 %    url        String specifying the data source, in the format preferred
    0007 %               by the plugin being used.  Sometimes this will be a true
    0008 %               URL, sometimes it will be a filename.
    0009 %
    0010 %    fps        Non-negative number indicating the number of frames per
    0011 %               second.
    0012 %
    0013 %    height     Integer indicating the height of the video frames in
    0014 %               pixels.
    0015 %
    0016 %    width      Integer indicating the width of the video frames in pixels.
    0017 %
    0018 %    numFrames  Integer indicating an estimate of the total number of
    0019 %               frames in the video.  For typical videos, this number is
    0020 %               exact.  Users may attempt to read more than numFrames
    0021 %               frames at their own risk.  If nHiddenFinalFrames is
    0022 %               non-zero, this will typically fail (meaning next/step/seek
    0023 %               will return 0) or worse, corrupted data such as an
    0024 %               all-black frame may be returned by the codec.  Some plugins
    0025 %               and/or their codecs do not supply this information.  If the
    0026 %               number of frames is unknown, a negative number is returned.
    0027 %               Older ffmpeg versions (notably version 0.4.9-pre1) do not
    0028 %               supply this number.
    0029 %
    0030 %    fourcc     4- or fewer-character string roughly indicating the codec
    0031 %               used encode the video.  See http://www.fourcc.org for
    0032 %               additional background information and an extensive, but
    0033 %               non-comprehensive list of FourCC codes.
    0034 %
    0035 %    nHiddenFinalFrames
    0036 %               Non-negative integer.  Many codecs make it difficult or
    0037 %               impossible to read the last few frames of a file.  When
    0038 %               videoReader thinks that the last few cannot be read, it
    0039 %               automatically guesses how many frames cannot be read,
    0040 %               records this number as nHiddenFinalFrames, and sets
    0041 %               numFrames to be the number of frames the file claims to
    0042 %               contain minus nHiddenFinalFrames.  An individual
    0043 %               videoReader plugin (like the ffmpegPopen2 plugin) may choose
    0044 %               to allow the user to try reading the frames that might be
    0045 %               hidden or it may choose not to allow even trying to read
    0046 %               them (like the DirectShow plugin).
    0047 %
    0048 %  Due to limitations in some file formats, it is not always possible to
    0049 %  determine all of these values (or sometimes they are not constant).  In
    0050 %  these cases, numerical values are given a value of NaN and string values
    0051 %  are blank.
    0052 %
    0053 %SEE ALSO
    0054 %  videoReader
    0055 %
    0056 %Copyright (c) 2006 Gerald Dalley
    0057 %See "MIT.txt" in the installation directory for licensing details (especially
    0058 %when using this library on GNU/Linux).
    0059
    0060 %info = feval(vr.plugin, 'getinfo', vr.handle);
    0061
    0062 [names, vals] = feval(vr.plugin, 'getinfo', vr.handle);
    0063 info = cell2struct({vals{:}}, {names{:}}, 2);