Skip to content

docs(video): document the .fled container format (video, screenmaps, future scripts) in fl/video/ + agents/docs/ #3310

Closed

Description

@zackees

Scope update (2026-06-19): This issue is now a sub-issue of #3311 (the fl::Fled bundle subsystem umbrella). The .fled container is no longer just a video-side concern — it's the deployment unit for the whole fled subsystem (video + screenmap + channels + scripts). Doc path retargeted from src/fl/video/FLED_FORMAT.md → src/fl/fled/FLED_FORMAT.md. The "future scripts" forward-roadmap note in the original framing is now in-scope umbrella work tracked by #3311.

Problem

The .fled container format is a FastLED native — produced by zackees/ledmapper (the Mapped Video Maker / Movie Player web app) and consumed by FastLED on-device — but the FastLED repo has no documentation of the format. A consumer working in src/fl/fled/ (or src/fl/video/) today has to reverse-engineer the on-disk layout from gfx-fled.ts / inspect-fled.mjs in ledmapper, or stumble onto ledmapper's docs/fled-format.md by accident.

This is a documentation-only issue. The format itself is stable (v1); the spec lives in ledmapper; FastLED just needs to mirror it locally under the new src/fl/fled/ subtree (per #3311) and surface it to agents.

What .fled is

A self-describing container for LED data:

  • 12-byte binary header (magic FLED, version, pixel_format, json_length)
  • UTF-8 JSON payload carrying a ScreenMap (so a video and its physical LED geometry stay paired in one file) plus optional video.fps
  • Raw frame payload — frame_count × ledCount × bytesPerLed

Today the container holds video (rgb8/gray8/rgba8/rgbw8/rgb565le pixel formats) bundled with screenmaps. The format is designed to grow — the pixel-format enum has 250 reserved values (0x05–0xFF) and the JSON envelope can carry additional sections for future content types (e.g. channels, script.micropython, script.wasm). Per #3311, the next sections to land in the envelope are channels (fl::MultiChannelConfig JSON) and the script-carrying sections.

Canonical spec: zackees/ledmapper/docs/fled-format.md
Reference inspector: zackees/ledmapper/scripts/inspect-fled.mjs

What to add (this issue's scope)

1. src/fl/fled/FLED_FORMAT.md — detailed local doc

Mirror the canonical spec in the FastLED repo so on-device consumers (sketches, library devs, agents working in src/fl/fled/ or src/fl/video/) can find it without leaving the repo. Recommended structure:

  • One-paragraph "what is .fled" intro.
  • Verbatim or near-verbatim copy of the v1 binary layout table + pixel-format enum table from ledmapper's spec.
  • "Authority" callout: the canonical spec is in ledmapper; if the two ever disagree, ledmapper wins because it's the producer. This doc is a convenience mirror.
  • Cross-link to inspect-fled.mjs for diagnostic / dump tooling.
  • "Future" section noting that the pixel-format enum and JSON envelope are designed to grow:

2. src/fl/fled/README.md — MUST link to FLED_FORMAT.md at the top

The fl/fled/ subtree's README is created as part of the umbrella work in #3311. The very first content block of that README MUST be a link to FLED_FORMAT.md so anyone landing on the subtree finds the on-disk format spec immediately. Wording suggestion:

# fl::Fled

> **On-disk format spec:** [FLED_FORMAT.md](./FLED_FORMAT.md) — the binary header + JSON envelope + section layout. Canonical spec lives in [zackees/ledmapper](https://github.com/zackees/ledmapper/blob/main/docs/fled-format.md); this is the local mirror.

<rest of README>

This is non-negotiable: the spec link is the first thing on the page, not buried below an intro paragraph.

3. Update src/fl/video/README.md if one exists, or add a short header to src/fl/video/_build.cpp.hpp / video_impl.h referencing the new FLED_FORMAT.md

src/fl/video/ is the legacy landing page for .rgb / .fled consumers and stays in use. Add a one-line "the .fled container format is documented in ../fled/FLED_FORMAT.md" reference wherever a video-side reader would naturally land.

4. Brief summary in agent documentation

Add a 5-10 line entry to one of:

  • agents/docs/cpp-standards.md under a new "On-device video / .fled format" subsection, OR
  • A new short agents/docs/fled-format.md linked from the index table at the top of CLAUDE.md

The summary should answer:

If adding to CLAUDE.md, the natural row is in the "By directory" line — append src/fl/fled/ → agents/docs/fled-format.md (or wherever the brief lands).

5. Optional: add inspect-fled.mjs equivalent to FastLED

Not in scope for this issue, but worth noting: a Python ci/inspect_fled.py or shell bash fled inspect <file> wrapper would let on-device test setups validate .fled payloads without depending on Node. Defer to a follow-up if useful.

Out of scope

Refs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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