jellyfin / jellyfin-androidtv

Android TV Client for Jellyfin
https://jellyfin.org
GNU General Public License v2.0
2.67k stars 457 forks source link

[Bug] Subtitles Don't Always Load #145

Closed seniorm0ment closed 1 month ago

seniorm0ment commented 5 years ago

Subtitles don't always load, tested on Nvidia Shield TV and a Mibox. Some films they do and others they don't.

On the films they don't, this usually occurs with me selecting the subtitle I want, then it says "Loading subtitles", I let it sit for a minute or two, sometimes it just lingers and most times it ends up saying "Subtitles could not be loaded"

(Unrelated but another issue I've come across with subtitles is sometimes I would click "No subtitles" to disable them, they go away but then about 30sec later they turn back on, I go back and manually disable them again (The "no subtitles" is still selected which is odd, I just click it again) and then it's fine throughout the rest of the show.

thornbill commented 4 years ago

Have you happened to notice if this happens for a particular subtitle format? I have noticed this also, but haven't tracked down the specifics as to what causes it.

seniorm0ment commented 4 years ago

Have you happened to notice if this happens for a particular subtitle format?

Not entirely sure, but it was happening on a series that had SUBRIP subtitles.

seniorm0ment commented 4 years ago

Just tried watching a movie (Different from my original post) that has SUBRIP subtitles as well, and the same occured. I click the subtitle of choice, it says "Subtitle loading..." just lingers and eventually says "Subtitle could not be loaded".

Can't say for sure whether or not it's SUBRIPS. But I was having issues with anime subtitles, and I know at least one of the shows was using ASS subtitles. Same issue. I didn't try it with the movie I got done watching, but usually with anime, if I go into options and enable external player, and have it open in MxPlayer.. it plays perfectly fine with the subtitles. I'd assume this to be the case with the movie as well, but unable to check right now.

seniorm0ment commented 4 years ago

Do we have any word about this? Still trouble unfortunately

nielsvanvelzen commented 4 years ago

The subtitle selector is a bit broken, I haven't found the underlying issue yet. In version 0.13 (after the next major release) we're going to rewrite a lot of code related to the playback functionality so this issue should be fixed then.

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

seniorm0ment commented 3 years ago

Seems to still occur every now and then, however it seems to be working overall far more often than it used to.

raver2046 commented 3 years ago

This bug is still actual. How can I help you to fix this? I use exoplayer forced.

seniorm0ment commented 3 years ago

I've been using Kodi with Jellyfin, and it's been working great personally Probably won't be going back to the app But yeah that's your temporary solution maybe

raver2046 commented 3 years ago

Problem : Kodi on TCL 55C715 => 17 fps (on 20160p video) Plex media player all is ok (exoplayer) Jellyfin all is ok with exoplayer but subtitles problems...

If you have a clue of the part of the code to fix i can check a little bit (former C# dev.)

mblennegard commented 3 years ago

I am also having this issue on Nvidia Shield TV. I almost always get the subtitles eventually though, but only after waiting with the message "Subtitles loading" message for a minute.

Sometimes I have to manually select no subtitles and then select the subtitle yet again before getting it to work.

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

EsEnZeT commented 2 years ago

Noticed this issue today @ Android exoplayer and SUBRIP subs

axel-lebourhis commented 2 years ago

Hi all, just wanted to mention I have the same issue on my shield. No issue with plex on the same files. Happens a lot on my setup.

morkyy commented 2 years ago

Same issue on Nvidia shield. Happened in v0.11, v0.12 and now still happens in v0.13.

Issue occurs for both subs that are include in the mkv container as well as normal .srt subs that are downloaded separately. Selecting a subtitle track will show "loading subtitles" and sometimes after a while it fails to load the subs. I have to retry 2-3 more times before it actually loads the subtitle track.

It seems that it happens randomly and in all files. Sometimes the same subtitle track that caused issues will load with no issues when trying a few days later and then if you try again it will fail.

Looks like something is broken in the subtitle selector.

marciomaiden commented 2 years ago

I also have the problem on android tv, but only in the files where the subtitles are SUBRIP..

I tested it on mi box s, and on smart tv, brand SMART TECH

KyleSanderson commented 2 years ago

So this one was rather easy to discover after an hour or so of observation.

Basically what's happening is the subtitles streams are parsed during library import, but not extracted. When subtitles are requested, ffmpeg is invoked on the server to pull the stream out of the file. This results in a full file scan (so if you have a 20G file, it can take A While) to get the 31KB file out. A simple hour television recording of 4G can take over 40 seconds to get the subtitle out.

The file is then stored in the server cache, and served via json to the client for subsequent loads. If the subtitle is not needing to be ripped out of the container, it is then immediately served via json to the client, skipping this entire file scan and can immediately return the information.

So, what can be done? It's actually pretty simple here, Exoplayer already has full subtitle support, and if the subtitle is embedded in the file, try loading from Exoplayer first, then fallback to the json method if it fails. This results in a 0s subtitle delay, and reduces server load. This is confirmed by using an external player (like Just Video Player) using the Jellyfin stream and getting instant seeking + subtitle loading.

The additional enhancement here is to add a subtitle load retry, there's a single 30s timeout request and if it fails it throws the downloading subtitles error. 3x by 15s would be a huge improvement.

Anyway, this didn't seem to be well understood - hopefully it helps.

sourpatched commented 2 years ago

@seniorm0ment v0.13.0 adds support for Subtitle preferences and Jellyfin 10.8.0 adds lots of changes to subtitles https://jellyfin.org/posts/jellyfin-10-8-0/

nothing2obvi commented 1 year ago

I found that this issue went away once I turned on video transcoding.

trablin45 commented 1 year ago

this is an ongoing problem still on 10.8.10, still not solved

paaff commented 1 year ago

Can confirm as well, same as @trablin45. :) The extraction takes a long time, and the only way I've found where I can track it, is with debug logs enabled. Not that it is practical in any sense, just noticed it when I was trying to figure out what was happening.

If the extraction cannot be done faster, perhaps a middleground can be found in having the extraction done automatically when media is added to the library. I think the majority of users with this problem wouldn't mind that :)

Anyways, I hope a fix / solution can be found on this 👍

trablin45 commented 1 year ago

totally agree with @paaff an utility to auto-extract subs when server is not in use will be extremely useful and a complete solution to this problem

theg00s3 commented 1 year ago

If the extraction cannot be done faster, perhaps a middleground can be found in having the extraction done automatically when media is added to the library

Isn't this what the Subtitle Extractor plugin essentially does, except on whatever schedule you set

trablin45 commented 1 year ago

If the extraction cannot be done faster, perhaps a middleground can be found in having the extraction done automatically when media is added to the library

Isn't this what the Subtitle Extractor plugin essentially does, except on whatever schedule you set

The default "subtitle extract" plugin doesn't do anything to me, it stays at 0.00%, also it would be great if it let you set to extract the sub to the video folder or to just trigger manually per video (If some videos just work fine and don't need extraction)

averagejooe commented 1 year ago

Yea I can confirm this is still an issue. I also had tried Subtitles Extractor plugin and tbh I don't like the implementation and deleted it. It will extract each and every associated subtitles, it took up many disk space (I completed about 35 percent after many hours running it and it took like 3.6GB which is unbelievable for a bunch of text files) I really don't understand why must we took this approach. I ended up just using Just(video player) and it will load subtitles instantly after chosing it. Just a side note, it is based on Exoplayer like what Jellyfin use. So yea, unsure why JF insists on preload/ extract embed subs in order to load it. I wouldn't call my library size very big, probably totaling less than 6TB, but dang it sure felt inconvenient having to analyze ALL media files without no user input

KyleSanderson commented 1 year ago

The only correct way to fix this is for the player to read the subtitle stream, which is already streamed to the end client in Jellyfin as previously confirmed. It's likely 20-30 lines of code as all player libraries already support this, and have for well over 25 years and is built-in to mpeg.

EricChan1989 commented 1 year ago

I agree with KyleSanderson, i also believe that it is more easier for Jellyfin developer to deal with this to leave the subtitles handled by the media player. No matter which player, as long as it is stable enough, it is good. I personally believe that MPV is the most stable player on Android in my experience, and VLC is also good on my phone (on TV it is impossible to use VLC as an external player). EXO is something I never used as a standalone player, so it is hard to say. But with EXO and the current settings of handling the subtitles, it is truly not that good. JMP on windows and mac are both working perfectly with MPV in my experience, that is the reason I would recommend MPV.

wolfdael commented 9 months ago

This is still an issue with the latest server version in docker, and latest player on Android TV. For me the subtitle loading is only by luck.

There are so many new features being worked on but why not fix this basic functionality issue?

Here are few reddit posts where users report regarding subtitles "unable to load subtitles". The other deluge of subtitle issues on Android tv can be found by simply searching "unable to load"

https://www.reddit.com/r/jellyfin/s/cNxyBEkE4e

https://www.reddit.com/r/jellyfin/s/jQpNeqSFYT

https://www.reddit.com/r/jellyfin/s/cANut48wL0

https://www.reddit.com/r/jellyfin/s/nQ9OAeDRHZ

https://www.reddit.com/r/jellyfin/s/JUhA4kjAIb

https://www.reddit.com/r/jellyfin/s/SnToue00SY

So kindly please let exoplayer handle the subtitles and not jellyfins custom implementation.

KyleSanderson commented 9 months ago

This is still an issue with the latest server version in docker, and latest player on Android TV. For me the subtitle loading is only by luck.

There are so many new features being worked on but why not fix this basic functionality issue?

Retracted.

EDIT: Sorry man; didn't realize it's a one man show now. Not posting again to add to the noise, but hope things pick up again when there's a bit more help.

voc0der commented 9 months ago

Lotta people watch with subs because terrible mic positioning and sound editing.

Or simply watching a foreign show. This issue has plagued me for longer than I remember.

Switching to vlc external player works as expected so I'm not sure why this cant?

EricChan1989 commented 9 months ago

Lotta people watch with subs because terrible mic positioning and sound editing.

Or simply watching a foreign show. This issue has plagued me for longer than I remember.

Switching to vlc external player works as expected so I'm not sure why this cant?

Seems the developer simply doesn't want to change anything regarding this...

pniewiadowski commented 9 months ago

Seems the developer simply doesn't want to change anything regarding this...

Don't put to much pressure on the devs. They are doing it for free and investing their time. Appreciate it

nielsvanvelzen commented 9 months ago

I've said this before and I'm going to say it again: There is only one person maintaining the entire app and that is me. I have a full-time job and only work on Jellyfin in my spare time, not only on this app but a lot more parts (server/docs/sdk/support/etc.). I'm working on rewriting the entire playback code because the current code is messy and unmaintainable, the next version of the app, 0.16, already uses this for music playback and a future version will entirely use this new code. Most of the current issues will be fixed with that, including the subtitle support.

While this doesn't solve this specific issue right now, it will in the future. I've decided myself to not touch the old playback code unless I need to (e.g. new issues introduced with changes for 0.16 or refactoring needed when changing other parts of the app). This issue existed before I even used Jellyfin.

Then, to reply to the people that say this is an "easy change": well just make a pull request with that "easy change". I'll review it. But stop demanding all kinds of stuff from me, help out or use different software.

ggogel commented 9 months ago

After experimenting and understanding the subtitle code logic, I've found a reliable solution for my setup. I've now switched the default player to Exoplayer. Previously, I used libVLC, but it often led to other issues.

Additionally, I adjusted the server-side 'Playback' settings as follows:

With these settings, subtitles seem to work very reliably, though they may be burned in, which I find acceptable.

I've successfully tested PGSSUB, SUBRIP, and DVDSUB.

voc0der commented 9 months ago

After experimenting and understanding the subtitle code logic, I've found a reliable solution for my setup. I've now switched the default player to Exoplayer. Previously, I used libVLC, but it often led to other issues.

Additionally, I adjusted the server-side 'Playback' settings as follows:

* Disabled 'Allow encoding in HEVC format'. HEVC encoding with subtitle burn-in is very resource-intensive and also does not seem to work as reliably as AVC encoding.

* Disabled 'Allow subtitle extraction on the fly'.

With these settings, subtitles seem to work very reliably, though they may be burned in, which I find acceptable.

I've successfully tested PGSSUB, SUBRIP, and DVDSUB.

What does disabling that do exactly when transcoding? Does it use H264 in that case or something?

galaux commented 9 months ago

Hi ! And thanks for the project !

Subtitles won't load either one one video though they seem to work OK on others. I couldn't find the options mentioned in the previous comment but realized some subtitles work with playback "libVLC" while other work with "Exo". Configuring the playback to "automatic" seems to make for me.

ggogel commented 8 months ago

After experimenting and understanding the subtitle code logic, I've found a reliable solution for my setup. I've now switched the default player to Exoplayer. Previously, I used libVLC, but it often led to other issues. Additionally, I adjusted the server-side 'Playback' settings as follows:

* Disabled 'Allow encoding in HEVC format'. HEVC encoding with subtitle burn-in is very resource-intensive and also does not seem to work as reliably as AVC encoding.

* Disabled 'Allow subtitle extraction on the fly'.

With these settings, subtitles seem to work very reliably, though they may be burned in, which I find acceptable. I've successfully tested PGSSUB, SUBRIP, and DVDSUB.

What does disabling that do exactly when transcoding? Does it use H264 in that case or something?

It uses h264 also referred to as AVC.

ggogel commented 8 months ago

Hello everybody,

I wanted to report that with 0.16 burn in of DVDSUB stopped working in some cases for me. I upgraded from 0.15.12 to 0.16.1 and now to the latest version of 0.16.4.

In the server transcoding logs I can see that in all cases the transcoding started just fine but then gets interrupted. The app shows playback error and continues playback with subtitles off.

Some of the media with DVDSUB never works, while others always work. The only difference I've found so far is that the ones that never work had TRUEHD audio, while the ones that work had DD 5.1 audio. The video was HEVC transcoded to AVC in all cases.

Playing the same not working media on the Android mobile client burns in the subtitles without any problems. So it can't be a backend issue. For some reason the Android TV client is failing although it gets a working stream from the server.

Starfoxfs commented 8 months ago

Same here on Nvidia Shield TV Pro 2019 , i used LibVLC (experimental) and Exoplayer and sometimes the Message "Can´t load subtitles" appears. Sometimes it works fine without Transcoding.

Exoplayer has more "Transcoding of Subtitles" then LibVLC.

LibVLC have less Problems with Audio e.g. DTS-HD MA then Exoplayer but this is another issue.

cybericius commented 7 months ago

"Unable to load subtitle" - Android TV. I tried to tweak all kind of options: fallback font, allow subtitle extraction on the fly, plugins: open subtitles, subtitle extract, exoplayer, libvnc... no luck. Time to time, after forgetting what I changed, works, but absolutely non-reliable.

averagejooe commented 7 months ago

"Unable to load subtitle" - Android TV. I tried to tweak all kind of options: fallback font, allow subtitle extraction on the fly, plugins: open subtitles, subtitle extract, exoplayer, libvnc... no luck. Time to time, after forgetting what I changed, works, but absolutely non-reliable.

I am not dev in the slightest. But I can echo that main dev has said to focus on other issues first and eventually (tbh im unsure if it will ever) fix the issue. You could scroll down a bit and see under Development tab there has been 2 attempts to fix the issue, unfortunately I can't comment further on disagreement between them. Hopefully someone would come along that were able to make the solutions coexist with older code. For now, my workaround is to use multiple Kodi instances that play along with subs. I think I use either Kodi Maven for DV, and normal Kodi or some other Kodi build for hi10p Anime i forgot which one tho.

nielsvanvelzen commented 7 months ago

You could scroll down a bit and see under Development tab there has been 2 attempts to fix the issue, unfortunately I can't comment further on disagreement between them.

One of them just removed all subtitle related code, effectively breaking all subtitle formats when a device doesn't support it. The other one was abandoned by the author.

Also see my previous comment: https://github.com/jellyfin/jellyfin-androidtv/issues/145#issuecomment-1837130374

professornope commented 6 months ago

Bumping this to say this is still an issue on 10.8.13.

Running Jellyfin direct on hardware with GPU transcoding enabled. Client is Amazon Firestick.

Works on PC and mobile if I first turn off subtitles, then re-enable them (Might be different issue).

tundrablasen commented 6 months ago

another bump, because like half the world watches movies and tv shows with subtitles.

10.8.13 jellyfin server 0.16.6 android tv

version still does not load the subtitles in default exoplayer.

thanks @nielsvanvelzen for taking your free time to maintain the software we are all using.

with my post i do not want to put any additional pressure on you, just wanted to point out that i think thats an critical issue and its known since now almost 5 years. most of the world population are non native english speakers or are hearing impaired so they rely on subtitles.

thanks for your work and thank you for spending your skills and your free time to provide us with this great piece of software

averagejooe commented 6 months ago

another bump, because like half the world watches movies and tv shows with subtitles.

10.8.13 jellyfin server 0.16.6 android tv

version still does not load the subtitles in default exoplayer.

thanks @nielsvanvelzen for taking your free time to maintain the software we are all using.

with my post i do not want to put any additional pressure on you, just wanted to point out that i think thats an critical issue and its known since now almost 5 years. most of the world population are non native english speakers or are hearing impaired so they rely on subtitles.

thanks for your work and thank you for spending your skills and your free time to provide us with this great piece of software

I feel you haha i also depended on subtitles to hear anything. I recommend setting up Kodi with Jellycon for your platform. It should be available universally from Windows, Android TV, and even Firestick 4k. Jellycon doesn't have any problem loading subtitles.

If your host server is really close to the client, you could even use Moonlight/Sunshine to re-stream the video from Windows' Jellyfin Media Player. Tho i think you won't need this if you're not streaming rare hi10p codecs or have sufficient cpu power in the client.

LiamKarlMitchell commented 5 months ago

I suspect this is unrelated to original issue but will post here just in-case it helps someone using Opera I can see the subtitles in chrome but not in opera gx. When I disable RGX feature that sharpens/enhances the video I can see subtitles.

I could see subtitles had loaded in the network tab of dev tools.

Glisse1 commented 4 months ago

I have discovered this issue with loading internal subtiles in mkv has a "solution", at leas on android tv. Reliable and works 100 % of the time, but it is just inconvenient.

  1. Start movie and pause it (or you can let it run if you want, does not matter)
  2. Try to load some subtitles
  3. Wait until it says "unable to load", sometimes it takes longer, sometimes is faster.
  4. Try AGAIN to load any subtile and again wait for 'unable to load"
  5. After the second "unable to load" it works, all subtitles are selectable

As I said, this works 100 % of times, i ve watched some 50-60 tv episodes from different tv shows. But it takes 2 minutes or so, that s the inconvenient part. It would be nice if someday, when possible, will get fixed up. And the navigation, pressing "next" for 30 seconds should be1 press of 1 button on the remote without any pausing, not 3 buttons "arrow, ok, ok" as it is now.. but that s another story.. I m used to how Disney, HBO Max, etc, app work, with just 1 press, maybe that s why :)

normanu commented 4 months ago

Is this fixed in 10.9 ?

djl0 commented 4 months ago

In case this is a helpful workaround for anyone else, I was not able to load subtitles from within android tv, but I could if i played it from my phone and casted to the android tv jellyfin app

tundrablasen commented 4 months ago

I've said this before and I'm going to say it again: There is only one person maintaining the entire app and that is me. I have a full-time job and only work on Jellyfin in my spare time, not only on this app but a lot more parts (server/docs/sdk/support/etc.). I'm working on rewriting the entire playback code because the current code is messy and unmaintainable, the next version of the app, 0.16, already uses this for music playback and a future version will entirely use this new code. Most of the current issues will be fixed with that, including the subtitle support.

While this doesn't solve this specific issue right now, it will in the future. I've decided myself to not touch the old playback code unless I need to (e.g. new issues introduced with changes for 0.16 or refactoring needed when changing other parts of the app). This issue existed before I even used Jellyfin.

Then, to reply to the people that say this is an "easy change": well just make a pull request with that "easy change". I'll review it. But stop demanding all kinds of stuff from me, help out or use different software.

Hi @nielsvanvelzen

is there a roadmap or ETA when this playback code re-write will be used for video (and hopefully fix the missing subtitle support feature)?