HVD
HVD Hardware Video Decoder library
hvd_config Struct Reference

Decoder configuration. More...

#include <hvd.h>

Data Fields

const char * hardware
 hardware type for decoding, e.g. "vaapi"
 
const char * codec
 codec name, e.g. "h264", "vp8"
 
const char * device
 NULL / "" or device, e.g. "/dev/dri/renderD128".
 
const char * pixel_format
 NULL / "" for default or format, e.g. "rgb0", "bgr0", "nv12", "yuv420p".
 
int width
 0 to not specify, needed by some codecs
 
int height
 0 to not specify, needed by some codecs
 
int profile
 0 to leave as FF_PROFILE_UNKNOWN or profile e.g. FF_PROFILE_HEVC_MAIN, ...
 

Detailed Description

Decoder configuration.

The hardware can be one of:

  • vaapi
  • vdpau
  • dxva2
  • d3d11va
  • videotoolbox

The device can be:

  • NULL (select automatically)
  • point to valid device e.g. "/dev/dri/renderD128" for vaapi

The codec (should be supported by your hardware):

  • h264
  • hevc
  • vp8
  • vp9
  • ...

The pixel_format is format you want to receive data in. Only hardware conversions are supported. If you select something unsupported by hardware, the library will dump for you list of supported pixel formats to standard error. From my experience even those reported are not supported in all scenarios.

Typical examples:

  • nv12
  • yuv420p (this is generally safe choice)
  • rgb0
  • bgr0
  • ...

For pixel format explanation see: FFmpeg pixel formats

You typically don't have to specify width, height and profile (leave as 0) but some codecs need this information.

For width and height the decoder may overwrite your values while parsing the data. It is not safe to assume that width/height of decoded frame matches what you supplied.

For possible profiles see: FFmpeg profiles

For H.264 profile can typically be:

  • FF_PROFILE_H264_CONSTRAINED_BASELINE
  • FF_PROFILE_H264_MAIN
  • FF_PROFILE_H264_HIGH
  • ...

For HEVC profile can typically be:

  • FF_PROFILE_HEVC_MAIN
  • FF_PROFILE_HEVC_MAIN_10 (10 bit channel precision)
  • ...
See also
hvd_init

The documentation for this struct was generated from the following file: