unarr/internal/library/mediainfo
Deivid Soto d708ea2360 feat(subs): resilient subtitle extraction — sidecars, charset, torrent/debrid
Close the recurring "video has subtitles but the web player shows none" gap
with a source-agnostic pipeline:

- Discover EXTERNAL sidecar subs in the scan (Video.es.ass siblings + a Subs/
  bundle), parse lang/forced/SDH from the filename, skip VobSub (.sub+.idx).
  ffprobe-only scanning ignored these (ToonsHub/anime "MSubs" releases).
- Transcode sidecar charset -> UTF-8 before WebVTT (BOM/UTF-16/code-page by
  language). Chinese SCRIPT matters: chs/sc -> GBK, cht/tc/big5 -> Big5
  (decoding one as the other is mojibake).
- /sub now serves a standalone sidecar file (i=-1, p=file, &l=lang hint) and a
  remote debrid URL (ffmpeg reads http, no local stat) — not just embedded
  streams of a local file.
- probe.json emits a tokened vttUrl per TEXT track so torrent/debrid HLS streams
  (never library-scanned) get subtitles too. Embedded index is counted among
  embedded streams only, so -map 0:s:N stays aligned when sidecars are appended.

Tested against a real 347-file gallery: 26/26 sidecars and embedded ass/srt/
mov_text all extract to valid WebVTT; bitmap (pgs/dvd_subtitle) correctly stays
burn-in. Manual harness gated behind GALLERY_DIR.
2026-06-08 13:04:09 +02:00
..
charset.go feat(subs): resilient subtitle extraction — sidecars, charset, torrent/debrid 2026-06-08 13:04:09 +02:00
charset_test.go feat(subs): resilient subtitle extraction — sidecars, charset, torrent/debrid 2026-06-08 13:04:09 +02:00
ffmpeg.go feat(stream)!: retire WebRTC, HLS-only, bump 0.9.4 2026-05-26 18:04:35 +02:00
ffmpeg_download.go feat(mediainfo): ResolveFFmpeg + DownloadFFmpeg mirroring ffprobe pattern 2026-05-06 09:49:32 +02:00
ffmpeg_test.go feat(mediainfo): ResolveFFmpeg + DownloadFFmpeg mirroring ffprobe pattern 2026-05-06 09:49:32 +02:00
ffprobe.go feat(subs): resilient subtitle extraction — sidecars, charset, torrent/debrid 2026-06-08 13:04:09 +02:00
ffprobe_download.go fix(library): use native arm64 ffprobe on Apple Silicon (osx-arm-64) 2026-04-09 09:26:10 +02:00
ffprobe_download_test.go test(mediainfo): add ffprobe download unit tests 2026-04-06 10:16:27 +02:00
ffprobe_test.go feat(library): detect corrupt/incomplete files during scan 2026-06-02 19:42:00 +02:00
gallery_real_test.go feat(subs): resilient subtitle extraction — sidecars, charset, torrent/debrid 2026-06-08 13:04:09 +02:00
harden_linux_test.go fix(trickplay): stop scan-time sprite generation from saturating the host 2026-06-04 08:25:00 +02:00
ioprio_linux.go fix(trickplay): stop scan-time sprite generation from saturating the host 2026-06-04 08:25:00 +02:00
ioprio_other.go fix(trickplay): stop scan-time sprite generation from saturating the host 2026-06-04 08:25:00 +02:00
lang.go feat(subs): resilient subtitle extraction — sidecars, charset, torrent/debrid 2026-06-08 13:04:09 +02:00
lang_test.go feat: add migrate command, media server detection, and debrid auto-config 2026-03-29 16:54:32 +02:00
sidecar.go feat(subs): resilient subtitle extraction — sidecars, charset, torrent/debrid 2026-06-08 13:04:09 +02:00
sidecar_subs.go feat(subs): resilient subtitle extraction — sidecars, charset, torrent/debrid 2026-06-08 13:04:09 +02:00
sidecar_subs_test.go feat(subs): resilient subtitle extraction — sidecars, charset, torrent/debrid 2026-06-08 13:04:09 +02:00
sidecar_test.go fix(stream): /critico review fixes for the sidecar cache 2026-06-02 13:46:07 +02:00
trickplay.go fix(trickplay): stop scan-time sprite generation from saturating the host 2026-06-04 08:25:00 +02:00
trickplay_lock_test.go fix(trickplay): stop scan-time sprite generation from saturating the host 2026-06-04 08:25:00 +02:00
trickplay_test.go feat(trickplay): scan-time montage sprite for the web scrubber 2026-06-03 20:30:29 +02:00
types.go feat(subs): resilient subtitle extraction — sidecars, charset, torrent/debrid 2026-06-08 13:04:09 +02:00