Skip to content

Device attributes

hipersayanX edited this page Dec 6, 2018 · 3 revisions

Virtual devices provide some useful attributes (through sysfs) that you can use to interact with the driver. You can find this attributes at /sys/devices/virtual/video4linux/videoX/controls where X is the number assigned to the device, the same as in /dev/videoX. You can read the attributes with cat, and write them with echo (you need root privileges for doing this).

RO: Read Only
RW: Read and Write

For capture devices

  • connected_devices RO: List of output devices connected to this device.
  • broadcasters RO: List of devices sending frames to this device.
  • modes RO: List of supported capture modes.

This attributes are direct mapping of V4L2 controls:

  • brightness RW: Change the brightness of the picture.
  • contrast RW: Change the contrast of the picture.
  • saturation RW: Change the color saturation of the picture.
  • hue RW: Rotate the color palette of the picture.
  • gamma RW: Apply gamma correction to the picture.
  • hflip RW: Flip the picture horizontally.
  • vflip RW: Flip the picture vertically.
  • colorfx RW: Apply some effects to the image. Possible values: None, Black & White.

For output devices

  • connected_devices RO: List of capture devices connected to this device.
  • listeners RO: List of devices capturing frames from this device.
  • modes RO: List of supported output modes.

This attributes are direct mapping of V4L2 controls:

  • hflip RW: Flip the picture horizontally.
  • vflip RW: Flip the picture vertically.
  • aspect_ratio RW: Change the way in which the frames fits in the capture devices. Possible values: Ignore, Keep, Expanding.
  • scaling RW: Change the scaling filter. Possible values: Fast, Linear.
  • swap_rgb RW: Swap red and blue channels.
Clone this wiki locally