Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue]: Burning in subtitles and Web client use different paths for fallback fonts #9273

Open
1 task done
felix920506 opened this issue Feb 8, 2023 · 9 comments
Open
1 task done
Labels
bug Something isn't working confirmed This issue has been reviewed and confirmed

Comments

@felix920506
Copy link
Member

Please describe your bug

Issue: Chinese subtitles aren't rendering properly when burned in

Source Media:
Video Title: 1080p HEVC SDR Codec: HEVC Profile: Main 10 Level: 123 Resolution: 1920x1080 Aspect ratio: 16:9 Interlaced: No Framerate: 23.976025 Bitrate: 5754 kbps Bit depth: 10 bit Video range: SDR Video range type: SDR Color space: bt709 Color transfer: bt709 Color primaries: bt709 Pixel format: yuv420p10le Ref frames: 1
Audio Title: Japanese - FLAC - Stereo - Default Language: jpn Codec: FLAC Layout: stereo Channels: 2 ch Bitrate: 720 kbps Sample rate: 48000 Hz Bit depth: 16 bit Default: Yes Forced: No External: No
Subtitle Title: CHT - 未定義的 - ASS - 外部 Codec: ASS Default: No Forced: No External: Yes
MKV container does NOT have embedded fonts.
Usable fonts are available in my fallback fonts folder as 3 .otf files for relevant character sets

Expected Behavior: Subtitles to render normally in the provided fallback fonts
Actual Behavior: Subtitles are tofu instead of the words they are supposed to be

Jellyfin Version

Other

if other:

10.8.9

Environment

- OS: UnRaid
- Virtualization: Docker
- Clients: Web, iOS (old client only, not swiftfin)
- Browser: Firefox
- FFmpeg Version: 5.1.2
- Playback Method: Transcode w/ burning in subtitles
- Hardware Acceleration: None
- Plugins: AniDB
- Reverse Proxy: None
- Base URL: None
- Networking: NAT
- Storage: Local

Jellyfin logs

[2023-02-07 22:00:16.318 -08:00] [INF] [200] Jellyfin.Api.Helpers.MediaInfoHelper: StreamBuilder.BuildVideoItem( Profile="Anonymous Profile", Path="/data/tvshows/roomcamp/season1/S01E03.mkv", AudioStreamIndex=3, SubtitleStreamIndex=1 ) => ( PlayMethod=Transcode, TranscodeReason=ContainerBitrateExceedsLimit ) "media:/videos/0c6373b4-36ff-0e8e-4835-a98fd62f15c7/master.m3u8?MediaSourceId=0c6373b436ff0e8e4835a98fd62f15c7&VideoCodec=h264&AudioCodec=aac,mp3&AudioStreamIndex=3&SubtitleStreamIndex=1&VideoBitrate=5616000&AudioBitrate=384000&MaxFramerate=23.976025&api_key=<token>&SubtitleMethod=Encode&TranscodingMaxAudioChannels=2&RequireAvc=false&Tag=3959bb9463c5c73e23639b8f8b38df9b&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=True&hevc-level=123&hevc-videobitdepth=10&hevc-profile=main10&h264-profile=high,main,baseline,constrainedbaseline&h264-rangetype=SDR&h264-level=52&h264-deinterlace=true&TranscodeReasons=ContainerBitrateExceedsLimit"
[2023-02-07 22:00:17.373 -08:00] [INF] [181] Jellyfin.Api.Controllers.DynamicHlsController: Current HLS implementation doesn't support non-keyframe breaks but one is requested, ignoring that request
[2023-02-07 22:00:17.374 -08:00] [INF] [181] Jellyfin.Api.Helpers.TranscodingJobHelper: "/usr/lib/jellyfin-ffmpeg/ffmpeg" "-analyzeduration 200M -f matroska,webm -autorotate 0 -i file:\"/data/tvshows/roomcamp/season1/S01E03.mkv\" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -codec:v:0 libx264 -preset veryfast -crf 23 -maxrate 5616000 -bufsize 11232000 -profile:v:0 high -level 51 -x264opts:0 subme=0:me_range=4:rc_lookahead=10:me=dia:no_chroma_me:8x8dct=0:partitions=none -force_key_frames:0 \"expr:gte(t,0+n_forced*3)\" -sc_threshold:v:0 0 -vf \"setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale=trunc(min(max(iw\,ih*a)\,1920)/2)*2:trunc(ow/a/2)*2,format=yuv420p,subtitles=f='/data/tvshows/roomcamp/season1/S01E03.CHT.ass':fontsdir='/config/cache/attachments/0c6373b436ff0e8e4835a98fd62f15c7'\" -start_at_zero -codec:a:0 libfdk_aac -ac 2 -ab 384000 -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type mpegts -start_number 0 -hls_segment_filename \"/config/data/transcodes/e402a0988e2f6b5aa99491ba7bd9db0f%d.ts\" -hls_playlist_type vod -hls_list_size 0 -y \"/config/data/transcodes/e402a0988e2f6b5aa99491ba7bd9db0f.m3u8\""
[2023-02-07 22:00:20.124 -08:00] [WRN] [194] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from "http://serverip:8096/videos/0c6373b4-36ff-0e8e-4835-a98fd62f15c7/hls1/main/0.ts?DeviceId=TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NDsgcnY6MTA5LjApIEdlY2tvLzIwMTAwMTAxIEZpcmVmb3gvMTA5LjB8MTY3NTcyNjUxOTQxMw11&MediaSourceId=0c6373b436ff0e8e4835a98fd62f15c7&VideoCodec=h264&AudioCodec=aac,mp3&AudioStreamIndex=3&SubtitleStreamIndex=1&VideoBitrate=5616000&AudioBitrate=384000&MaxFramerate=23.976025&PlaySessionId=fdbf57de4be84e77bd27f456263dff30&api_key=5b351e7339b84584be8b05c88dc5f27a&SubtitleMethod=Encode&TranscodingMaxAudioChannels=2&RequireAvc=false&Tag=3959bb9463c5c73e23639b8f8b38df9b&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=True&hevc-level=123&hevc-videobitdepth=10&hevc-profile=main10&h264-profile=high,main,baseline,constrainedbaseline&h264-rangetype=SDR&h264-level=52&h264-deinterlace=true&TranscodeReasons=ContainerBitrateExceedsLimit&runtimeTicks=0&actualSegmentLengthTicks=30000000" to "clientip" in 0:00:02.7529281 with Status Code 200
[2023-02-07 22:00:21.335 -08:00] [WRN] [192] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from "http://serverip:8096/Sessions/Playing/Progress" to "clientip" in 0:00:00.8328572 with Status Code 204
[2023-02-07 22:00:24.200 -08:00] [WRN] [183] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from "http://serverip:8096/videos/0c6373b4-36ff-0e8e-4835-a98fd62f15c7/hls1/main/6.ts?DeviceId=TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NDsgcnY6MTA5LjApIEdlY2tvLzIwMTAwMTAxIEZpcmVmb3gvMTA5LjB8MTY3NTcyNjUxOTQxMw11&MediaSourceId=0c6373b436ff0e8e4835a98fd62f15c7&VideoCodec=h264&AudioCodec=aac,mp3&AudioStreamIndex=3&SubtitleStreamIndex=1&VideoBitrate=5616000&AudioBitrate=384000&MaxFramerate=23.976025&PlaySessionId=fdbf57de4be84e77bd27f456263dff30&api_key=5b351e7339b84584be8b05c88dc5f27a&SubtitleMethod=Encode&TranscodingMaxAudioChannels=2&RequireAvc=false&Tag=3959bb9463c5c73e23639b8f8b38df9b&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=True&hevc-level=123&hevc-videobitdepth=10&hevc-profile=main10&h264-profile=high,main,baseline,constrainedbaseline&h264-rangetype=SDR&h264-level=52&h264-deinterlace=true&TranscodeReasons=ContainerBitrateExceedsLimit&runtimeTicks=180000000&actualSegmentLengthTicks=30000000" to "clientip" in 0:00:00.5169567 with Status Code 200

FFmpeg logs

File is too big, see attached .txt in screenshot section

Please attach any browser or client logs here

image

Please attach any screenshots here

image

ffmpeg log:
ffmpeg-log.txt

Code of Conduct

  • I agree to follow this project's Code of Conduct
@felix920506 felix920506 added the bug Something isn't working label Feb 8, 2023
@felix920506
Copy link
Member Author

felix920506 commented Feb 8, 2023

From looking at the Jellyfin logs it looks to me that ffmpeg is not being told to look in the backup fonts directory to look for backup fonts

@felix920506
Copy link
Member Author

After doing some additional testing I found that this issue only happens when the fallback fonts folder is not the default system font folder

@harleyknd1
Copy link

Kind of working as intended, but probably not for the reason you're thinking of.
When trying to encode, ffmpeg usually tries to use the font inside the mkv (if there is any) to display test, and if it fails that, it'll look at the installed fonts within windows/linux/whatever and tries to see if the font the mkv wants exists there.

And if all else fails, it'll use the default font (even if it might not support the specific utf-8 character set)
I'm not aware on how unraid specifically tells ffpmeg what the system fonts are, but it's likely that it was told the font doesn't exist and just picked the best fallback font it could find.

@Ritchie1108
Copy link

enable fallback fonts on playback

@jellyfin-bot
Copy link
Contributor

This issue has gone 120 days without comment. To avoid abandoned issues, it will be closed in 21 days if there are no new comments.

If you're the original submitter of this issue, please comment confirming if this issue still affects you in the latest release or master branch, or close the issue if it has been fixed. If you're another user also affected by this bug, please comment confirming so. Either action will remove the stale label.

This bot exists to prevent issues from becoming stale and forgotten. Jellyfin is always moving forward, and bugs are often fixed as side effects of other changes. We therefore ask that bug report authors remain vigilant about their issues to ensure they are closed if fixed, or re-confirmed - perhaps with fresh logs or reproduction examples - regularly. If you have any questions you can reach us on Matrix or Social Media.

@jellyfin-bot jellyfin-bot added the stale Stale and will be closed if no activity occurs label Sep 15, 2023
@felix920506
Copy link
Member Author

Issue still exists. Can be worked around by installing system fonts.

@jellyfin-bot jellyfin-bot removed the stale Stale and will be closed if no activity occurs label Oct 4, 2023
@felix920506
Copy link
Member Author

A more appropriate title/description for this issue would be "Web and Burning in subs use different fallback fonts", possibly related to #5008

@felix920506 felix920506 changed the title [Issue]: Burning in Chinese subtitles result in tofu [Issue]: Burning in subtitles and Web client use different paths for fallback fonts Oct 5, 2023
@felix920506
Copy link
Member Author

I think I should clarify this a bit.
When subs are rendered by JF-Web (not burned in), it uses the fallback fonts defined in the setting in the dashboard.
When subs are being burned in by the server, it uses system fonts that are installed on the server system.
I think this should at the very least be clarified.

@thetbw
Copy link

thetbw commented Dec 29, 2023

same issue in docker,although it can be solved manually,but it is not strong enough when upgrade next time

@felix920506 felix920506 added the confirmed This issue has been reviewed and confirmed label Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working confirmed This issue has been reviewed and confirmed
Projects
Status: Todo
Development

No branches or pull requests

5 participants