jellyfin / jellyfin-web

Web Client for Jellyfin
https://jellyfin.org
GNU General Public License v2.0
2.33k stars 1.24k forks source link

[10.7] Transparent Subtitles #2291

Closed TheNamelessWonderer closed 2 years ago

TheNamelessWonderer commented 3 years ago

Describe The Bug Some subtitles are transparent in 10.7 making them hard to read.

Steps To Reproduce

  1. Play a video
  2. Watch as some subtitles are transparent

Expected Behavior

The Sub titles shouldn't be transparent

Logs 10:6 FFMPEG command: ffmpeg -ss 00:01:39.000 -noaccurate_seek -f matroska,webm -i file:"/path/to/file" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -codec:v:0 libx264 -pix_fmt yuv420p -preset veryfast -crf 23 -maxrate 7834386 -bufsize 15668772 -profile:v high -level 4.1 -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,99+n_forced*3)" -g 72 -keyint_min 72 -sc_threshold 0 -vf "scale=trunc(min(max(iw\,ih*dar)\,1920)/2)*2:trunc(ow/dar/2)*2,subtitles='/Volumes/sda1/TV Shows/Jojo'\\\''s Bizarre Adventure/Season 3/[Some-Stuffs]_Jojo'\\\''s_Bizarre_Adventure_Diamond_is_Unbreakable_27_(1920x1080_Blu-Ray_FLAC)_[8B33D737].mkv:si=0'" -start_at_zero -vsync -1 -codec:a:0 libmp3lame -ac 2 -ab 192000 -copyts -avoid_negative_ts disabled -f hls -max_delay 5000000 -hls_time 3 -individual_header_trailer 0 -hls_segment_type mpegts -start_number 33 -hls_segment_filename "/Users/user/.local/share/jellyfin/transcodes/f5f139122bdf44f778c29c36b4d383a8%d.ts" -hls_playlist_type vod -hls_list_size 0 -y "/Users/user/.local/share/jellyfin/transcodes/f5f139122bdf44f778c29c36b4d383a8.m3u8"

10.7 FFMPEG command: ffmpeg -f matroska,webm -i file:"/path/to/file" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 libx264 -pix_fmt yuv420p -preset veryfast -crf 23 -maxrate 7834386 -bufsize 15668772 -profile:v:0 high -level 41 -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)" -vf "scale=trunc(min(max(iw,ih_dar),min(1920,1080*dar))/2)*2:trunc(min(max(iw/dar,ih),min(1920/dar,1080))/2)*2" -start_at_zero -vsync -1 -codec:a:0 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 "/Users/user/.local/share/jellyfin/transcodes/429f96bb402453d5392e3e7e80aac2a6%d.ts" -hls_playlist_type vod -hls_list_size 0 -y "/Users/user/.local/share/jellyfin/transcodes/429f96bb402453d5392e3e7e80aac2a6.m3u8"

Screenshots

image image

System (please complete the following information):

Additional Context This didn't happen in 10.6 and also it is only with certain subtitles and fonts. In this anime the issue only occurs during the intro where the subs are different to the rest of the episode.

nyanmisaka commented 3 years ago

10.6 ass/ssa subtitle burn-in by ffmpeg

10.7 ass/ssa rendered by JavascriptSubtitlesOctopus in browser

TheNamelessWonderer commented 3 years ago

I see is this an upstream issue then?

nyanmisaka commented 3 years ago

I also encountered similar problems on some subtitles before. JavascriptSubtitlesOctopus may display incorrect transparency for some subtitles. You can try adding a custom font in dashboard->playback to see if it helps.

TheNamelessWonderer commented 3 years ago

Just to confirm that is a JavascriptSubtitlesOctopus issue here is the same video in VLC with the fonts rending correctly. Screenshot_20210101_125345

TheNamelessWonderer commented 3 years ago

Do you have some fonts I could use or know where I could get some?

nyanmisaka commented 3 years ago

May be Google fonts? https://fonts.google.com

TheNamelessWonderer commented 3 years ago

I downloaded https://fonts.google.com/specimen/Roboto regular. Made a new folder and extracted them into the folder, put that path into Jellyfin and enabled fallback fonts. Unfortunately it doesn't seem to have done anything and the problem still persists.

nyanmisaka commented 3 years ago

Seems there are some issues with alpha channel. https://github.com/Dador/JavascriptSubtitlesOctopus/commit/aef67726a2200a1ad92b6b3fc38346bb4f8551e5 https://github.com/Dador/JavascriptSubtitlesOctopus/commit/3009691015c06661174baaa1892fda58df5c8b81

TheNamelessWonderer commented 3 years ago

I see. Both of them are fixes that are merged are they included in 10.7-RC2?

nyanmisaka commented 3 years ago

Sure. But I have never seen it enabled in web browsers. https://github.com/jellyfin/JavascriptSubtitlesOctopus/blob/58e9a3f1a7f7883556ee002545f445a430120639/src/subtitles-octopus.js#L183

TheNamelessWonderer commented 3 years ago

Nope nothing about it being enabled in my browser console.

nyanmisaka commented 3 years ago

You can force enable it here and rebuild jellyfin-web with it to test. https://github.com/jellyfin/JavascriptSubtitlesOctopus/blob/58e9a3f1a7f7883556ee002545f445a430120639/src/subtitles-octopus.js#L460 https://github.com/jellyfin/jellyfin-web/blob/3bd4b991d7271d941b8d606783c12efd4935cfb9/yarn.lock#L4836

TheNamelessWonderer commented 3 years ago

How do I enable it? What do I need to replace?

stale[bot] commented 3 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh by adding a comment or commit. Stale issues close after an additional 14d of inactivity. If this issue is safe to close now please do so. If you have any questions you can reach us on Matrix or Social Media.

TheNamelessWonderer commented 3 years ago

This bug isn’t fixed and still happens in 10.7.5.

stale[bot] commented 3 years ago

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 nightlies, 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.

TheNamelessWonderer commented 3 years ago

Still an issue on 10.7.7.

dmitrylyzo commented 3 years ago

@TheNamelessWonderer Is there a \fad (fading) in the lines that semi-transparent?

TheNamelessWonderer commented 3 years ago

Do you mean on screen? On screen they show normally but just transparent as shown in the screenshot in the first post. If you mean in the browser console I haven’t looked their but I can have a look if it would help.

Or do you mean in the sub file itself?

dmitrylyzo commented 3 years ago

In the subtitles file.

TheNamelessWonderer commented 3 years ago

Yes there is:

Dialogue: 0,0:02:01.30,0:02:07.10,Part 4 OP3 English,,0,0,0,,{\fad(100,100)}{\1c&H09FFD6&}Shining {\1c&HD055E6&}justice {\1c&H09FFD6&}takes bloom
Dialogue: 0,0:02:07.10,0:02:12.73,Part 4 OP3 English,,0,0,0,,{\fad(100,100)}{\1c&H09FFD6&}Brand-new {\1c&HE5FC3B&}bed town {\1c&H09FFD6&}feels like a breath of fresh air
Dialogue: 0,0:02:12.73,0:02:18.40,Part 4 OP3 English,,0,0,0,,{\fad(100,100)}{\1c&HD500E0&}The cape creates a salty breeze, through the tunnel past the tower's beams
Dialogue: 0,0:02:18.40,0:02:23.66,Part 4 OP3 English,,0,0,0,,{\fad(100,100)}{\1c&HE0ECFF&}Until it's finally drawn in and fades into the town's streets
Dialogue: 0,0:02:23.66,0:02:26.83,Part 4 OP3 English,,0,0,0,,{\fad(100,100)}{\1c&H3100D5&}Within our hearts (Within our hearts)
Dialogue: 0,0:02:26.83,0:02:31.00,Part 4 OP3 English,,0,0,0,,{\fad(100,100)}{\1c&HA200D6&}Lurks a hidden shadow
l4kr commented 2 years ago

I have also noticed ASS/SSA subtitles with motion tracking and/or any sort or special effects to be just static.

I suspect this is a related issue. If not, I will create a new issue.

platend1 platend2 soul1 soul2

dmitrylyzo commented 2 years ago

@l4kr If you post sample events that don't work as expected, I can tell more. But I think this is due to heavy animation, which stalls the oneshot render.

I am waiting for https://github.com/libass/JavascriptSubtitlesOctopus/pull/111 to be merged (we want to migrate to the upstream) and counted about 5 PRs that I am going to open (https://github.com/libass/JavascriptSubtitlesOctopus/pull/111#issuecomment-948920513). One of them should help a bit with heavy animation - it will discard some frames if it can't render in time.

A new rendering mode from another contributor is also expected - using hardware acceleration in the worker.

TheNamelessWonderer commented 2 years ago

Hello is there any progress on this? I see your pull request on the repo was closed. Also is https://github.com/jellyfin/JavascriptSubtitlesOctopus/pull/21 planning to make it into 10.8? Thanks!

dmitrylyzo commented 2 years ago

Fixed by #3644

TheNamelessWonderer commented 2 years ago

Thank you so much!