Convert an input video to HDR

This page explains how to convert the input video in a transcoding job to a supported high dynamic range (HDR) or standard dynamic range (SDR) format. The Transcoder API uses high-efficiency video coding (HEVC) as the primary codec for the color conversion. Passthrough is enabled by default if you don't specify a color conversion format.

Color conversion formats

HEVC is the primary codec used for the supported color conversion formats, which include the following:

  • Hybrid log-gamma (HLG)
  • SDR
  • HDR10

For H.264 and VP9 streams, only HLG and SDR are supported. All conversions between the supported codec and the preceding color formats are supported.

Passthrough

Passthrough is enabled by default if you don't specify a color conversion format.

For passthrough, the Transcoder API honors the input color primaries, transfer function, range, chroma location, and color space; no color conversion is done in the process. If the input is HDR10 (or HDR10+) and HEVC, the Transcoder API also passes the metadata through to the output video.

If you specify an output codec that does not support the input's color format, the passthrough is best effort. For example, an input HDR10 video has 10-bit options for profile and pixelFormat. If you specify the output as H.265 with an 8-bit option for profile, the output is not a valid HDR10 video because HDR10 does not work with an 8-bit option for profile.

Example conversions

To specify the color conversion format, use an empty hlg, hdr10, or sdr object. The following sections show the JSON object to add to a VideoStream to perform a given conversion.

Convert to HLG format

Use the hlg object to convert an input video to HLG format.

"elementaryStreams": [
  {
    "key": "video_hlg",
    "videoStream": {
      "h264": {
        "heightPixels": 720,
        "widthPixels": 1280,
        "bitrateBps": 5000000,
        "frameRate": 25,
        "hlg":{}
    }
  }
]

Convert to HDR10 format

Use the hdr10 object to convert an input video to HDR10 format.

"elementaryStreams": [
  {
    "key": "video_hdr10",
    "videoStream": {
      "h265": {
        "heightPixels": 720,
        "widthPixels": 1280,
        "bitrateBps": 5000000,
        "frameRate": 25,
        "pixelFormat":"yuv420p10",
        "profile":"main10",
        "hdr10":{}
    }
  }
]

Down-convert to SDR format

Use the sdr object to down-convert an input video to SDR format.

"elementaryStreams": [
  {
    "key": "video_sdr",
    "videoStream": {
      "h264": {
        "heightPixels": 720,
        "widthPixels": 1280,
        "bitrateBps": 5000000,
        "frameRate": 25,
        "sdr":{}
    }
  }
]

Possible errors

If the Transcoder API cannot perform the conversion, the transcoding job fails. Possible errors include the following:

  • Conversion to HDR10 format with 8-bit pixel formats or profiles
  • SDR inputs that don't conform to BT.709