Main Content


Identify image acquisition device represented by video input object


The DeviceID property identifies the device represented by the video input object.

A device ID is a number, assigned by an adaptor, that uniquely identifies an image acquisition device. The adaptor assigns the first device it detects the identifier 1, the second device it detects the identifier 2, and so on.

You must specify the device ID as an argument to the videoinput function when you create a video input object. The object stores the value in the DeviceID property and also uses the value when constructing the default value of the Name property.

To get a list of the IDs of the devices connected to your system, use the imaqhwinfo function, specifying the name of a particular adaptor as an argument.



Read only

Data type



Any nonnegative integer


Use the imaqhwinfo function to determine which adaptors are connected to devices on your system.


ans = 

    InstalledAdaptors: {'matrox'  'winvideo'}
        MATLABVersion: '7.4 (R2007a)'
          ToolboxName: 'Image Acquisition Toolbox'
       ToolboxVersion: '2.1 (R2007a)'

Use the imaqhwinfo function again, specifying the name of the adaptor, to find out how many devices are available through that adaptor. The imaqhwinfo function returns the device IDs for all the devices in the DeviceIds field.

info = imaqhwinfo('winvideo')

info =

       AdaptorDllName: [1x73 char]
    AdaptorDllVersion: '2.0 (R2006a+)'
          AdaptorName: 'winvideo'
            DeviceIDs: {[1]}
           DeviceInfo: [1x1 struct]

See Also