mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-16 05:43:54 +03:00
[PR #7275] [MERGED] Add extracting attachments for ffmpeg to burn subtitles with correct fonts #11323
Reference in New Issue
Block 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?
📋 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:
master← Head:burn-subtitle-attached-fonts📝 Commits (1)
ab40554add 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.