Jump to content

Subtitles won't load when "next item" button is pressed to move to next episode


Jinxyface
 Share

Recommended Posts

Jinxyface

Hello. I've noticed a very inconvenient issue that popped up recently. When watching shows with subtitles (MKVs with a subtitle track softcoded), Emby will play them fine, until one episode is done, and I hit the "next item" button to go to the next episode. The next episode will start playing fine, but subtitles won't be playing, even though the subtitles are selected under the "Subtitles" overlay button.

 

I have to exit out of the stream, then start the episode over. Then subtitles will work for that episode. I have to do this with every episode of any show that has subtitles. There also seems to be a Firefox specific issue (v74 stable and v76a1 nightly) where when I resume episodes I've stopped watching, subtitles are out of sync by about .5-1.0 seconds. I have to exit the playback, mark the episode as not watched, start it over, and then scrub back to where I was for the subtitles to be in sync.

 

Here's some info:

 

Chrome stable (v80) = issue

Firefox stable (v74) = issue

Firefox Nightly (v76a1) = issue

 

Apple TV app (1.4.3?) = no issue

iOS (1.9.4) = no issue

Emby Theater (3.0.11) = no issue

 

Emby server 4.4.0.40, the file is Direct Playing in all browsers.

 

The subtitles play fine when I just play the files in question in VLC or through Plex, so it seems to be an Emby web thing specifically in browsers.

 

Edit: After a bit of further research, it seems like I'm having the same issue as described in https://emby.media/community/index.php?/topic/48686-subtitles-are-loaded-on-the-second-try/?hl=subtitles and https://emby.media/community/index.php?/topic/51452-subtitles-are-loaded-on-the-second-try-same-problem/ (except I'm using Chrome/FF and not Kodi)

Edited by Jinxyface
Link to comment
Share on other sites

arrbee99

Haven't actually found a series that has subtitles that are selectable yet. Think I have movies with selectable subs, and series with subtitles that just play without any choice, but anyway, if I find one, I'll give it a go.

Link to comment
Share on other sites

Jinxyface

Let me know if there's any other info I can provide. After a few more tests it seems that the subtitles are not "not loading" when the next episode plays. It seems that the subtitles take about 10-15 seconds to kick in. Does Emby have issues with embedded subtitles in MKV files? I don't recall this being an issue a few versions back. When I go to Settings -> Transcoding and turn off "Allow subtitle extraction on the fly", then when I try to play the same file I get an error that says "No compatible streams are currently available", but will sometimes play as a transcode because "Subtitle format not supported". So it seems the delay is because of the subtitle extraction taking place to allow the media itself to direct play. But this only happening in browsers. iOS, Apple TV, and the Windows based Emby Theater start instantly and subtitles appear right away. But only in browsers do I have to wait like 15 seconds for subtitles to appear.

 

This isn't a big deal, though is still kind of inconvenient. Is there any way this could be updated to allow a quicker extraction or is it just at the mercy of ffmpeg? That seems to be a big boon to Plex since that can play internal subtitles fine without having to extract them, and since I use a browser to watch Emby/Plex while at the office.

 

The subtitles out of sync issue on resumed media is still a thing though

Edited by Jinxyface
Link to comment
Share on other sites

Jinxyface

Another quick update. Sorry guys, the issue appears to be when playing files located on my NAS. If I copy a file locally to my hard drive and make a test library with the local file, subtitles are extracted instantly. So it appears to be a network thing?

 

Emby 4.4.0.40 playing file on NAS with server on local pc = delayed subtitle extraction by about 20 seconds.

 

Emby 4.4.0.40 playing file locally on drive with server on local pc = instant subtitle extraction when media starts playing.

 

I will install Emby on my Synology so I have the server and media local to the NAS and report back.

 

 

EDIT: Okay, so I have the Emby server set up on my Synology now. So with both the Emby server and the media on the Synology, it still has a delay to extract the subtitles, around 5 seconds or so. Which is much less of a big deal. Probably slower than instant because these Synology NASes have Intel Celerons and stuff while my home PC has an 8700k. 

 

I'm still a bit confused why Plex can extract subtitles instantly even with my media on NAS storage, but Emby takes 30 seconds. Is there anything that can be done to improve Emby in this regard?

Edited by Jinxyface
Link to comment
Share on other sites

arrbee99

Sorry, I can't help, I'm very short of stuff with subtitles, and can't find any series with switchable subs. Also don't have a NAS, just a PC full of HDD's.

 

Might be worth restarting the server, playing something with subs / reproducing the issue and posting some logs. You could possibly look at the logs yourself to see if maybe there some kind of request that takes a long time to get a reply too. Should you post logs, people like the wholes thing, not snippets. If theres anything sensitive in logs, you might want to block that bit out.

Link to comment
Share on other sites

Jinxyface

Can we look at an example? Please attach the information requested in how to report a media playback issue. thanks.

 

I've emptied my logs folder and created a new session to generate new logs. I've attached both the most recent emby server log, as well as the most recent transcoding log for my test. I stopped the test a few seconds after subtitles appeared in the stream (Around the 30 second mark)

 

It seems it takes exactly 30 seconds for Emby to extract subtitles and move them into the cache folder regardless of video. Once they're cached, they will load fine until cache is cleared. 30 seconds seems an awful lot of time for what seem to be 45KB files.

 

If this issue could be resolved, I could finally move away from Plex for good

embyserver-63720658943.txt

ffmpeg-transcode-1da51f70-84d1-4f35-8722-5948c73819b1_1.txt

Edited by Jinxyface
Link to comment
Share on other sites

Ok yes your observations in this topic are correct. We extract the .ass subtitles on the fly to avoid server transcoding. On some systems this can take time, particularly if the media is on a slow storage device.

 

In server transcoding settings you can disable this extraction altogether and it will burn them in with server transcoding instead.

Link to comment
Share on other sites

Jinxyface

Out of curiosity, is there a way to improve the extraction? Waiting 30s per episode is kind of something I can’t ignore: and turning off extraction makes my episode take like 45 seconds to start.

 

Does Emby handle .ASS subtitles differently than Plex? Plex seems to have absolutely no problems direct playing my anime with subtitles showing instantly without any delayed extraction. If the subtitle delivery can’t really be improved without transcoding, then that’s a very big reason for me to stick to Plex (which I really don’t want to do)

Edited by Jinxyface
Link to comment
Share on other sites

are you sure they're direct playing? and if they are, are you sure they're using the .ass subtitles?

Link to comment
Share on other sites

Jinxyface

are you sure they're direct playing? and if they are, are you sure they're using the .ass subtitles?

 

Quite sure, the video files I'm using only have one subtitle stream, and they're all .ASS subtitles. I do see sometimes Plex will "Direct Stream" the file instead, but I haven't really noticed any difference between direct play and direct stream. The media starts instantly and isn't transcoding, and subtitles work without any issues from the very first second.

 

If Emby could just do whatever Plex is doing in this one regard to how it handles .ASS subtitles, I'd be so happy. Emby works flawlessly on everything else, it just seems to be when using a browser and with .ASS subtitles and with subtitle extraction. But I watch in my browser a lot since I'm WFH right now, given the situation with the world right now.

Link to comment
Share on other sites

Jinxyface

Do you have a log from their extraction?

I've created a fresh Plex Media Server log file for an episode that has embedded .ass subtitles and have attached the log to this post. I glanced through it myself and found this:

 Mar 25, 2020 08:10:26.568 [21880] DEBUG - MDE: My Hero Academia - S4 E10 - Temp Squad: selected media 0 / 28180
The relevant information to my stream is at that spot, just so you won't have to comb through everything. This particular file was direct streaming, not direct playing
 
I did see this too:
 
Mar 25, 2020 08:10:26.773 [21880] DEBUG - We're going to try to auto-select a subtitle.
Mar 25, 2020 08:10:26.773 [21880] DEBUG - Subtitles: Found a candidate subtitle language [eng] for a foreign film

and

Mar 25, 2020 08:10:26.775 [21880] DEBUG - Job running: EAE_ROOT='\\?\C:\Users\Matthew\AppData\Local\Plex Media Server\Cache\Transcode\Sessions\EasyAudioEncoder' FFMPEG_EXTERNAL_LIBS='\\\\?\\C\:\\Users\\Matthew\\AppData\\Local\\Plex\ Media\ Server\\Codecs\\0bc617e-2974-windows-x86\\' X_PLEX_TOKEN='xxxxxxxxxxxxxxxxxxxx' C:\Program Files (x86)\Plex\Plex Media Server\Plex Transcoder.exe -codec:0 h264 -ss 0 -noaccurate_seek -analyzeduration 20000000 -probesize 20000000 -i "P:\Anime\My Hero Academia\Season 4\My Hero Academia - 4x10 - Temp Squad.mkv" -map 0:0 -codec:0 copy -map 0:1 -metadata:s:1 language=jpn -codec:1 copy -f dash -seg_duration 5 -init_seg_name init-stream$RepresentationID$.m4s -media_seg_name chunk-stream$RepresentationID$-$Number%05d$.m4s -window_size 5 -delete_removed false -skip_to_segment 1 -time_delta 0.0625 -manifest_name http://127.0.0.1:32400/video/:/transcode/session/dyvq7pomzhza9jv9m8sai0bq/cf7d7077-2811-41ec-a930-1ec9c47cf663/manifest?X-Plex-Http-Pipeline=infinite -avoid_negative_ts disabled -map_metadata -1 -map_chapters -1 dash -map 0:2 -metadata:s:0 language=eng -codec:0 copy -f segment -segment_format ass -segment_time 1 -segment_header_filename sub-header -segment_start_number 0 -segment_list http://127.0.0.1:32400/video/:/transcode/session/dyvq7pomzhza9jv9m8sai0bq/cf7d7077-2811-41ec-a930-1ec9c47cf663/seglist?stream=subtitles&X-Plex-Http-Pipeline=infinite -segment_list_type csv -segment_list_size 5 -segment_list_separate_stream_times 1 -segment_format_options ignore_readorder=1 -segment_list_unfinished 1 -fflags +flush_packets sub-chunk-%05d -start_at_zero -copyts -vsync cfr -y -nostats -loglevel quiet -loglevel_plex error -progressurl http://127.0.0.1:32400/video/:/transcode/session/dyvq7pomzhza9jv9m8sai0bq/cf7d7077-2811-41ec-a930-1ec9c47cf663/progress 

 

 

Please let me know if there's any more info I can provide. I'd love to assist in improving .ass subtitles

Plex Media Server.log

Edited by Jinxyface
Link to comment
Share on other sites

Ok they're using some custom techniques here to allow them to extract only small portions at a time, and this allows the subtitles to be immediately visible without having to wait for a full extraction.

 

This is not something we can just throw in quickly, but it's definitely something we can research for future updates. Thanks.

Link to comment
Share on other sites

Jinxyface

Ok they're using some custom techniques here to allow them to extract only small portions at a time, and this allows the subtitles to be immediately visible without having to wait for a full extraction.

 

This is not something we can just throw in quickly, but it's definitely something we can research for future updates. Thanks.

No problem. I will patiently wait for that day. Thank you for the insight!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...