feat(stream): burn bitmap (PGS/DVB) subtitles into the video via overlay

Bitmap subs can't be served as WebVTT, so the user picks one and the daemon
re-encodes with it overlaid. HLSSessionConfig.BurnSubtitleIndex (*int, nil=no
burn) flows into the cache key + a -filter_complex graph:
  [0✌️0]<vchain>[base];[0:s:N][base]scale2ref[sub][base2];[base2][sub]overlay[vout]
Overlay after the tonemap (SDR subs keep brightness); scale2ref fits the PGS
canvas to the output. Invalid/text/out-of-range index -> clean-encode fallback.
IsTextSubtitle now includes "text" (parity with the web classifier).
This commit is contained in:
Deivid Soto 2026-06-01 09:51:27 +02:00
parent 8207d1d2a9
commit 665ec0a34f
9 changed files with 196 additions and 49 deletions

View file

@ -98,7 +98,7 @@ func TestHLSCacheSmoke(t *testing.T) {
encodeDur := time.Since(t0)
t.Logf("session 1: MISS completed in %s", encodeDur.Round(time.Millisecond))
key := cache.KeyFor(source, "720p", 0)
key := cache.KeyFor(source, "720p", 0, -1)
if !cache.HasComplete(key) {
t.Fatalf("cache.HasComplete(%s) is false after successful encode", key)
}