feat(media): media put --web — films browsers refuse (HEVC, AC-3, DTS) converted before sealing

ffprobe decides per stream: H.264/VP8/VP9/AV1 and AAC/MP3/Opus are
copied, anything else becomes H.264 (CRF 20) / AAC with every audio track
and its language kept; embedded text subtitles come out of the same
ffmpeg pass as subtitle tracks; picture subtitles are reported. Output is
an MP4 with the index first. Without --web, put warns when ffprobe sees
streams browsers will not play.

Verified: an HEVC + AC-3 5.1 MKV with embedded Norwegian/English SubRip:
Chromium refuses the original (DEMUXER_ERROR_NO_SUPPORTED_STREAMS); the
--web upload plays with audio decoded and the Norwegian track showing.
78 TS tests.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-10-18 22:05:28 +02:00
parent 422a37e830
commit d784e47ab3
8 changed files with 286 additions and 12 deletions

View File

@@ -51,6 +51,11 @@ New package **`@shade/media`** — see `docs/media.md`.
VTT, the viewer's language on), `media get` writes them back, and
Android plays them as side-loaded ExoPlayer text tracks
(`ShadeMedia.openFilm`).
- **`media put --web`.** Films with AC-3/DTS audio or HEVC video (Chromium
refuses them outright) are converted before sealing: what browsers play
is copied, the rest becomes H.264/AAC, embedded text subtitles become
subtitle tracks, all in one ffmpeg pass. Without the flag, `put` warns
when ffprobe sees streams browsers will not play.
- **Kotlin.** `no.zyon.shade.media`: SMF1 reader and sealer, grants, live
subscriber and publisher — byte-for-byte against `test-vectors/media.json`.
`:shade-android-media` plays sealed files in Media3/ExoPlayer