Skip to content

Recipes, part 5: a short video in each step - #97

Merged
pietrangelo merged 2 commits into
mainfrom
claude/project-thread-m3jzg5
Nov 1, 2026
Merged

pietrangelo merged 2 commits into
mainfrom
claude/project-thread-m3jzg5

Conversation

@pietrangelo

Copy link
Copy Markdown
Owner

Part 5 of 6 of the recipes plan: each preparation step can carry one short MP4 clip.

What changes

  • Domain (schema_dynamic_content): PreparationStep.video. On the wire a step stays flat, [text, blob, caption, ..., video?], where an odd trailing element is the video. A step that is only a video is valid, and a blob counts once across pictures and videos.
  • Video (blob_storage_media):
    • VideoProbe accepts only non-fragmented MP4, up to 21 MiB, 61 s and 8192 px.
    • VideoScrubber rewrites the file from an allowlist of boxes. It keeps only the vide and soun tracks, zeroes the samples of every other track (text or GPS tracks), zeroes the times and rewrites the stco/co64 offsets. It is idempotent and gives the same output whether moov comes before or after mdat.
    • VideoStorage seals the clip and re-probes it on open. RecordedNote is codec v6, with videos.
  • App:
    • A Video menu on each step: record (not on the web) or choose a clip of at most 60 s.
    • The clip opens in a viewer, and cooking mode has «Guarda il video».
    • Playback goes through a private temporary file that is overwritten with zeros and deleted on close, and the folder is swept at startup. On the web the video stays in memory.
  • Publishing and serv.pub:
    • Step videos are published only with «Includi immagini». They are scrubbed again before upload, and uploaded media the document doesn't use are deleted.
    • The server adds MediaType::Mp4 and Step.video, renders <video controls playsinline preload="metadata">, and answers Range requests on media (206 and 416), which Safari needs to play video.

Tests

  • App: 801 tests pass (flutter test) and flutter analyze is clean.
  • Packages:
    • schema_dynamic_content: 253 pass.
    • blob_storage_media: 156 pass, including scrubbing ffmpeg fixtures that carry a location, a title and a GPS text track, plus a fuzz test.
    • publishing: 89 pass.
    • offline_sync: 321 pass.
    • offline_sync_adapters: 95 pass.
    • architecture_guard: 20 pass.
  • Server: cargo test, fmt, clippy (native and wasm32) and the serv.pub e2e all pass.

Known limits

  • While a video is open, its decrypted copy exists in the app's cache.
  • An older app sees recipes with videos as unreadable.

Generated by Claude Code

Each preparation step can carry one short MP4 clip (at most 60 s,
21 MiB). The clip is rewritten from an allowlist of boxes before it is
encrypted: location, title, encoder, times and non audio/video tracks
are dropped. The app records or picks a clip, plays it from a private
temporary file that is wiped on close and at startup (in memory on the
web), and shows it in cooking mode. Publishing sends step videos to
serv.pub, which renders them in the recipe page and serves media with
Range requests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rvr6HJwgZKVC2FvU1Tmgyp
A TLS connect error on downloads.xiph.org failed the verify job before
any test ran. curl now retries up to five times; the hash is still
compared exactly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rvr6HJwgZKVC2FvU1Tmgyp
@pietrangelo
pietrangelo marked this pull request as ready for review November 1, 2026 11:48
@pietrangelo
pietrangelo merged commit 9d2ea09 into main Nov 1, 2026
11 checks passed
@pietrangelo
pietrangelo deleted the claude/project-thread-m3jzg5 branch November 1, 2026 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants