Store video colour transfer at scan time instead of probing per conversion

Author: derneuereCreated Sep 16, 2026Updated Sep 16, 2026
Labelsenhancementbackend

Summary

Record a video's colour transfer characteristic at scan time instead of probing it on every conversion. Follow-up to #2044 (fixes #455).

Current behaviour after #2044

apps/backend/api/video_color.py runs one uncached ffprobe per transcode, cached copy, poster frame and animated thumbnail to read color_transfer, and only applies the tonemap chain for PQ (smpte2084) and HLG (arib-std-b67) sources. On a large video library that is one extra process spawn per conversion.

Proposed change

  • Add a nullable color_transfer field to the video metadata captured during scan (the scan already runs a probe for duration and dimensions), with a migration.
  • video_color reads the stored value when present and falls back to the live probe otherwise, so existing rows keep working until a rescan or metadata refresh fills them in.
  • Expose the value on the photo serializer so the frontend can show an HDR badge on video tiles, which users have asked for in the #365 thread.

Also worth a maintainer decision

The tonemap operator is hable. mobius keeps more contrast on some material and reinhard is flatter. Pick one deliberately or make it a setting.