Skip to content

Load embedded fonts for ASS subtitles when not direct playing - #2234

Open
moi15moi wants to merge 1 commit into
damontecres:mainfrom
moi15moi:Fix-1634
Open

moi15moi wants to merge 1 commit into
damontecres:mainfrom
moi15moi:Fix-1634

Conversation

@moi15moi

Copy link
Copy Markdown

Description

libass use fonts that are attached to the mkv.
Those attachments are missing when the stream is transcoded. Due to that, when the selected subtitle is ASS/SSA and the playback isn't direct play, download the source's font attachments from the server and pass them to the AssHandler.

The font attachment detection is based on https://github.com/ietf-wg-cellar/matroska-specification/blob/1a943ead9bb4c67b02b966cebafe51c8c074e703/cellar-matroska/attachments.md?plain=1#L87-L111 + https://github.com/mpv-player/mpv/blob/a39482e7a580e64ea58ac0e1fc2838100b6320d3/sub/sd_ass.c#L144-L154

Related issues

#1634

Testing

Emulator

Screenshots

Not relevant

AI or LLM usage

I used claude to find out how to download the fonts from the jellyfin server + do the font caching.

To test this PR, I used this file https://files.catbox.moe/q4eab5.mkv and played it (while been transcoded).
I verified that the fonts where indeed loaded properly.

libass use fonts that are attached to the mkv.
Those attachments are missing when the stream is transcoded.
Due to that, when the selected subtitle is ASS/SSA and the playback isn't direct play, download the source's font attachments from the server and pass them to the AssHandler.

The font attachment detection is based on https://github.com/ietf-wg-cellar/matroska-specification/blob/1a943ead9bb4c67b02b966cebafe51c8c074e703/cellar-matroska/attachments.md?plain=1#L87-L111 + https://github.com/mpv-player/mpv/blob/a39482e7a580e64ea58ac0e1fc2838100b6320d3/sub/sd_ass.c#L144-L154

Fix: damontecres#1634
@ethaldeman

Copy link
Copy Markdown

I tested this branch with the same setup I used to open #1634, and confirmed it is fixed!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants