Video HDR

Capturing Videos in High-Dynamic-Range (HDR) with HLG/HDR encodings and 10-bit

Video HDR captures Frames in a higher dynamic range, which allows much brighter highlights and deeper shadows.

Enable Video HDR

To enable Video HDR, pass a { videoDynamicRange: ... } constraint in your constraints. The CommonDynamicRanges export defines a few commonly used Dynamic Ranges such as ANY_SDR or ANY_HDR:

function App() {
  const device = ...

  return (
    <Camera
      style={StyleSheet.absoluteFill}
      isActive={true}
      device={device}
      constraints={[
        { videoDynamicRange: CommonDynamicRanges.ANY_HDR }
      ]}
    />
  )
}
function App() {
  const device = ...

  const camera = useCamera({
    isActive: true,
    device: device,
    constraints: [
      { videoDynamicRange: CommonDynamicRanges.ANY_HDR }
    ]
  })
}
const session = ...
const device = ...

const controllers = await session.configure([
  {
    input: device,
    outputs: [],
    constraints: [
      { videoDynamicRange: CommonDynamicRanges.ANY_HDR }
    ]
  }
], {})

The CameraSession internally negotiates the { videoDynamicRange: ... } constraint with other enabled constraints and all connected CameraOutputs to find a best-matching supported combination on this device.

Tip

To check if Video HDR is supported with your specific combination of constraints and outputs upfront, use isSessionConfigSupported(...).

Custom Dynamic Ranges

For a custom TargetDynamicRange, pass the dynamic range as an object directly. - for example, to try using 'apple-log' in 10-bit:

[
  {
    videoDynamicRange: {
      bitDepth: 'hdr-10-bit',
      colorSpace: 'apple-log',
      colorRange: 'full'
    }
  }
]

Implementation details

Video HDR is implemented in four different ways, possibly combined.

Higher Bit-Depth

Some Video HDR pipelines capture Frames with a higher bit-depth (10-bit instead of 8-bit) allowing for a wider color-spectrum.

Bit DepthDifferent ColorsMaximum Brightness
8-bit256~100 nits
10-bit1024~1000-4000 nits

Different Transfer Function

Video SDR (standard dynamic range) uses a simple gamma curve for color mapping (e.g. BT.1886), which is limited in brightness range.

Video HDR often use a different transfer functions - often PQ (HDR10/Dolby) or HLG, which fundamentally changes how brightness is encoded.

Different Color Spaces

The transfer functions often also affect color-spaces - while Video SDR typically uses 'srgb', an HDR pipeline uses a wider color-space like 'hlg-bt2020'.

Extended Dynamic Range

Many Apple devices support capturing video using "Extended Dynamic Range", which internally doubles Video Frame Rate (see "FPS") to capture an under-exposed, an over-exposed and a regularly-exposed Frame in one go and fuses them together to create a more widely-exposed Frame - this is similar to how "Photo HDR" works.