Repository navigation
Description
Problem
When Android or Android TV direct-plays an MKV with an embedded text subtitle selected, the app asks the server for a sidecar of that track instead of rendering it from the stream it is already playing. The server then reads the whole source file to extract the track. On large files on slow storage this takes minutes, competes with the video stream, and on sparse tracks (forced subtitles) the request goes silent and the app retries, each retry another full read. See Silo-Server/silo-server#1406.
MKV with SubRip or ASS is the most common embedded subtitle case, but native_embedded is currently advertised only for MP4 with mov_text (docs/playback/README.md, "Native embedded subtitles"), so every MKV text track goes through the sidecar path.
Proposal
Advertise native embedded subtitles for Matroska text tracks on original-HTTP delivery:
{"container": "mkv", "codecs": ["subrip", "ass"], "track_identity": "container_track_id"}and select the track whose Media3 Format.id equals the plan's subtitle.embedded.container_track_id, as for MP4.
Media3 1.11.0 gives this identity: MatroskaExtractor sets each track's Format.id to its Matroska TrackNumber (initializeFormat(track.number) → Format.Builder.setId(int) → Integer.toString). This applies to SubRip, ASS/SSA, and WebVTT tracks.
Open points:
- Whether ASS should go native or stay on the sidecar path, given styling and font attachments (
ass_styling,font_attachmentsin the capability entry). - Behavior when the identity is missing or ambiguous should stay as today: report
subtitle_embedded_failedand let the server replan to a sidecar.
Dependency
The server does not record container_track_id for Matroska yet (ffprobe does not expose TrackNumber), so the planner cannot choose the native route for MKV until it does. Tracked in Silo-Server/silo-server#1842. Until the server change ships, advertising the capability is harmless: the planner falls back to sidecars when the identity is missing.
Validation
- Direct-play an MKV with an embedded SubRip track, including a sparse forced track: subtitles render from the stream, the plan carries
subtitle.embedded, and the server logs no subtitle extraction for that playback. - Track switches between embedded MKV text tracks need no server request.
- An MKV without recorded track IDs still falls back to the sidecar path.
Related issue: Silo-Server/silo-server#1842, Silo-Server/silo-server#1406
AI harness
Claude Code desktop app
AI tool(s)
Claude Code shell and file tools, GitHub CLI (read-only inspection of silo-android and Media3 1.11.0 source)
AI model(s)
claude-opus-5-5
AI involvement
AI-assisted
Independent or adversarial review
n/a
Activity
tomislav commentedon Oct 4, 2026
The server side is in review: Silo-Server/silo-server#1890. Notes for this issue:
TrackNumberascontainer_track_id, the same value Media3 puts inFormat.id.S_TEXT/WEBVTTgets no ID. FFmpeg does not recognize that codec, so the server cannot confirm which stream the track is, and those tracks stay on server extraction even if the app advertiseswebvtt. WebM'sD_WEBVTT/SUBTITLESdoes get an ID.container_track_idpicks the wrong track. A production library of about 8,000 MKV files had 7 such files.AI-assisted with Claude Code (claude-opus-5-5).
feat(playback): play embedded MKV text subtitles from the stream (Sil…