Fetch a text translation source and align it to the embedded track's timings #268
Closed
opened 2026-08-30 10:38:32 +01:00 by naps62-yolo
·
0 comments
No Branch/Tag Specified
main
translation
qbit-2
docker
bugs
blitz/subtitles
fix/255-provider-reorder
blitz/feedback-3
subtitles/251-icon-vocab
subtitles/237-relocate-subs
fix/248-title-move-creates-root
blitz/feedback-2
issue/227-abandoned-pack-visible
issue/245-backoff-anchor
issue/240-design-coherence
issue/211-waived-rule
issue/232-plainer-words
issue/246-policy-reclassify
issue/244-root-slash-stored
issue/231-settings-rows
issue/241-reclassify-on-root-change
issue/239-failure-window
issue/230-icon-only
issue/243-root-path-edges
issue/238-attention-liveness
issue/229-back-button
issue/236-root-path-move
issue/226-attention-threshold
issue/228-root-move
blitz/size-bands
size-bands/209-runtime-scale
size-bands/210-size-waiver
size-bands/208-runtime-design
blitz/reliability
reliability/155-sqlx-migrations
reliability/176-refresh-on-add
removal-nav/175-removal-controls
removal-nav/174-season-file-removal
removal-nav/172-search-titles
removal-nav/173-homepage-library
removal-nav/171-untrack-clears
removal-nav/170-chip-align
removal-nav/169-design-amendment
feedback/167-deck-autosearch
feedback/165-chip-colour
feedback/166-header-rail
feedback/163-drop-cast
feedback/164-control-geometry
feedback/162-season-ordering
feedback/161-search-episodes
feedback/160-autotrack-seed
feedback/159-design-amend
blitz/rich-metadata
rich/151-grid
rich/148-search-rows
rich/150-series-meta
rich/149-movie-page
rich/147-search-art
rich/156-rating-null
rich/146-meta-api
rich/145-poster-cols
rich/144-trailer
rich/143-meta-detail
rich/142-design-amend
blitz/153-empty-episode-titles
blitz/152-deck-routes
blitz/141-season-vanished-api
blitz/129-series-detail-view
blitz/140-attention-episode-numbers
blitz/137-season-removals
blitz/133-attention-tv-lanes
blitz/139-movie-id-episode-guard
blitz/134-stale-attention-queue
blitz/124-rss-episode-matching
blitz/136-imdb-series-lookup
blitz/132-manual-commands
blitz/128-series-delete-files
blitz/131-status-seasons-input
blitz/138-plural-season-range
blitz/135-pack-name-parse
blitz/122-upstream-removals
blitz/130-add-series-search
blitz/121-series-refresh
blitz/127-unified-search-tv
blitz/123-episode-matching
blitz/126-tv-attention
blitz/119-tracked-rule
blitz/125-season-deck
blitz/120-tvdb-id
blitz/118-season-zero
blitz/117-design-amend
issue/115-avail-search
issue/112-name-truncate
issue/111-score-colors
No results found.
Labels
Clear labels
area/api
area/ci
area/compat
area/core
area/daemon
area/db
area/dl
area/indexer
area/infra
area/meta
area/parse
area/probe
area/subs
area/web
difficulty/easy
difficulty/hard
difficulty/moderate
difficulty/trivial
phase/1-skeleton
phase/2-logic
phase/3-sourcing
phase/4-movies
phase/5-ui
phase/6-tv
phase/7-people
phase/8-compat
phase/9-subtitles
type/bug
type/chore
type/feature
type/test
arr-api
CI and test harness
arr-compat
arr-core
arr-daemon
arr-db
arr-dl
arr-indexer
workspace and tooling
arr-meta
arr-parse
arr-probe
arr-subs crate: providers, extraction, translation, sync
web/
bounded, obvious approach, few files
subtle correctness or cross-cutting
multiple files, judgement, an interface to design
one file, mechanical, no design decisions
workspace, CI, config, database, empty API and SPA
parsing and policy engine, pure, no network
TMDB and Prowlarr, read-only
movies end to end
search, buckets, library views, queues
seasons, episodes, tracking, derived status
owner tags and notifications
Jellyseerr shim
build order: subtitles, DESIGN.md §15
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: yolo/arr#268
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
DESIGN.md §15. Found while testing a 2160p BluRay import (Batman Begins, movie 5): pt-PT can never materialise for that file, for two compounding reasons.
The deadlock
The release carries one English subtitle track,
hdmv_pgs_subtitle— bitmaps. §15 says an embedded track satisfies its language, so English reads as satisfied and arr never downloads an English SRT. §15 also says image tracks can never feed a translator. Sotranslation_source()(crates/arr-daemon/src/subtitles.rs:913) returnsNone— no sidecar with a path, no embedded text track — and the lane stops with "no text source to translate from".The file is stuck both ways: it cannot translate because it has no text, and it will not fetch text because it believes it already has English.
#206 describes the same dead end and proposes OCR, but its premise is "an English BluRay with no external subtitle available". That premise does not hold here — an English subtitle is readily available from OpenSubtitles, arr simply never asks for one. Closing the gap that way is far cheaper than OCR, and yields real text instead of OCR'd text that a translator would then turn into nonsense.
The timing objection, and why it does not require OCR
The embedded track's genuine advantage is that its timings are exact for this release, while a downloaded subtitle needs alass — a heuristic with no confidence value, which is why §15 already gates its output on plausibility.
That advantage is available without reading a single pixel: PGS timings are packet metadata.
ffprobe -select_streams s:0 -show_packetsreturns them directly, so a reference can be synthesised from the disc's own cue structure and used as alass's reference instead of the video's audio.Spike results
On the real file, over the whole film:
duration_timeisN/Afor PGS, but packets strictly alternate show/clear, so pairing them yields cues — every implied duration fell between 0.3s and 10s across all 1473.Alignment, measured on a synthetic 125-minute film (923 cues) whose subtitle was mistimed by a 23.976→25fps drift plus an offset, i.e. 316 seconds out by the end:
alass matches on interval structure, not words, so the two cue sets never have to agree — a sparse skeleton is still a strong signal. That matters because a retail disc's track and a downloaded SDH subtitle never carry the same cues.
The pairing is load-bearing, though. Treating every packet as a cue start instead of pairing them gives a consistent ~486 ms error — better than 152 s, but visibly wrong:
Work
WHERE path IS NOT NULL), so the fetched sidecar coexists with the embedded row — no schema change.Derivation costs a full demux, so it belongs at import — while the file is being read and hardlinked anyway — not on the translation path.
Not this issue
OCR (#206) stays filed for the case this does not reach: no provider has a text subtitle in any language, alongside #207. This issue should shrink #206's remaining scope to that case rather than replace it.