google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.7k stars 6.02k forks source link

Dolby Vision/HDR10 video file defaults to dolby vision #9794

Closed Nioh8 closed 1 year ago

Nioh8 commented 2 years ago

Also referenced in issue #8944

So i am using justplayer (which is using exoplayer) on the nvidia shield to play my blu ray rips. blu ray rips which contain both the dolby vision and hdr10/10+ metadata.

My tv only supports hdr10 but instead of exoplayer recognising both metadata and switching over to hdr 10 it becomes washed out and dull as if dolby vision isn't switching off. I assume thats the issue anyway.

I have tested the same rips of another player on the shield like MX player and the hdr 10 comes through fine.

i could provide a sample rip to test if thats helpful?

i am only assuming this isnt a fault with justplayer and its something to do with exoplayer, my knowledge is limited so if there is anything i can do to help let me know thanks.

christosts commented 2 years ago

i could provide a sample rip to test if thats helpful?

Yes, a link to test content, reproduction steps and a bug report obtained from the device right after the issue occurs help us debug issues like this.

If you're unable to share bug reports or test content publicly, please send them to dev.exoplayer@gmail.com with subject "Issue #9794" . Please also update this issue to indicate you've done this.

Overall, have you tried using the ExoPlayer demo application directly with your content to see what happens?

Nioh8 commented 2 years ago

I have sent an email with a link to media that contains the dolby vision/hdr 10 metadata.

as for testing the demo application. the only android enviroment i have is the nvidia shield, i have a windows pc so i am not sure how i would test that on my end.

also not sure what i would have to do to send a bug report from the shield device.

my best help is the media file i have emailed with a link too, the media file in question i opened up with justplayer on my shield and the issue is the same, the HDR is washed out and the metadata switch over from dolby to hdr10 wasn't happening.

My tv is a samsung HDR10 HDR10+ HLG device.

is there anything more i could provide let me know thanks.

not sure if this would help but here is a link to the issue over on justplayers github. it may elobarate more on what i have tried to explain.

https://github.com/moneytoo/Player/issues/166

Nioh8 commented 2 years ago

just a small update, i managed to build the demo for my nvidia shield and assign the media that i was having the HDR issues with, same media as the email link. Same results with the washed out hdr. letting you know if it helps.

christosts commented 2 years ago

Thanks for trying it out on the ExoPlayer demo app. I will need some additional assistance: please play the content with the ExoPlayer demo app (a few seconds will suffice), then grab a bug report from the Shield and send it to us (or attach it on this issue).

I'm interested to see which decoder ExoPlayer picked on your specific setup. I've tried out the content on a few setups I have available:

I wonder if in your setup, the player picks the DV decoder and that creates the incompatibility issue with the non-DV capable display.

Thanks

Rubarius commented 2 years ago

Exactly the same problem on iFFalcon 55k61 and TCL v615 only the image turns green or purple. In Vimu in the settings there is a switch that disables Dolby Vision and all movies show normally in HDR, in MX Player I turn on HW, at the top when watching a movie, instead of HW+ and movies get HDR instead of Dolby Vision. I believe that in our case, the switch in the settings that forcibly disables Dolby Vision will help, as it is implemented in Vimu. The players think that there is a DV on the TV and display it on the screen, but the TV itself does not actually support the DV, although the corresponding mode is turned on and the Dolby Vision logo appears.

christosts commented 2 years ago

@Rubarius as mentioned above, we'd appreciate a link to the content and a bug-report taken from the device so that we can inspect how content is being decoded when the issue happens.

google-oss-bot commented 2 years ago

Hey @porterballs. We need more information to resolve this issue but there hasn't been an update in 14 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot commented 2 years ago

Hey @porterballs. We need more information to resolve this issue but there hasn't been an update in 14 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot commented 2 years ago

Hey @Nioh8. We need more information to resolve this issue but there hasn't been an update in 14 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

Exeu commented 2 years ago

Same issue here. I debugged it a bit and it is related to where the MatroskaExtractor is getting its dolbyvision config from:

https://github.com/google/ExoPlayer/blob/release-v2/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mkv/MatroskaExtractor.java#L2223

My TV does not support dolby vision aswell but apparently it tries to use dolby vision resulting in the tv does not recognize it as HDR and then the image is washed out.

Bypassing this part of that code works since then no dolby vision codec is applied anymore.

Exeu commented 2 years ago

fyi @christosts

christosts commented 2 years ago

I finally managed to get my hands on a nVidia Shield Pro and reproduced the issue. I observed washed-out colors on a couple of TVs.

The TVs that I reproduced on have HDR10 support but the platform API Display.getHdrCapabilities() returned no HDR support at all. Interestingly, a Chromecast device connected on the same HDMI port can detect HDR capabilities. It's not clear to me if there is an issue on the Shield detecting HDR, or reporting the HDR capabilities proprely via this API.

The stream that was provided to us can be decoded with the HEVC decoder, and doing gives much better colours. In ExoPlayer 2.17.1, the player checks if a Dolby Vision stream can be decoded with the HEVC decoder. An app can implement a workaround to use HEVC over Dolby Vision as follows (bottom-up):

I'm not convinced that adding this logic on ExoPlayer will not risk a regression. As I mentioned, on the TVs where this was observed, the Shield could not connect the HDR capabilities, so it could be a Shield-specific issue. Perhaps apps can proactively apply the workaround when running specifically on Shield and the TV does not have any HDR capabilities .Or the app can expose an option to their UI so that users enable/disable this.

christosts commented 2 years ago

Update: we will change the codec selection to pick the Dolby Vision decoder only when the TV display capabilities indicate Dolby Vision support, otherwise fall back to the HEVC decoder (HDR10). We have not planned this so I cannot share when this will be implemented. In the meantime, the player does offer API hooks for an app to override the codec selection logic and apply the fallback, as I described on the comment above, so apps can work around this issue already.

Exeu commented 2 years ago

@christosts , needed now to switch back to a previous version of exoplayer... the workaround was not working anymore for some videos since getDecoderInfos only returns one entry and that is dolby/vision.. so throwing out dolby vision ends up in returning an empty list of decoder infos.

vegedb commented 1 year ago

@microkatz

It still doesn't fallback to HDR. Problem of black screen still persists. https://github.com/moneytoo/Player/issues/392

microkatz commented 1 year ago

@vegedb If you can please open up a new issue.

Also would you be able to provide test content/a bug report with your issue along with the following information provided by the issue template? The issue template can be found here. If you're unable to share bug reports or test content publicly, please send them to dev.exoplayer@gmail.com using a subject in the format "Issue #1234" ("#1234" is replaced with your issue number). Please also update this issue to indicate you've done this.

vegedb commented 1 year ago

Also would you be able to provide test content

@microkatz I've uploaded a test file with multiple HDR backwards compatibility. Hope you could resolve it.

DV-HDRtest1_.zip

HDR format : Dolby Vision, Version 1.0, dvhe.07.06, BL+EL+RPU, Blu-ray compatible / SMPTE ST 2086, HDR10 compatible

microkatz commented 1 year ago

I've tested with your sample. The file does not play as your Dolby Vision sample has profile 7 which is deprecated and of which we don't support fallback functionality (here).

Exoplayer is working as intended.

vegedb commented 1 year ago

I've tested with your sample. The file does not play as your Dolby Vision sample has profile 7 which is deprecated and of which we don't support fallback functionality (here).

Exoplayer is working as intended.

dvhe.07.06 or dvhe.05.09 isn't the issue here. The issue is to totally skip Dolby Vision entirely regardless of profiles as most TVs or android player do not support it. Falling back to HDR if there's even an ounce of DV would be great for exoplayer moving forward.

On another note, Does this comment/solution disables Dolby Vision entirely? https://github.com/google/ExoPlayer/issues/9794#issuecomment-1133053542

microkatz commented 1 year ago

@vegedb

dvhe.07.06 or dvhe.05.09 isn't the issue here. The issue is to totally skip Dolby Vision entirely regardless of profiles as most TVs or android player do not support it. Falling back to HDR if there's even an ounce of DV would be great for exoplayer moving forward.

There are customers and devices with Dolby Vision scenarios and so we cannot remove support for it. The fixes added in 2.18.2 should help alleviate some of the issues with devices that do not support Dolby Vision. If the device's display does not support Dolby Vision and the stream can be decoded as H264/H265 then the player will try and do so. In addition, if a device's display does not support Dolby Vision then in for an adaptive media scenario, alternative mimetype tracks will more preference over Dolby Vision tracks.

On another note, Does this comment/solution disables Dolby Vision entirely? #9794 (comment)

This will prevent the player from being able to decode and render Dolby Vision entirely as it won't have any decoders available to decode Dolby Vision media. However, in the case of your given media sample, the experienced result might be the same. When I tested your sample with an Nvidia Shield setup, there were not any available decoders for your media's profile and getDecodersInfo returned an empty list. The demo app presented a toast message reporting it could not support playing that content and the app played out "nothing" for the 3 seconds length of the content.

vegedb commented 1 year ago

@microkatz

This will prevent the player from being able to decode and render Dolby Vision entirely as it won't have any decoders available to decode Dolby Vision media. However, in the case of your given media sample, the experienced result might be the same. When I tested your sample with an Nvidia Shield setup, there were not any available decoders for your media's profile and getDecodersInfo returned an empty list. The demo app presented a toast message reporting it could not support playing that content and the app played out "nothing" for the 3 seconds length of the content.

Maybe this is the reason for it. I've discovered that there's an additional parameter that has effect on exoplayer. Display P3 (DCI-P3) vs BT.2020

I've made an issue on justplayer https://github.com/moneytoo/Player/issues/398 with video test files, do take a look.

DCI-P3.zip Mastering display color primaries : Display P3 BT.2020.zip Mastering display color primaries : BT.2020

microkatz commented 1 year ago

@vegedb In this case, can please open up a new Github issue.

Please provide complete information as requested in the issue template. The issue template can be found here. If you're unable to share bug reports or test content publicly, please send them to dev.exoplayer@gmail.com using a subject in the format "Issue #1234" ("#1234" is replaced with your issue number). Please also update this issue to indicate you've done this.