Skip to content

How it works

Bartosz Meglicki edited this page Jan 8, 2020 · 14 revisions

Program structure

  • process user input (width, height, framerate, depth units, time to capture)
  • init file for raw HEVC output
  • init Realsense D400 device
  • init VAAPI encoder with HVE
  • read depth data from the camera
  • encode to HEVC Main10 profile
  • write to raw HEVC file
  • cleanup

The encoding

Realsense and VAAPI devices are configured to work together (no software depth processing on the host)

  • VAAPI is configured for HEVC 10 bit per channel P010LE pixel format
  • Realsense is configured to ouput P016LE (Y plane) compatible depth data
  • P016LE data is binary compatible with P010LE data
  • the data output by Realsense is directly fed to VAAPI hardware encoder
  • the P010LE color data is filled with constant value
Pixel format Side Side
MSB 15 14 ... 7 6 5 4 3 2 1 0 LSB
P016LE x x ... x x x x x x x x
P010LE x x ... x x 0 0 0 0 0 0

The P010LE has data only in 10 MSB, zeroes in 6 LSB (ignored values).

We have 10 bits to encode 16 bit Realsense depth data which means range/precission trade-off:

  • the trade-off is controlled with Realsense Depth Units (0.0001 - 0.01)
  • the best precision/worst range is 6.4 mm/6.5472 m (for Depth Units 0.0001)
  • the worst precission/best range is 64 cm/654.72 m (for Depth Units 0.01)
  • all trade-offs in between are possible

For range: 65472 in binary is 10 ones followed by 6 zeroes.
For precision: we discard 6 bits of data (64 times worse precision than set in Depth Units).

Clone this wiki locally