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 selection based on connected TV device #8944

Closed ssenanayake closed 1 year ago

ssenanayake commented 3 years ago

Use case description

Currently Exoplayer selects the codec based on the available codecs on the device. But in the case of some devices like nVidia Shield, the device contains Dolby Vision AND HDR10 codecs.

We have noticed that Exo, in such cases can deliver Dolby Vision to a HDR10 TV or vice versa resulting in color distortions.

Proposed solution

Without modifying Exo, we at ViacomCBS have modified the player framework that uses Exo to take into consideration the connected TV's capabilities and deliver the appropriate rendition.

Alternatives considered

krocard commented 3 years ago

Could you please clarify what is the issue? I don't understand in which situation color are distorted. Especially why HDR10 support would impact Dolby Vision decoding and display.

Without modifying Exo, we at ViacomCBS have modified the player framework that uses Exo to take into consideration the connected TV's capabilities and deliver the appropriate rendition.

Could you share what modification you have made to help us understand the issue. Is it a color space issue?

ssenanayake commented 3 years ago

Yes, it is a color space issue.

We use a helper method which does the following....

WindowManager manager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
if (manager != null) {
    Display display = manager.getDefaultDisplay();
    Display.HdrCapabilities hdrCapabilities = display.getHdrCapabilities();
    if (hdrCapabilities != null) {
            int[] types = hdrCapabilities.getSupportedHdrTypes();
            if (types != null) {
                for (int type : types) {
            // Check for Display.HdrCapabilities.HDR_TYPE_HDR10 , HDR_TYPE_DOLBY_VISION , HDR_TYPE_HDR10_PLUS 
        }
        }
    }
}

and we use the Display capabilities to filter out the DASH or HLS renditions that have incompatible formats...i.e. in the case of the nVidia Shield connected to a HDR10 only TV, we would filter out any Dolby Vision representations/renditions, so that what's given to Exo is only HDR10.

We use a custom DASH Parser/HLS Parser which can filter representations and also for extracting and supporting DASH and HLS based seek thumbnails (which is a different topic).

What we noticed if allowing Exo to send a Dolby Vision representation to a HDR10 TV is the following color space issue.

dv_on_hdr10_bad

The above image is Exo on nVidia Shield connected to a Sony TV (2016 model, which only supported HDR10). Exo would deliver the Dolby Vision representation to this TV, resulting in color space distortions. By filtering the manifest based on the connected display's HDR capabilities, we are providing only HDR10 to Exo in this example.

krocard commented 3 years ago

@AquilesCanta could this be a dup of [internal b/187012233]?

AquilesCanta commented 3 years ago

@krocard I don't think so, but we can confirm.

@ssenanayake Would you kindly provide sample media for each of the problematic usecases? If you don't want to share it publicly, you can send links to dev.exoplayer@gmail.com, with subject "Issue #8944".

ssenanayake commented 3 years ago

@AquilesCanta I have requested from out content team for the "Picard" episode with Dolby Vision and a DRM LA URL that I will email when I receive it.

Thanks.

AquilesCanta commented 3 years ago

I think it would be a better option if the content was not encrypted. I assume you have a clear version for all of your test streams, would you kindly provide a clear one? The reason is that DRM introduces yet another failure point, so it might mislead or delay the investigation.

google-oss-bot commented 3 years ago

Hey @ssenanayake. 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 3 years ago

Since there haven't been any recent updates here, I am going to close this issue.

@ssenanayake if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

christosts commented 2 years ago

Note for anyone following updates on this issue: we have a similar request in #9794 and we plan to address this in an upcoming release. Please follow #9794 for updates.

microkatz commented 1 year ago

@ssenanayake We are looking at fixing this. Would you be able to provide a link to the DASH or HLS sample that you were using/mentioned above?

If you're unable to share the test content publicly, please send it to dev.exoplayer@gmail.com with subject "Issue https://github.com/google/ExoPlayer/issues/8944" . Please also update this issue to indicate you've done this.

microkatz commented 1 year ago

This issue was addressed by the following commits: