jellyfin / jellyfin-android

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

ExoPlayer profiles don't always work as expected - unnecessary transcoding, broken transcodes #28

Open Maxr1998 opened 3 years ago

Maxr1998 commented 3 years ago

The currently shipped ExoPlayer profile doesn't properly advertise the device capabilities in some cases, e.g. HEVC seems to be transcoded sometimes although it shouldn't need to. Since I'm not very knowledgeable into the internals of Jellyfin transcoding and profiles, I'd request others to help me with getting to profile to work properly with as many devices as possible.

Maxr1998 commented 3 years ago

This is planned to be resolved with a new apiclient that's already integrated with ExoPlayer and handles media playback itself.

misterbit-pro commented 3 years ago

This is planned to be resolved with a new apiclient that's already integrated with ExoPlayer and handles media playback itself.

Is there an ETA when this new apiclient will be integrated, because the problem presits in v2.1?

nielsvanvelzen commented 3 years ago

New apiclient will be released after the 10.7 server version (since it is not compatible with 10.6). But it will not contain playback related code from the start.

ghost commented 3 years ago

@nielsvanvelzen Just wondering if there is any news on this now that Jellyfin 10.7 has finally reached stable.

nielsvanvelzen commented 3 years ago

Working on the new apiclient, branch implementing it already exists in this repository. Hopefully beta release in 1 to 3 weeks.

nielsvanvelzen commented 3 years ago

@Maxr1998 I think this issue is mostly fixed now right?

Maxr1998 commented 3 years ago

I think so? We don't use/check the resolutions yet, however. The biggest problem was that Android could misreport wrong limits marking files as unsupported that ExoPlayer would play just fine.

binarydad commented 3 years ago

I'm still having issues where HEVC content is transcoding on the JF android app; content that Direct Plays on the Plex android app.

Maxr1998 commented 3 years ago

The biggest problem was that Android could misreport wrong limits marking files as unsupported that ExoPlayer would play just fine.

This could help with querying codec, profile and level support: https://github.com/google/ExoPlayer/blob/045048f6f54aafb0f801aa80df514027b04452b7/library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecUtil.java

GodTamIt commented 2 years ago

jellyfin/jellyfin#6450 and jellyfin/jellyfin#6454 might be relevant here, as some of the cases might be covered in those bugs.

jellyfin-bot commented 2 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.

Maxr1998 commented 2 years ago

Still an issue.

zx900930 commented 2 years ago

Video codec : mpeg-h part2/hevc Audio codec : aac Subtitle : ssa

Jellyfin Android 2.4.4 ExoPlayer showing its working using transcode mode, but after about 5s, it stopped with a black screen.

anshibanov commented 1 year ago

It's actual

IgitBuh commented 1 year ago

This open issue is now celebrating its 2nd anniversary. The official Jellyfin Android and iOS apps are apparently still unable to play HEVC files without transcoding (tested on multiple different up-to-date devices), although the unofficial Findroid app or the Jellyfin app on FireTV work correctly. If I disable transcoding for a user profile on the server, then HEVC files won't play at all in the official Android/iOS app.

I don't know if Findroid uses ExoPlayer as well. If it does, maybe use their settings? If they use a different player, maybe consider switching the player?

Maxr1998 commented 1 year ago

It seems to be highly dependent on the played media and playback device, since I'm able to play 4K HEVC mkvs without issues on my Samsung and Pixel devices. It's also possible that the OS misreports the codecs supported by the device.

IgitBuh commented 1 year ago

@Maxr1998 Playback of a HEVC video (4K or HD) on a Pixel 6 Pro is only possible with transcoding. Direct playback without transcoding results in an error. Please check correctly: Administration > Dashboard > Users > Click your user > Media Playback: Leave the first item checked, but uncheck everything else ("Allow audio/video playback that requires transcoding/conversion"). Now try playing a HEVC video in the official Android app. It will give you a client codec error, although it still works in Findroid on the same device and on a FireTV 4K stick.

Maxr1998 commented 1 year ago

I did that, it still works and is explicitly direct playing. Maybe a bitrate limit is causing this? Could you take a look into the server logs to see what's causing the transcode?

IgitBuh commented 1 year ago
[2022-08-19 10:58:15.200 +00:00] [INF] [155] Jellyfin.Api.Helpers.MediaInfoHelper: User policy for "admin". EnablePlaybackRemuxing: False EnableVideoPlaybackTranscoding: False EnableAudioPlaybackTranscoding: False
[2022-08-19 10:58:15.201 +00:00] [INF] [155] Jellyfin.Api.Helpers.MediaInfoHelper: StreamBuilder.BuildVideoItem( Profile="Anonymous Profile", Path="/Samples/sample_2560x1440.mkv", AudioStreamIndex=null, SubtitleStreamIndex=-1 ) => ( PlayMethod=Transcode, TranscodeReason=VideoCodecNotSupported ) "media:/videos/866089d3-da9f-8e63-cb1f-1763fe625999/stream?MediaSourceId=866089d3da9f8e63cb1f1763fe625999&api_key=<token>&SubtitleMethod=Encode&RequireAvc=false&Tag=377c67ede11033f58de4301fa483d9b6&TranscodeReasons=VideoCodecNotSupported"
[2022-08-19 10:58:15.362 +00:00] [INF] [98] Emby.Server.Implementations.Session.SessionManager: Playback stopped reported by app "Jellyfin Android" "2.4.4" playing "sample_2560x1440". Stopped at "0" ms

You can download this sample here: https://4kmedia.org/the-world-in-hdr-uhd-4k-demo/

Maxr1998 commented 1 year ago

Thanks for the sample. Also direct plays both on my Pixel 5 and Z fold 4.

The Anonymous Profile in your logs is somewhat odd. For me, it shows

[INF] [69] Jellyfin.Api.Helpers.MediaInfoHelper: User policy for Max. EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True
[INF] [69] Jellyfin.Api.Helpers.MediaInfoHelper: RemoteClientBitrateLimit: 10000000, RemoteIp: 192.168.178.100, IsInLocalNetwork: True
[INF] [69] Jellyfin.Api.Helpers.MediaInfoHelper: StreamBuilder.BuildVideoItem( Profile=Jellyfin Android, Path=/video/videos/Samples/The World In HDR 4K Demo/The World In HDR 4K Demo.mkv, AudioStreamIndex=null, SubtitleStreamIndex=null ) => ( PlayMethod=DirectPlay, TranscodeReason=0 ) media:/videos/cb37ba7b-2cf9-6372-0d4b-39a86c2d3775/stream.mkv?<long_url>

Note the Jellyfin Android profile specifically. Which version of Jellyfin are you on? Did you enable the integrated (ExoPlayer) player in the client settings of the app?

IgitBuh commented 1 year ago
Server: Jellyfin
Version: 10.8.4
Operating System: Linux
Architecture: X64

Installed it just yesterday in Docker from jellyfin/jellyfin:latest. (I'm switching over from Plex.) Android version installed also yesterday from Google Play Store.

Integrated player ("Based on ExoPlayer"): "Media cannot be played by this device" (as a line at the bottom) Web player: "Playback Error - This client isn't compatible with the media and the server isn't sending a compatible media format. [Got It]" (as a custom message)

I've noticed in your log that all your transcoding settings are set to True:

EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True

Are you really, really, 100% sure you disabled transcoding for the very same profile on your server?

Edit: I just enabled transcoding for my user again and expected the file started playing and in the log I now also see: EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True" I'm kind of convinced that you still have transcoding enabled. Please make sure you are editing the same used that you are using on your Android client and that you have definitely disabled the options I have described previously.

IgitBuh commented 1 year ago

I would like to add another observation: On my iOS tablet I've been using nPlayer for a very long time. I now also tried using it with Jellyfin and noticed something strange. In Jellyfin I have enabled DLNA and nPlayer found it. If I now open the movies list, the x264 files are shown with an additional line such as "MKV 4.81 GB" but the x265 files lack any additional details (if transcoding is off) or are shown just as "TS" without any size information (if transcoding is on).

I conclude that at least through DLNA the Jellyfin server sends incorrect details for x265/HEVC files. Maybe the same happens with the App as well. The app then refuses to play it because it knows nothing about the file (thus "Anonymous Profile"?), while Findroid or the Jellyfin app on FireTV just start playing it without knowing anything about the file?

Based on that, maybe that's not really an issue of the Jellyfin apps but of the server? However, the issue wouldn't be present if the apps just played the file like the other apps do.

Maxr1998 commented 1 year ago
Server: Jellyfin
Version: 10.8.4
Operating System: Linux
Architecture: X64

Installed it just yesterday in Docker from jellyfin/jellyfin:latest. (I'm switching over from Plex.) Android version installed also yesterday from Google Play Store.

Ok, same here.

I've noticed in your log that all your transcoding settings are set to True:

EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True

Are you really, really, 100% sure you disabled transcoding for the very same profile on your server?

I know, I enabled them again after my testing. I just retried again with them off, and it worked just fine.

[INF] [302] Jellyfin.Api.Helpers.MediaInfoHelper: User policy for Max. EnablePlaybackRemuxing: False EnableVideoPlaybackTranscoding: False EnableAudioPlaybackTranscoding: False
[INF] [302] Jellyfin.Api.Helpers.MediaInfoHelper: RemoteClientBitrateLimit: 10000000, RemoteIp: 192.168.178.100, IsInLocalNetwork: True
[INF] [302] Jellyfin.Api.Helpers.MediaInfoHelper: StreamBuilder.BuildVideoItem( Profile=Jellyfin Android, Path=/video/videos/Samples/The World In HDR 4K Demo/The World In HDR 4K Demo.mkv, AudioStreamIndex=null, SubtitleStreamIndex=null ) => ( PlayMethod=DirectPlay, TranscodeReason=0 ) media:/videos/cb37ba7b-2cf9-6372-0d4b-39a86c2d3775/stream.mkv?<long_url>

The web player doesn't work for me either. (Same "This client isn't compatible with the media and the server isn't sending a compatible media format." message). This happens because the web view doesn't have the necessary codec support, that's why the integrated player is preferable and will be the default in the future (once it supports all features). This issue is only about the integrated player/ExoPlayer.

I can't comment on the topic of DLNA because I don't use it. It may be an issue with the server, yes.

IgitBuh commented 1 year ago

This issue is only about the integrated player/ExoPlayer.

Yes, sure. I'm just trying to provide all details that might be relevant. Same for DLNA. I understand that it has nothing to do with with the Android app, but I believe the source of this problem might have something to do with this issue.

Even if it is some kind of server problem, I can't stress enough that it works with exactly the same server without any issues with Findroid and the Jellyfin FireTV app. (but not on the latest Pixel phone and multiple 1-3 years old Samsung devices)

So what now? Anything else I could do to analyze the problem?

Maxr1998 commented 1 year ago

I wonder if it's a configuration issue on my or your server. Especially since we use similar devices.

Still, since it lists VideoCodecNotSupported as transcode reason, could you download AIDA64 and check if video/hevc is listed among the supported codecs? It's not impossible your devices misreport their codec support for HEVC.

Furthermore, could you please check the maximum bitrate you have set in Playback → Streaming?

I apologize for the frustration, but unfortunately, it's quite hard to debug issues like these, especially if I can't reproduce them.

We really need to get better debugging support into our app. That's definitely something I'll look into soon.

IgitBuh commented 1 year ago

I'm not frustrated at all. I am mainly confused that you don't seem to have this issue.

I highly doubt that it's an issue with my device, because it's the same on my Pixel phone as on the Samsung tablet and phones. The only thing they have in common is the same Jellyfin android app.

But nevertheless, here's the AIDA64 output from my Pixel 6 Pro:

<<< Codecs >>>
c2.android.aac.decoder: audio/mp4a-latm
OMX.google.aac.decoder: audio/mp4a-latm
c2.android.aac.encoder: audio/mp4a-latm
OMX.google.aac.encoder: audio/mp4a-latm
c2.android.amrnb.decoder: audio/3gpp
OMX.google.amrnb.decoder: audio/3gpp
c2.android.amrnb.encoder: audio/3gpp
OMX.google.amrnb.encoder: audio/3gpp
c2.android.amrwb.decoder: audio/amr-wb
OMX.google.amrwb.decoder: audio/amr-wb
c2.android.amrwb.encoder: audio/amr-wb
OMX.google.amrwb.encoder: audio/amr-wb
c2.android.flac.decoder: audio/flac
OMX.google.flac.decoder: audio/flac
c2.android.flac.encoder: audio/flac
OMX.google.flac.encoder: audio/flac
c2.android.g711.alaw.decoder: audio/g711-alaw
OMX.google.g711.alaw.decoder: audio/g711-alaw
c2.android.g711.mlaw.decoder: audio/g711-mlaw
OMX.google.g711.mlaw.decoder: audio/g711-mlaw
c2.android.mp3.decoder: audio/mpeg
OMX.google.mp3.decoder: audio/mpeg
c2.android.opus.decoder: audio/opus
OMX.google.opus.decoder: audio/opus
c2.android.opus.encoder: audio/opus
c2.android.raw.decoder: audio/raw
OMX.google.raw.decoder: audio/raw
c2.android.vorbis.decoder: audio/vorbis
OMX.google.vorbis.decoder: audio/vorbis
c2.exynos.h263.decoder: video/3gpp
c2.exynos.h263.encoder: video/3gpp
c2.exynos.h264.decoder: video/avc
c2.exynos.h264.encoder: video/avc
c2.exynos.hevc.decoder: video/hevc
c2.exynos.hevc.encoder: video/hevc
c2.exynos.mpeg4.decoder: video/mp4v-es
c2.exynos.mpeg4.encoder: video/mp4v-es
c2.exynos.vp8.decoder: video/x-vnd.on2.vp8
c2.exynos.vp8.encoder: video/x-vnd.on2.vp8
c2.exynos.vp9.decoder: video/x-vnd.on2.vp9
c2.exynos.vp9.encoder: video/x-vnd.on2.vp9
c2.google.av1.decoder: video/av01
c2.android.av1.decoder: video/av01
c2.android.avc.decoder: video/avc
OMX.google.h264.decoder: video/avc
c2.android.avc.encoder: video/avc
OMX.google.h264.encoder: video/avc
c2.android.h263.decoder: video/3gpp
OMX.google.h263.decoder: video/3gpp
c2.android.h263.encoder: video/3gpp
OMX.google.h263.encoder: video/3gpp
c2.android.hevc.decoder: video/hevc
OMX.google.hevc.decoder: video/hevc
c2.android.hevc.encoder: video/hevc
c2.android.mpeg4.decoder: video/mp4v-es
OMX.google.mpeg4.decoder: video/mp4v-es
c2.android.mpeg4.encoder: video/mp4v-es
OMX.google.mpeg4.encoder: video/mp4v-es
c2.android.vp8.decoder: video/x-vnd.on2.vp8
OMX.google.vp8.decoder: video/x-vnd.on2.vp8
c2.android.vp8.encoder: video/x-vnd.on2.vp8
OMX.google.vp8.encoder: video/x-vnd.on2.vp8
c2.android.vp9.decoder: video/x-vnd.on2.vp9
OMX.google.vp9.decoder: video/x-vnd.on2.vp9
c2.android.vp9.encoder: video/x-vnd.on2.vp9
OMX.google.vp9.encoder: video/x-vnd.on2.vp9

Playback → Streaming is empty (I haven't touched it).

If you want to see certain server or client settings, just tell me and I'll provide screenshots. Please note that I have time tonight and to a limit tomorrow, but will be away for a week after that and won't be able to test or reply during that period of time.

Edit: Please take into account that the problem also exists in the official iOS app on an up-to-date iPad Pro. So based on everything we've seen so far, there is probably some issue on the server but the official Jellyfin Android and iOS apps don't seem to be able to handle it well, while other apps like Findroid or the Jellyfin FireTV app seem to ignore the issue.

IgitBuh commented 1 year ago

Maybe this issue is related: https://github.com/jellyfin/jellyfin/issues/8233

ireun commented 1 year ago

Also, i think that https://github.com/jellyfin/jellyfin-docs/blob/master/general/clients/codec-support.md/ could be updated to reflect which player type does support HVEC. For me Web player (which is sadly default ) needs transcoding from H.265, while integrated player direct streams just fine.

Maxr1998 commented 1 year ago

But nevertheless, here's the AIDA64 output from my Pixel 6 Pro:

<<< Codecs >>>
[...]

Thanks, those seem to be good.

Edit: Please take into account that the problem also exists in the official iOS app on an up-to-date iPad Pro. So based on everything we've seen so far, there is probably some issue on the server but the official Jellyfin Android and iOS apps don't seem to be able to handle it well, while other apps like Findroid or the Jellyfin FireTV app seem to ignore the issue.

I'm also thinking that this could be a server issue. When you sent your log output earlier, was that from using the web player or ExoPlayer? I'd need ExoPlayer to properly judge if the device profile is transmitted correctly (it tells the server which codecs and containers the device supports).

Maxr1998 commented 1 year ago

Also, i think that https://github.com/jellyfin/jellyfin-docs/blob/master/general/clients/codec-support.md/ could be updated to reflect which player type does support HVEC. For me Web player (which is sadly default ) needs transcoding from H.265, while integrated player direct streams just fine.

True, the Android hasn't been updated in a while. Back then, there weren't any integrated nor external players supported.

IgitBuh commented 1 year ago

When you sent your log output earlier, was that from using the web player or ExoPlayer?

I am very sorry, you are right, the previous log was from the web player setting. Here is the log for the same sample file with ExoPlayer selected:

[2022-08-20 07:30:16.348 +00:00] [INF] [21] Jellyfin.Api.Helpers.MediaInfoHelper: User policy for "admin". EnablePlaybackRemuxing: False EnableVideoPlaybackTranscoding: False EnableAudioPlaybackTranscoding: False
[2022-08-20 07:30:16.354 +00:00] [INF] [21] Jellyfin.Api.Helpers.MediaInfoHelper: StreamBuilder.BuildVideoItem( Profile="Jellyfin Android", Path="/Samples/sample_2560x1440.mkv", AudioStreamIndex=null, SubtitleStreamIndex=null ) => ( PlayMethod=Transcode, TranscodeReason=AudioCodecNotSupported ) "media:/videos/866089d3-da9f-8e63-cb1f-1763fe625999/stream?MediaSourceId=866089d3da9f8e63cb1f1763fe625999&api_key=<token>&SubtitleMethod=Encode&RequireAvc=false&Tag=377c67ede11033f58de4301fa483d9b6&TranscodeReasons=AudioCodecNotSupported"

I guess this is more helpful now with TranscodeReason=AudioCodecNotSupported. The sample video does not have any audio track at all.

I now also checked other videos in my library, they have this reason for not playing: TranscodeReason=SubtitleCodecNotSupported Subtitle codec is "HDMV PGS". Subtitles for those videos are shown correctly in Findroid, though.

Knowing that, I searched my library for HEVC videos without any subtitles, found one and it plays fine with ExoPlayer! (the default web player still can't play it - why is it the default player if it's much worse?)

So it all comes down to the app being picky/incorrect with audio and subtitle codecs?

Why is the sample playing in your case, though? Do you have a supported codec definition for "no audio track"?

Maxr1998 commented 1 year ago

When you sent your log output earlier, was that from using the web player or ExoPlayer?

I am very sorry, you are right, the previous log was from the web player setting. Here is the log for the same sample file with ExoPlayer selected:

[2022-08-20 07:30:16.348 +00:00] [INF] [21] Jellyfin.Api.Helpers.MediaInfoHelper: User policy for "admin". EnablePlaybackRemuxing: False EnableVideoPlaybackTranscoding: False EnableAudioPlaybackTranscoding: False
[2022-08-20 07:30:16.354 +00:00] [INF] [21] Jellyfin.Api.Helpers.MediaInfoHelper: StreamBuilder.BuildVideoItem( Profile="Jellyfin Android", Path="/Samples/sample_2560x1440.mkv", AudioStreamIndex=null, SubtitleStreamIndex=null ) => ( PlayMethod=Transcode, TranscodeReason=AudioCodecNotSupported ) "media:/videos/866089d3-da9f-8e63-cb1f-1763fe625999/stream?MediaSourceId=866089d3da9f8e63cb1f1763fe625999&api_key=<token>&SubtitleMethod=Encode&RequireAvc=false&Tag=377c67ede11033f58de4301fa483d9b6&TranscodeReasons=AudioCodecNotSupported"

I guess this is more helpful now with TranscodeReason=AudioCodecNotSupported. The sample video does not have any audio track at all.

I see, thanks for the updated logs. In my case, the sample you linked does have an audio track:

Screenshot_20220820_101228.jpg

You other samples may not have one, but could you check that with mediainfo for those files just to make sure?

I now also checked other videos in my library, they have this reason for not playing: TranscodeReason=SubtitleCodecNotSupported Subtitle codec is "HDMV PGS". Subtitles for those videos are shown correctly in Findroid, though.

Yes, it looks like pgs isn't enabled on our ExoPlayer integration. I'll check if I can fix that.

Knowing that, I searched my library for HEVC videos without any subtitles, found one and it plays fine with ExoPlayer! (the default web player still can't play it - why is it the default player if it's much worse?)

We had it as default in one version, but since it unfortunately doesn't support quality selection and sync play yet, we haven't enabled it as default.

So it all comes down to the app being picky/incorrect with audio and subtitle codecs?

Unfortunately yes.

Why is the sample playing in your case, though? Do you have a supported codec definition for "no audio track"?

See above screenshot, it contains a Vorbis audio track.

IgitBuh commented 1 year ago

Gee, how much can go wrong... Apparently we tested different samples which I now only realized with your screenshot. When I searched for sample files, got to the linked page above, clicked the Download link it said something like "file downloaded too many times / bandwidth exceeded" but had a link to the sample file anyway, so I downloaded it and used for testing. I already wondered about the different file names, but figured you have simply renamed it. I now searched for "sample_2560x1440.mkv" and found this: https://filesamples.com/samples/video/mkv/sample_2560x1440.mkv which is my tested sample file. Apparently you received the correct file while I was forwarded to a fallback? I don't get it, but somehow that's what happened. I guess it's still somehow my fault, sorry for that... Can you test with this file again?

Would it be possible to be more flexible with audio/subtitle codecs and try playing anyway? I don't see how it's better to prevent playing the file at all instead of at least trying (and either succeeding or failing, which wouldn't be worse than not trying at all - like in real life ;) ). Maybe show a message like "Unknown subtitle codec HDMV PGS" at but play anyway?

Maxr1998 commented 1 year ago

Gee, how much can go wrong... Apparently we tested different samples which I now only realized with your screenshot. When I searched for sample files, got to the linked page above, clicked the Download link it said something like "file downloaded too many times / bandwidth exceeded" but had a link to the sample file anyway, so I downloaded it and used for testing. I already wondered about the different file names, but figured you have simply renamed it. I now searched for "sample_2560x1440.mkv" and found this: https://filesamples.com/samples/video/mkv/sample_2560x1440.mkv which is my tested sample file. Apparently you received the correct file while I was forwarded to a fallback? I don't get it, but somehow that's what happened. I guess it's still somehow my fault, sorry for that... Can you test with this file again?

Oh, that explains it. I downloaded the sample directly from the linked Google Drive. Your new sample doesn't direct play for me either.

The reason for that is probably a bug in the server. What happens is that the Android app sends a list of supported codecs, which the server tries to match when deciding whether to direct stream or transcode (this happens on the server, and not the client!). Since the played media doesn't have any audio track, it cannot find a supported codec, failing the matcher and forcing a transcode (or remux, possibly).

findroid, on the other hand, sends a device profile that marks all codecs as supported. Thus, the app either doesn't allow transcoding at all or handles it somewhere else on the client side, which is of course a possibility, but non-standard and not something we as an official app would want to do.

Anyway, what you're experiencing is still a bug and should be fixed. I'll check if I can find the root cause or file an issue on the server repo.

IgitBuh commented 1 year ago

The reason for that is probably a bug in the server. What happens is that the Android app sends a list of supported codecs, which the server tries to match when deciding whether to direct stream or transcode (this happens on the server, and not the client!). Since the played media doesn't have any audio track, it cannot find a supported codec, failing the matcher and forcing a transcode (or remux, possibly).

Thanks for explaining it. I understand both points of view. The huge problem for the official app is that right now codecs or formats that are supported by the device have to be defined in the app. Both problems (HDMV PGS / SubtitleCodecNotSupported and no audio track / AudioCodecNotSupported) prevent the playback although the device would be capable of playing the file. So does that mean that the same problem could exist for other subtitle/audio codecs as well? What about new codecs in the future? Does the app have to be updated for supporting them? (As a related side note, I noticed that a file with EAC3 audio is playing fine in the Android app but fails in the FireTV app, athough the FireTV 4K stick is capable of decoding it.)

I understand that you maintain some kind of whitelist for different file formats and codecs, but that leads to the problem that the app doesn't even try playing it even if the device would be able to handle it. The device could report an incomplete list, there could be new variants, new combinations, new codecs with fallback routines, etc. What I'm trying to say is that the current implementation isn't future proof but relies on being constantly maintained when users run into problems.

I think there should be some kind of these options:

  1. If a codec negotiation with the server fails, it should offer to try to play it anyway instead of just failing (and give an option to remember the decision).
  2. Add an option in the client preferences to force playing files without decoding them (basically what Findroid does).
  3. An easy and transparent option to report incompatible formats to the Jellyfin team with a click of a button.
  4. Never fail to play a video just because a subtitle format is unknown. Maybe throw an optional subtle warning instead.
ireun commented 1 year ago

Also, i think that https://github.com/jellyfin/jellyfin-docs/blob/master/general/clients/codec-support.md/ could be updated to reflect which player type does support HVEC. For me Web player (which is sadly default ) needs transcoding from H.265, while integrated player direct streams just fine.

True, the Android hasn't been updated in a while. Back then, there weren't any integrated nor external players supported.

https://github.com/jellyfin/jellyfin-docs/issues/701 created :)