Swiftfin
Swiftfin copied to clipboard
External subtitles are not displayed
Describe the bug
All external subtitles are not displayed.
No matter the format of external subtitles is srt or ass can not be displayed.
Embedded subtitles can be displayed.
The video formats tested are all mkv.
Application version
1.0.0(74)
Where did you install the app from?
TestFlight
Device information
iPhone 12 Pro
OS version
IOS 15.4.1
Jellyfin server version
10.8.0(docker nyanmisaka/jellyfin)
Thank you for the issue. By "external subtitles" do you mean subtitles that are downloaded and are an explicit file in your library?
Thank you for the issue. By "external subtitles" do you mean subtitles that are downloaded and are an explicit file in your library?
Yes. These external subtitles can be displayed by desktop Chrome or Jellyfin Mobile (iOS) 1.4.1 (5.4.1.0) or Android-TV v0.13.3.
Any update on this issue?
I looked at this a little bit yesterday. The same subtitles on the same media in 10.7.7 and 10.8 had the same URL. However, in 10.8, I received an HTTP 400 error when loading.
I think I need to compare it with other Jellyfin clients.
Infuse 7 also have the same issue https://community.firecore.com/t/update-for-jellyfin-10-8-0/36956 https://community.firecore.com/t/external-jellyfin-subtitles-not-loading/37776
MrMC and Jellyfin Mobile work just fine
Summary from the PR:
There is something incorrect in the server that incorrectly labels the subtitle format on the media stream, not with the delivery URL in the app. However I do not see this error on my development server which is 10.8.0.
For proof that it is a server issue, I currently have srt subtitles that are incorrectly being labeled as subrip on my home server:

and with my development branch on master they are labeled correctly:

I will have to find the logs and file a server issue.
Edit: this happens to me as well on my development after I add new media with external subtitles.
Can you test if it still happens on a current build of the 10.8 release branch before filing the issue?
This does still occur on the branch release-10.8.z
I think both SubRip and SRT and valid, SRT is the file extension of SubRip subtitles.
format_name=srt equals to codec_name=subrip in ffprobe.
External ASS subtitles are not displayed too.
@nyanmisaka Would you be able to provide a screenshot of media with ass external subtitles like I have to see if they're being mislabeled?
You can access that in your media -> click the three vertical dots -> Edit subtitles
For whatever reason I can't upload pictures but I just checked it on a fresh library: external ASS subs are listed as ASS on the current release branch.
And I'm not sure if this really is a server bug because technically SubRip is the correct codec name - srt is just the extension. Edit: The bad delivery URL is a server bug but the codec name isn't.

External ASS subtitle works just fine only if I remuxed them into the video.
@Shadowghost Sorry, you are correct in the codec specification. I understand now.
https://github.com/jellyfin/Swiftfin/blob/6cab041c42cb0b1cdd4d9445f44c7b7b3416a1f3/Shared/Objects/DeviceProfileBuilder.swift#L140 explicitly declares subrip which is then just appended to the filename in
https://github.com/jellyfin/jellyfin/blob/b36543275f8e1c380f5c247a04a48d5d96eb5836/MediaBrowser.Model/Dlna/StreamInfo.cs#L910
Let's keep all convo about this in Matrix from now on
The original issue will be fixed by https://github.com/jellyfin/jellyfin/pull/7960, however I have run into an issue where the stream indices differ and can throw the player into an infinite loop and still not show external subtitles. I'll have to test some more to see if this issue is just to my specific movie, whether the streams differ on new scans, or whatever
There were changes in 10.8 in regards to stream indices: external subtitles and audio have lower stream indices than the ones from the file itself, in 10.7 external streams were appended to already existing ones. You most likely need to subtract the amount of external streams from the StreamIndex to get the StreamIndex the stream has within the media file.
Thanks for the insight, changes a lot of debugging.
I'm seeing on the server side requests with url encoded api_key param, for example,
GET /Videos/<hash>/Subtitles/1/0/Stream.subrip%3Fapi_key=<token>
and subsequently triggering the exception,
System.ArgumentException: Unsupported format: subrip?api_key=<token>
at MediaBrowser.MediaEncoding.Subtitles.SubtitleEncoder.GetWriter(String format)
at MediaBrowser.MediaEncoding.Subtitles.SubtitleEncoder.ConvertSubtitles(Stream stream, String inputFormat, String outputFormat, Int64 startTimeTicks, Int64 endTimeTicks, Boolean preserveOriginalTimestamps, CancellationToken cancellationToken)
...
It looks like this extra url encode is another problem preventing the external subtitle from showing. I'm running jellyfin server v10.8.1 which understands the subrip format.
I'm seeing on the server side requests with url encoded
api_keyparam, for example, ...
Thank you for the analysis. I'll take care of it quickly.
Im seeing this on the ATV client. External SRT downloaded via the open subtitles and is stored alongside the file, the client shows the subtitle is checked but nothing is showing on screen. I assume this happens on iOS apps as the app is universal.
We are not related to the ATV client. The only thing we need to fix to close this issue is the stream index changes.
Oh, which github repo is related to the Apple TV app then? Isnt SwiftFin a universal iOS app?
I apologize, I got mixed up. ATV has typically meant Android TV.
When will #533 be released?
This was released in the latest iOS release, tvOS will get it in its next release.
This was released in the latest iOS release, tvOS will get it in its next release.
Alright! Any status for the tvOS release?
It will be relatively soon