Skip to content

B6: colour-managed .fled playback does not decode the file's declared color (video.color never reaches the source profile) #4460

Closed

Description

@zackees

Problem

B6's behaviour half — "CM-enabled .fled playback goes through sRGB decode" — is not implemented.

  • P4 (Color pipeline P4: .fled color metadata and rgb16_linear #4038) carries, validates and exposes video.color (Fled::videoColor(), PixelStream, Video::videoColor()). It explicitly left "playback honoring the profile colorimetrically" to P6.
  • P6 (Color pipeline P6: embedded streaming pipeline core #4040) lists B6's behaviour half under "Decisions implemented", but nothing connects the resolved tuple to a channel.
  • A colour-managed channel interprets its pixels through its source profile, ChannelOptions::setColorProfile(profile) → SourceProfile::linearSrgb() or FastLED.defaultSourceProfile(). The default is also linear sRGB.

So an ordinary display-encoded .fled, whose default tuple is {bt709, srgb}, played on a colour-managed channel is treated as linear light. Mid-tones come out far too bright: an sRGB 128 is read as 50% light instead of about 22%.

Workaround (documented in src/fl/fled/FLED_FORMAT.md → "Playback with and without colour management (B6)")

FastLED.setDefaultSourceProfile(fl::SourceProfile::srgbBt709());

Fix direction (a design choice, so filed rather than guessed)

Map a resolved fled::VideoColor to a SourceProfile, for the named primaries and transfers and for custom primaries. Then decide how playback applies it:

  • Video sets the source profile of the channels it drives;
  • or it exposes Video::sourceProfile() for the sketch to bind;
  • or FastLED.setDefaultSourceProfile follows the most recent file.

The choice affects sketches that play several files, or mix video with generated content (B8).

Done when

A colour-managed channel playing a .fled decodes it with the file's declared tuple, or the absent-metadata default, and a test proves it for sRGB, linear (rgb16_linear) and a non-sRGB primaries declaration.

Part of #4034. Found while writing P10's legacy/B6 documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions