How to create an Encoding using hardware-acceleration

Overview

Hardware-acceleration is a mechanism to leverage hardware capabilities for specific use cases. This usually results in increased efficiency or faster processing times in comparison to software processing on general-purpose hardware.

Specifically, we integrated hardware-acceleration through GPU-acceleration with NVIDIA T4 GPUs on Amazon EC2 G4dn instances (see Blog post about GPU Acceleration for Cloud Video Encoding).

📘

Recommendation: short form video content

Hardware-acceleration is recommended for short form video content of up to 5 minutes in length. Please also refer to How to reduce short form video content turnaround times.

Requirements

  • Open API SDK v1.179.0+
  • Encoder version v2.180.0+
  • VoD encoding only, not live
  • output video codecs must be H264/AVC or H265/HEVC
  • Supports only pixel formats YUV420 (input) to YUV420 (output)
  • Works only on AWS regions (Managed cloud and Cloud Connect)
  • Note: audio is not affected by hardware-acceleration

🚧

Fail-fast for incompatible encoding configurations

An encoding will fail with a "Hardware encoding unsupported configuration" message when the configuration is incompatible with the requirements and known limitations.

Known Limitations

The following features are not compatible with hardware/GPU-acceleration:

  • no video filters
  • no PerTitle
  • no Dolby Vision
  • no Forensic Watermark
  • no BurnIn Subtitle
  • no Thumbnails
  • no PSNR
  • no Multi Pass

Start an Encoding using hardware-acceleration

To make use of hardware-acceleration, the preset VOD_HARDWARE_SHORTFORM for H264/AVC or H265/HEVC must be selected.

Bitmovin API SDK for Java Example: (API-Reference | Github)

Encoding encoding = new Encoding();
encoding.setEncoderVersion("STABLE");

//Make sure to use AWS
encoding.setCloudRegion(CloudRegion.AWS);

...
//your encoding configurations...
...

//Create codec configuration with a hardware-acceleration preset
H264VideoConfiguration h264VideoConfiguration = new H264VideoConfiguration();
h264VideoConfiguration.setName("Your first CodecConfig with hardware-acceleration");
h264VideoConfiguration.setPresetConfiguration(PresetConfiguration.VOD_HARDWARE_SHORTFORM);
h264VideoConfiguration.setProfile(ProfileH264.HIGH);
h264VideoConfiguration = bitmovinApi.encoding.configurations.video.h264.create(h264VideoConfiguration);

...
//your encoding configurations...
...

//Start an Encoding with StartEncodingRequest Configuration
StartEncodingRequest startEncodingRequest = new StartEncodingRequest();
bitmovinApi.encodings.start(encoding.getId(), startEncodingRequest);