X video extension

From Wikipedia, the free encyclopedia

The X video extension, often abbreviated as XVideo or Xv, is a video output mechanism for the X Window System. Its main use today is to rescale video playback in hardware (namely in the hardware of the graphics card), in order to enlarge a given video or to watch it in full screen mode. Without XVideo, this scaling would have to be done in software, which is possible but requires a considerable amount of processing power, sometimes to the point of slowing down/degrading the video stream. Similarly, the X video extension has the graphics card perform color space conversions. It can also be used to change contrast, brightness and hue of a displayed video stream in hardware, again saving processing power.

In order for this to work, three things have to come together:

  • The graphics card hardware has to provide the required functions.
  • The device driver software for the graphics card and the X server program have to support the XVideo interface.
  • The video playback software has to make use of this interface.

Most modern graphics cards provide the functions required for XVideo; the feature is known as hardware scaling and YUV acceleration or sometimes as 2D hardware acceleration.

The XFree86 X server supports XVideo since version 4.0.2. To check whether a given X server supports XVideo, one can use the utility xdpyinfo. To check whether the attached graphics card provides the required functions and whether the X device driver supports XVideo, one can use the xvinfo program.

Video playback programs that run under the X Window system, such as MPlayer or xine, typically have an option to enable XVideo output. It is very advisable to switch on this option if the system supports XVideo - the speedup is very noticeable even on a fast CPU.

While the protocol itself has features for reading and writing of video streams from and to video adapters, in practice today only the functions XvPutImage and XvShmPutImage are used: the client program repeatedly prepares images and passes them on to the graphics hardware to be scaled, converted and displayed.

XVideo often uses hardware overlays, and therefore it is often not possible to produce proper screenshots of Xvideo applications or to view them on a secondary display. Some drivers (such as recent Intel and nVidia drivers) use the 3D hardware capabilities of the hardware and draw the video as a texture, removing the downsides of hardware overlays.

The protocol was designed by David Carver; the specification for version 2 of the protocol was written in July 1991.

[edit] See also

  • XvMC - X-Video Motion Compensation
  • MIT-SHM - The MIT Shared Memory Extension

[edit] External links