feat(media): shade live images — a webcam, a slideshow or a watched folder, end to end
Pictures were a live content type the watch page could show but nothing could publish. `shade live images`: - stdin: back-to-back JPEG/PNG, e.g. `ffmpeg -f v4l2 -i /dev/video0 -r 1 -c:v mjpeg -f image2pipe -`; - files/directories: a slideshow, one picture every --every seconds; - --watch DIR: each new picture once its size holds still (cameras write in pieces). Each picture is a keyframe, so a late viewer opens on the latest. The meta carries the first picture's type (MIME_RE rightly refuses image/*). ImageStreamSplitter walks JPEG markers (lengths to SOS, then the entropy-coded data, where every 0xFF is stuffed) and PNG chunks to IEND, so an EXIF thumbnail — a whole JPEG inside APP1 — does not end a picture. Bounded at 16 MiB per picture, junk refused at its first bytes. The Android demo shows live picture channels and sealed pictures (decoded off the UI thread, downsampled to the screen). Verified: splitter on real ffmpeg MJPEG/PNG under random pipe chunking, the thumbnail case, truncation, junk and the size cap (4 tests); in Chromium a 2 fps MJPEG "webcam" through the relay (8 → 14 pictures in 3 s, 960×540); a watched folder with a PNG written in two halves (sent once, whole) and a .txt ignored; slideshow; error paths. Demo APK builds; not run on a device (none connected). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 211 KiB |
@@ -9,3 +9,4 @@
|
||||
09 — To relay-instanser bak en round-robin-lastbalanserer deler ett bibliotek (filmbytes i S3, poster i Postgres): opplastet via den ene, spilt og spolt til 24 s med Range-lesinger fra begge
|
||||
10 — Live-logg på tvers av relayer: publisereren landet på instans A og seeren på B bak lastbalansereren; B følger A, verifiserer hver ramme mot pinnen og viser «live»
|
||||
11 — Live-radio uten bilde (Opus/WebM og AAC/fMP4): spilleren får strømmens ekte type fra init-segmentet og blir en lydspiller, ikke en svart videoboks; lyd målt i Chromium (RMS 0,044)
|
||||
12 — Bilder live: ffmpeg-«webkamera» (MJPEG, 2 bilder/s) → shade live images → nettleser; hvert bilde er en keyframe, så en sen seer åpner på det siste. Også lysbildeserie og overvåket mappe
|
||||
|
||||
Reference in New Issue
Block a user