[PR #7275] [MERGED] Add extracting attachments for ffmpeg to burn subtitles with correct fonts #11323

Closed
opened 2026-02-07 06:36:25 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/7275
Author: @nalsai
Created: 2/6/2022
Status: Merged
Merged: 3/1/2022
Merged by: @Bond-009

Base: masterHead: burn-subtitle-attached-fonts


📝 Commits (1)

  • ab40554 add extracting attachments for ffmpeg to burn subs

📊 Changes

5 files changed (+161 additions, -3 deletions)

View changed files

📝 CONTRIBUTORS.md (+1 -0)
📝 Jellyfin.Api/Helpers/TranscodingJobHelper.cs (+16 -0)
📝 MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs (+14 -3)
📝 MediaBrowser.Controller/MediaEncoding/IAttachmentExtractor.cs (+6 -0)
📝 MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs (+124 -0)

📄 Description

Changes
When burning in subtitles, attachments to the video file get extracted and the path gets supplied as fontsdir to ffmpeg. This way, ffmpeg can burn in subtitles with the correct fonts, when they are attached to the video and not installed on the system.

Issues
Fixes #1589 (subtitles will now render correctly when burning them, like in the Plex screenshot)
Would fix 2. of #7208, but by looking at the mediainfo, I think the font is missing completely there (not on system or media file)

Theres some commented out code concerning fallbackFontPath with TODO in EncodingHelper. There can only be one fontsdir supplied to ffmpeg, so it wouldn't work together. But also, you shouldn't supply a directory with lots of fonts to ffmpeg, because that can slow the start of the transcoding down (ffmpeg needs to index all fonts in there first). You can just install fonts on the system for the jellyfin user (or with this pull request attach them to the file), so I don't think fallbackFontPath should be / needs to be added to ffmpeg when burning subtitles.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jellyfin/jellyfin/pull/7275 **Author:** [@nalsai](https://github.com/nalsai) **Created:** 2/6/2022 **Status:** ✅ Merged **Merged:** 3/1/2022 **Merged by:** [@Bond-009](https://github.com/Bond-009) **Base:** `master` ← **Head:** `burn-subtitle-attached-fonts` --- ### 📝 Commits (1) - [`ab40554`](https://github.com/jellyfin/jellyfin/commit/ab40554759306caf0f746e101b49caa51da77928) add extracting attachments for ffmpeg to burn subs ### 📊 Changes **5 files changed** (+161 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `CONTRIBUTORS.md` (+1 -0) 📝 `Jellyfin.Api/Helpers/TranscodingJobHelper.cs` (+16 -0) 📝 `MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs` (+14 -3) 📝 `MediaBrowser.Controller/MediaEncoding/IAttachmentExtractor.cs` (+6 -0) 📝 `MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs` (+124 -0) </details> ### 📄 Description **Changes** When burning in subtitles, attachments to the video file get extracted and the path gets supplied as fontsdir to ffmpeg. This way, ffmpeg can burn in subtitles with the correct fonts, when they are attached to the video and not installed on the system. **Issues** Fixes #1589 (subtitles will now render correctly when burning them, like in the Plex screenshot) Would fix 2. of #7208, but by looking at the mediainfo, I think the font is missing completely there (not on system or media file) Theres some commented out code concerning fallbackFontPath with TODO in EncodingHelper. There can only be one fontsdir supplied to ffmpeg, so it wouldn't work together. But also, you shouldn't supply a directory with lots of fonts to ffmpeg, because that can slow the start of the transcoding down (ffmpeg needs to index all fonts in there first). You can just install fonts on the system for the jellyfin user (or with this pull request attach them to the file), so I don't think fallbackFontPath should be / needs to be added to ffmpeg when burning subtitles. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-07 06:36:25 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#11323