feat(media): shade live record — a broadcast to files, or to a sealed film with its own link
`live record <link> [-o base] [--put --server URL]` writes what a channel carries until the channel ends or Ctrl-C: - text goes to base.txt; - video and sound go to base.webm or base.mp4: the init, then every chunk in the order sent. A chunk that arrives late is left out and counted. A new init continues in base-2.…; - pictures go to base-images/. ffmpeg then rewrites each recording with -c copy, which adds an index for seeking and starts the clock at 0:00. `--put` seals and uploads the recording under the channel's name (several files become an album). LiveRecorder is exported from @shade/media/node. `live video` now sends a sticky meta frame like text and picture channels do. The browser and Android players ignore it. Verified against a real relay: - A 30 s VP8/Opus broadcast was recorded and is 29–32 s long, starting at 0. - It was uploaded as "Kveldssending.webm" and plays in Chromium, with a seek to 22 s (frame 14). - Live playback with the meta frame still plays, with 2.4 s latency. Tests: - object-store's memory test now runs in its own process. RSS is process-wide, and other test files in the same `bun test` made it flaky (192 MiB). It now compares memory held after a collection at 128 MiB and 512 MiB, ~85 vs ~103 MiB, instead of using a magic number. - The sweep test has its own prefix. - tests/live-record.test.ts (4). - media 122 green, 3 runs in a row. All 27 packages type-check. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -78,6 +78,11 @@ New package **`@shade/media`** — see `docs/media.md`.
|
||||
media id (sealed copy and job under `$XDG_CONFIG_HOME/shade/media-pending/`),
|
||||
and a file already up gives its link again instead of a second copy. Above all, a relay's
|
||||
memory no longer grows with the film (see Fixed).
|
||||
- **`shade live record <link>`**: a channel to files until it ends: text,
|
||||
seekable WebM/MP4 (ffmpeg `-c copy`, clock from 0:00), pictures. `--put`
|
||||
seals and uploads the recording under the channel's name, so a broadcast
|
||||
can be watched later (`LiveRecorder` in `@shade/media/node`). `live
|
||||
video` now sends its name as a sticky `meta` frame like the other kinds.
|
||||
- **`shade live video --input`** a film, `/dev/video0` or `rtsp://…`: ffmpeg is
|
||||
run for you, H.264/AAC copied (a camera's own encoder) and anything else
|
||||
encoded to H.264 (keyframe every 2 s) and AAC, as low-latency fMP4.
|
||||
|
||||
Reference in New Issue
Block a user