Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exoplayer should report VP9 support with MP4 container in DeviceProfileBuilder.kt #1311

Closed
1 of 3 tasks
tburtenshaw opened this issue Mar 12, 2024 · 3 comments · Fixed by #1324
Closed
1 of 3 tasks
Labels
bug Something isn't working confirmed Confirmed bug reports that shouldn't go stale

Comments

@tburtenshaw
Copy link
Contributor

Describe the bug

Playing MP4 files with the VP9 codec works flawlessly with both the Web Player and Android TV Exoplayer.

But it is reported as unsupported by the Android version, even though the codec/container format most likely works. This leads to unnecessarily transcoding of VP9 MP4 files. (Which is a reasonably common combination.)

At:
https://github.com/jellyfin/jellyfin-android/blob/master/app/src/main/java/org/jellyfin/mobile/player/deviceprofile/DeviceProfileBuilder.kt
Looking at line 206:

// mp4
arrayOf("mpeg1video", "mpeg2video", "h263", "mpeg4", "h264", "hevc", "av1"),

It should contain "vp9" as a supported type.

Looking at the profile for other related players:
Compared with AndroidTV-Exoplayer:
{ Name: "AndroidTV-ExoPlayer", ...
[DirectPlayProfile { Container: "m4v,mov,xvid,vob,mkv,wmv,asf,ogm,ogv,mp4,webm", AudioCodec: "aac,mp3,mp2,aac_latm,alac,ac3,eac3,dca,dts,mlp,truehd,pcm_alaw,pcm_mulaw,opus,flac", VideoCodec: "h264,hevc,vp8,vp9,mpeg,mpeg2video,av1", Type: Video },

Compared with Web Player:
DirectPlayProfile { Container: "mp4,m4v", AudioCodec: "aac,mp3,opus,flac,vorbis", VideoCodec: "h264,hevc,vp9,av1", Type: Video }

I understand there may be issues with certain codecs not formally being supported, but I think for playback use a more pragmatic approach would be preferred.

It works in both webplayer and AndroidTV, so I think that altering the hardcoded list to contain "vp9" should be safe and relatively easy change.

Logs

No response

Application version

2.6

Where did you install the app from?

Google Play

Device information

Samsung S23

Android version

Android 14, One IU 6.0

Jellyfin server version

10.8.13

Which video player implementations does this bug apply to?

  • Web player (default)
  • Integrated player (ExoPlayer)
  • External player (VLC, mpv, MX Player)
@tburtenshaw tburtenshaw added the bug Something isn't working label Mar 12, 2024
@Maxr1998
Copy link
Member

Maxr1998 commented Mar 12, 2024

I wasn't aware that VP8/VP9 were supported in mp4 container. Should indeed be an easy fix.

Might even be a good idea to take this occasion to synchronize our list with the information from this Wikipedia article.

@Maxr1998 Maxr1998 added the confirmed Confirmed bug reports that shouldn't go stale label Mar 12, 2024
@tburtenshaw
Copy link
Contributor Author

tburtenshaw commented Mar 17, 2024

Thanks very much for your quick response.

I've tested VP9 in .MP4 (both on the TV app, and also recompiled the app with "vp9" added to that array), and Exoplayer plays it directly and seeks without any issue.

Interestingly, I can't find any primary source that says VP9 is supported within MP4. But it seems to work with VLC, Windows Media Player, Soda Player and VirtualDub2 on my computer, as well as being played Chrome, Edge and Firefox, as well as webapp on my TV, Samsung Browser and iPhone.

Re VP8: I haven't been able to find an example of VP8 in MP4 container. FFMpeg also refuses to put VP8 into .MP4 files, so haven't been able to check that.

So at the moment, I've only been able to confirm VP9 works with MP4 containers. Also I'm not sure the reliability of that compatibility matrix on Wikipedia.

I guess what's important is what actually works on Exoplayer, so adding VP9 at this stage should be enough. I'm trying my first ever pull request. #1324 (which I maybe should have done based off 2.6.z instead?)

I've made a folder of "CodecInContainer" files for a few other formats which I'll test, and I'll post another issue if I find anything useful.

@Maxr1998
Copy link
Member

While codec code-points are registered for both VP8 and VP9 [1], it seems like only VP9 received a stream ObjectTypeIndication [2]. This might explain why only VP9 is supported.

Nonetheless, I agree with going with what currently works. Thanks for the PR, I'll review and merge it in a minute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working confirmed Confirmed bug reports that shouldn't go stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants