jarnedemeulemeester / findroid

Third-party native Jellyfin Android app
GNU General Public License v3.0
2.55k stars 159 forks source link

10bit HEVC not redering video #217

Open Sttoch opened 1 year ago

Sttoch commented 1 year ago

Describe the bug When using MPV player (hardware or software decoding), any 10bit HEVC video is audio-only. ExoPlayer can't direct play 10bit HEVC content To Reproduce Steps to reproduce the behavior:

  1. Enable mpv player in settings
  2. Play any 10bit HEVC file

Device info:

Additional context Video I using to test: Title: 1080p HEVC SDR Codec: HEVC Profile: Main 10 Level: 120 Resolution: 1920x800 Aspect ratio: 2.40:1 Interlaced: No Framerate: 23.976025 Bitrate: 3389 kbps Bit depth: 10 bit Video range: SDR Video range type: SDR Pixel format: yuv420p10le Ref frames: 1

CommanderRedYT commented 1 year ago

Weird, I just tried playing back a 4K hevc movie and it worked fine..

Codec: HEVC
Profile: Main 10
Level: 153
Resolution: 3840x2160
Aspect ratio: 16:9
Interlaced: No
Framerate: 23.976025
Bitrate: 68516 kbps
Bit depth: 10 bit
Video range: HDR
Video range type: HDR10
Color space: bt2020nc
Color transfer: smpte2084
Color primaries: bt2020
Pixel format: yuv420p10le
Ref frames: 1
decisoft commented 1 year ago

Hi, more info on this topic.

This is the video info:

Título1080p HEVC SDR
Códec HEVC
Perfil Main 10
Nivel120
Resolución 1920x960
Relación de aspecto 2:1
Entrelazado No
Fotogramas por segundo 25
Tasa de bits 2351 kbps
Profundidad de bits 10 bit
Rango de video SDR
Video range type SDR
Formato del píxel yuv420p10le
Cuadros de referencia 1

It's HEVC 10 bits. But the thing is that on my tablet, I can only hear the audio, not the video, as @Sttoch commented. On my Google Pixel 6a, it works fine, both with MPV player. I've upgraded to 0.9.0 on my tablet as #227, but it keeps happening.

 Device info:
     Device: Realme Pad (RMP2103)
     Android version: 11
     App version: v0.9.0
     Jellyfin version: 10.8.8 (Linux docker)

Thanks in advance!

jarnedemeulemeester commented 1 year ago

@Sttoch @decisoft There may be a bug with the hevc hardware decoder on your device. Could you try with mpv but hevc hardware decoding off. In "Settings -> Player -> Hardware decoding codecs" turn off hevc. Then it will use software decoding.

decisoft commented 1 year ago

Hi @jarnedemeulemeester! I've tested that with the Realme Pad and didn't work either. The thing is that if I use Jellyfin official app and select external player, the same episode plays flawlessly on VLC (but the integration to Jellyfin in terms of timestamps and logging is very poor). I also deactivated the whole decoding hardware on Findroid but the video doesn't load, only audio.

Nonetheless, my gf has a Samsung Galaxy Tab S6 Lite (2022), and she can play everything, including this HEVC 10bit on Findroid without MPV player, just with the default player.

If you want me to do some more tests, or contribute in anyway, feel free to ask me!

jarnedemeulemeester commented 1 year ago

@decisoft Could you try setting Hardware decoding to mediacodec and Video output to gpu-next? Also test that with hevc enabled in the Hardware decoding codecs.

Those settings are required for me to play 10-bit hevc using mpv on my Sony TV (also has a Mediatek SoC).

The problem seems to be related to the SoC. The Redmi 9 and Realme Pad are both using the MT6769V.

If the above settings don't work then could you try the official mpv-android app? If the official mpv-android app also shows no video then maybe we should open an issue on the mpv-andoid repo.

decisoft commented 1 year ago

I've just tried both things (mediacodec/gpu-next and mpv-android official) and doesn't work either. With the first option, mediacodec and gpu-next on Findroid, the sound is fine, and the image goes like 0.25x of speed, so it is unviewable. With the official app, the same as I've comment: only sound, so maybe there is the problem

Thanks again :)

decisoft commented 1 year ago

Hi everyone again,

As @jarnedemeulemeester pointed out, it's a thing related to Mediatek HelioG80 CPU but there is something strange. I've tested HEVC 10bit videos on a Samsung Galaxy Tab A8 (Unisoc Tiger T618) and besides ExoPlayer can't direct play the video, with MPV player it does.

But then I've tested with a Samsung Galaxy A13, that also has the Mediatek Helio G80 CPU (MT6769V), and it can direct play HEVC 10bit. I've always tested with the same episode, the one I mentioned on my first comment.

So, in my experience (tested Pixel 6a, Xiaomi Mi 9 Lite, Samsung Galaxy Tab S6 Lite 2022, Realme Pad, Samsung Galaxy A13), the issue only happens on the Realme Pad, that shares CPU with Galaxy A13 but on the phone it can, the tablet not.

Hope it can helps, feel free to ask anything.

cheers and congrats for the app!

AnonymousWebHacker commented 1 year ago

https://github.com/jarnedemeulemeester/findroid/issues/176

The same thing happened here at the beginning and @jarnedemeulemeester solved it, at least the support at the software level worked on low-ram and low-end devices (Redmi 9A) and on his Google Pixel

But it keeps happening on other devices, like samsungs https://github.com/jarnedemeulemeester/findroid/issues/176#issuecomment-1473715210

@Sttoch @decisoft @CommanderRedYT Supposedly findroid works with internal exoplayer, and with mpv.

Exoplayer works perfectly for high-end devices, which have native support at the hardware level to read hevc videos, mainly 10 bit; but very bad in low-end devices, with little ram and that do not have native support for HEVC.

The MPV option came to solve this problem, to then transcode at the software level.

@jarnedemeulemeester After you fixed my issues (link mentioned above). I noticed that it had been solved for low ranges and most of the Redmi devices, but in some intermediate or higher ranges such as Samsung, they do not work

NicholasFlamy commented 1 year ago

I had a Galaxy A53 which doesn't support any form of 10 bit color. It will play 10 bit with software decoding but it's laggy. Some phones have really weird things like this. My Galaxy Tab S6 Lite has 10 bit color support. My old A32 5G also worked with 10 bit color. It's really stupid that some budget phones doesn't have at least 10 bit to 8 bit tone mapping support so that the hardware acceleration can still be used.

NicholasFlamy commented 1 year ago

I used this website to test what plays and what doesn't: http://www.larmoire.info/jellyfish/