DXVA2_VideoProc Sample

Shows how to use DXVA Video Processing.

This sample programmatically generates video with a primary stream and a substream. The primary stream displays SMPTE color bars, and the substream is a semi-transparent rectangle. The video is then processed and displayed using a DXVA video processor. The user can change the planar alpha values, source and destination rectangles, color adjustments, and color space.

Screenshot of the DXVA2_VideoProc sample

APIs Demonstrated

This sample demonstrates the following DXVA interfaces:

Usage

The DXVA2_VideoProc sample builds a Windows application.

Command line options:

OptionDescription
-hhForces the application to use a hardware Direct3D device and a hardware DXVA device.
-hsForces the application to use a hardware Direct3D device and a software DXVA device.
-ssForces the application to use a software Direct3D device and a software DXVA device.

 

Keyboard commands:

KeyDescription
ALT+ENTERSwitch between windowed mode and full-screen mode.
F1–F8Enter one of the modes shown in the following table.
ENDEnable or disable debugging logging for dropped frames.
HOMEReset a parameter to its initial value.

 

Each of the function keys F1 through F8 switches to a mode in which the arrow keys can be used to adjust a particular rendering parameter. In addition, the color of the substream changes.

KeyDescription
F1

Adjust the alpha values.

  • UP: Increase the planar alpha of both streams.
  • DOWN: Decrease the planar alpha of both streams.
  • RIGHT: Increase the pixel alpha of the substream.
  • LEFT: Decrease the pixel alpha of the substream.

Substream color: White

F2

Adjust the primary stream's source area (zoom).

  • UP: Increase vertically (zoom in).
  • DOWN: Decrease vertically (zoom out).
  • RIGHT: Increase horizontally (zoom in).
  • LEFT: Decrease horizontally (zoom out).

Substream color: Red

F3

Move the primary stream's source area.

  • UP: Move up.
  • DOWN: Move down.
  • RIGHT: Move right.
  • LEFT: Move left.

Substream color: Yellow

F4

Adjust the primary stream's destination area.

  • UP: Increase vertically.
  • DOWN: Decrease vertically.
  • RIGHT: Increase horizontally.
  • LEFT: Decrease horizontally.

Substream color: Green

F5

Move the primary stream's destination area.

  • UP: Move up.
  • DOWN: Move down.
  • RIGHT: Move right.
  • LEFT: Move left.

Substream color: Cyan

F6

Change background color or color space.

  • UP, DOWN: Cycle through color spaces.
  • RIGHT, LEFT: Cycle through background colors.

Substream color: Blue

F7

Adjust brightness and contrast.

  • UP: Increase brightness.
  • DOWN: Decrease brightness.
  • RIGHT: Increase contrast.
  • LEFT: Decrease contrast.

Substream color: Magenta

F8

Adjust hue and saturation.

  • UP: Increase hue.
  • DOWN: Decrease hue.
  • RIGHT: Increase saturation.
  • LEFT: Decrease saturation.

Substream color: Black

 

In each mode, pressing the HOME key resets the parameters for that mode to their initial values.

Requirements

ProductVersion
Windows SDKWindows 7

 

Downloading the Sample

This sample is available in the following locations.

LocationPath/URL
Windows SDKSDK Root\Samples\multimedia\mediafoundation\dxva2_videoproc

 

Related topics

DirectX Video Acceleration 2.0
DXVA Video Processing
Media Foundation SDK Samples

 

 

Show: