﻿# Video colorimetry at inference handoff: preserve range and matrix interpretation

Video colorimetry at inference handoff: preserve range and matrix interpretation. A practical streaming-video guide with failure mechanisms, a controlled scenario, acceptance evidence and primary references.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/sv-colorimetry-range-inference-preprocessing/
Language: en

A stream changes its declared color interpretation while retaining the same dimensions. The inference adapter reuses an earlier conversion and changes pixel meaning without any tensor-shape error.

## The media mechanism

Pixel layout, color range, transfer characteristics and conversion matrix are separate parts of media interpretation. A matching RGB output shape cannot prove that the source colors were decoded under the intended contract.

## Establish the pipeline boundary

Record color range and matrix interpretation with the negotiated pixel format. Identical YUV sample numbers can represent different RGB values under different declared conversions, even when dimensions and plane layouts are unchanged.

Use permitted reference patches near black, white and saturated colors. Compare the actual model input after conversion, resizing and normalization, rather than a preview player that may apply its own color management.

Pin which component supplies missing color information and whether that fallback is supported for the source. Unknown metadata should not silently inherit a previous camera's settings. Test a metadata-only transition and keep the earlier preprocessing generation attached to in-flight results. Acceptance establishes the chosen conversion contract, not that every camera's declared metadata is physically calibrated or that the model remains equally accurate under a changed scene illumination.

## A constructed failure case

Feed identical stored sample values under deliberately different declared color contracts. The checker must distinguish representation interpretation from array shape and show which conversion reaches the model.

## A practical validation procedure

Pin negotiated color metadata and converter settings. Compare permitted reference color patches through the complete preprocessing path, including a format transition. Reject unknown interpretations or record an explicit supported assumption instead of silently inheriting defaults.

Keep an unchanged control and a deliberate failure case. Change the relevant setting or interruption independently, then compare observed frame identities and state transitions. Measure through recovery as well as the first error; a restarted worker can retain obsolete results or references.

## Evidence for acceptance

Keep color metadata, converter identity and reference-patch output comparisons.

## Recovery and limits

Matching a color fixture does not establish accuracy on every sensor or illumination condition.

Define whether recovery drains, discards or isolates pending frames before resuming ordinary service. Preserve compact diagnostic identities and the fixture configuration. Avoid treating a new connection or a live process as proof that previous in-flight work has finished safely.

## References and interpretation

Primary references: [GStreamer video information and colorimetry](https://gstreamer.freedesktop.org/documentation/video/video-info.html); [GStreamer capability negotiation](https://gstreamer.freedesktop.org/documentation/additional/design/negotiation.html).

This is a proposed operational validation, not an executed Retrivium benchmark. Documentation defines interfaces and supported behavior; the actual pipeline needs its own evidence. Repeat the check after relevant plugin, decoder, source or preprocessing changes.

## Related reading

Continue with [MobileViT preprocessing: preserve BGR channel values across export boundaries](/journal/fg2-mobilevit-bgr-channel-order-export/); [Mapped video planes: preserve row padding when building an inference input](/journal/sv-mapped-video-planes-padding-stride/). Their adjacent context does not replace the specific frame-flow acceptance check described here.
