Add Dolby Vision Profile 10 Playback Support#2830
Add Dolby Vision Profile 10 Playback Support#2830ybai001 wants to merge 2 commits intoandroidx:mainfrom
Conversation
Merge latest code from upstream main branch
This PR adds Dolby Vision profile 10 (AV1 based) playback support. Profile 10 includes profile 10.0 (not backward compatible), profile 10.1 (HDR10 compatible) and profile 10.4 (HLG compatible).
| } else if (profile == CodecProfileLevel.DolbyVisionProfileDvav110) { | ||
| if (format.colorInfo != null | ||
| && format.colorInfo.colorTransfer == C.COLOR_TRANSFER_ST2084 | ||
| && format.colorInfo.colorRange == C.COLOR_RANGE_FULL) { |
There was a problem hiding this comment.
Here, it means this is a DV profile 10.0 content, which is not backward compatible to AV1 so that it cannot be played as AV1 content on non-Dolby licensed device.
Instead, DV profile 10.1 and 10.4 can be played as AV1 content on non-Dolby licensed device.
See more details on https://professionalsupport.dolby.com/s/article/What-is-Dolby-Vision-Profile?language=en_US, table 2.
There was a problem hiding this comment.
@ybai001
Do DV profiles 10.1 and 10.4 not have these color space values? Or your solution is to only set these values for 10.0 and using that fact to make sure its not backwards compatible?
If other DV profiles have these color space values then its not a robust solution. What if in the future that information is generally parsed for all DolbyVision streams for some other purpose? Is there any other way to know the cross-compatibility id?
There was a problem hiding this comment.
@microkatz, we actually set these values for other profiles here.
Let me provide more info about this code change.
Dolby Vision profile 10 includes profile 10.0, 10.1 and 10.4 currently. P10.0 is not backward-compatible with AV1 and cannot be played on non-Dolby licensed device while P10.1 and P10.4 can. The purpose of this piece of code is to return null for P10.0 and to return MimeTypes.VIDEO_AV1 for P10.1 and 10.4.
This method (getAlternativeCodecMimeType()) is called in both track selection and codec selection phase.
During track selection phase, the input is manifest file. CCID is not explicitly indicated in manifest file. The only method is to calculate it based on supplementalCodecs and supplementalProfiles (Since neither supplementalCodecs nor supplementalProfiles is the member of Format structure, we set ColorInfo at first then conclude the CCID based on it).
During codec selection phase, the input includes MPEG4 box info. CCID can be get directly by parsing Format::initializationData.
As a common method in both track selection and codec selection phase, we adopted the ColorInfo method in this PR.
I agree it is not a perfect solution. In future, maybe we need to update getColorInfoForFormat() method to adapt new Dolby Vision profile definitions.
There was a problem hiding this comment.
CCID is not explicitly indicated in manifest file. The only method is to calculate it based on supplementalCodecs and supplementalProfiles (Since neither supplementalCodecs nor supplementalProfiles is the member of Format structure, we set ColorInfo at first then conclude the CCID based on it).
Just to clarify, you said that "CCID is not explicitly indicated in the manifest file" but you can interpret it through the supplementalCodecs and supplementalProfiles data? Or more specifically if the codecs string starts with dav1 then it is 10.0 and not 10.1/10.4?
I don't think only setting the ColorInfo for these specific cases is a robust solution. It may be in the future that we need to set this data for the other profiles as well.
Is there any other difference between 10.0, 10.1 & 10.4 that we can use? If we are able to identify the profile characteristic from the manfiest and there is not another value in Format that we can set, then we might need to add a value to Format.
There was a problem hiding this comment.
Just to clarify, you said that "CCID is not explicitly indicated in the manifest file" but you can interpret it through the supplementalCodecs and supplementalProfiles data? Or more specifically if the codecs string starts with dav1 then it is 10.0 and not 10.1/10.4?
Right.
Is there any other difference between 10.0, 10.1 & 10.4 that we can use? If we are able to identify the profile characteristic from the manfiest and there is not another value in Format that we can set, then we might need to add a value to Format.
Based on the current "format" structure, this is no other reliable parameter we can use. This is has been reviewed by our Dolby Vision architecture team. ColorInfo is a reliable method since its difference has been declared in Dolby Vision specification document. I actually discussed with Dolby Vision architecture team about adding supplementalCodecs and supplementalProfiles into "format" structure but they didn't suggest me to do it in that way. There is an internal discussion about whether adding a new field in manifest to indicate CCID directly but there is no timeline when decision is done. Since DV profile 10 content creation tool/code has already been delivered to customs, we have to make AndroidX Media support this profile now. The method in this PR is a solution after Dolby internal discusssion.
|
Hi, @microkatz, is there any status update on this PR? There are already devices that support Dolby Vision profile 10 in the market so that we would like to accelerate the process of this PR merge. Thanks. |
|
Thank you for bumping this back onto our radar. I'm working on merging in the requested changes in a different PR. This is due to that your changes coming from a private repo would've necessitated a dirty merge. I'll update this thread when the PR has been merged into the main branch. |
|
One thing that would really help would be if you had content with which we could test the new code? Would you be able to provide such sample content? If you cannot provide it publicly then please email it to us at android-media-github@google.com with subject line "Issue 2830". |
@microkatz, has shared test assets via email. The introduction of these assets are also included in the email. Please check it. |
This change adds support for Dolby Vision profile 10, which uses AV1 as the base layer. The "dav1" codec string is now recognized as Dolby Vision. In addition, colorInfo is parsed from Dolby Vision codec strings and supplemental profiles in DASH and HLS manifests. The colorInfo is utilized to prevent fallback to the base AV1 codec for non-backwards compatible Dolby profiles. Issue: #2830 PiperOrigin-RevId: 869296253
|
Thanks for the email with the content and the specifics on potential testing. With respect to the latter of course it may take a bit to get our hands on a suitable device. In the meantime, I worked on submitting a version of your PR some minor alterations and provided unit tests. It was submitted into the main branch in eef8a41. Please check that the support issue has been addressed and then we can close this PR. Thanks for your persistence and patience! |
Thanks. Most of our engineers are still in Spring Festival and will be back to office next week. So we will verify it after that and let you know the result. Stay tuned. |
|
Hello @ybai001 Do you know what happens if the user plays Dolby Vision Profile 7 content on an unsupported device. Seems it either crashes or user only hears audio. Does this PR help with this situation. and if not can you consider a PR to handle it? Maybe downscaling to DVP5 or use DVP8.1. |
Hi, @ram130, Dolby Vision Profile 7 has been deprecated. Dolby officially supports profile 5/8/9/10 now. This patch only focuses on profile 10, which is not relevant to profile 7. Where does your profile 7 content come from? Profile 7 was Blu-Ray related. If your device doesn't support Blu-Ray, this content cannot be played. At the same time, again, this profile has been deprecated and Dolby doesn't support it any more. |
Thank you on the reply. I have alot of Blu-Ray content I stream locally through a video player that uses this player and the latest beta version. I've noticed the older movies or ones containing Profile 8.1, 5 plays fine. But for Profile 7. I get audio only. Sometimes complete freezing. A few of my friends in my neighborhood also noticed the same. As a result we mostly don't watch those movies until a certain day when we use the physical disc or we convert the local file. Can a fallback mechanism please be added for such edge cases when Profile 7 is detected on an incompatible device? That way it can use a compatible layer or profile? Maybe something to just ignore the FEL layer and just use MEL? |
@microkatz , Dolby testing team has started the verification task from this week. I'll let you know the result as long as it is done. |
AndroidX Media doesn't support profile 7 and we have no plan to support it since it has been deprecated. |
Thanks. I think you misunderstood. I'm not asking for you to support it. Just to add a fallback to a compatible layer for devices that try to play it so they don't get audio only or freeze. This compatible layer can be either of the supported profiles Dolby is currently pushing for, DV5/8. Either one. |
I see. For profile 8.1, if the device doesn't support Dolby Vision, this file will be played as HDR10 (compatible mode). For profile 5, if device doesn't support Dolby Vision, this file cannot be played since profile 5 doesn't include any compatible layer. For profile 7, the only compatible layer is Blu-Ray. It cannot fallback to other profiles. This behavior is by design. |
Understood. Thanks for the time and insight. I'm guessing other external players some of my neighbors tried to use seem to be able to do that by converting. Based on my research of one it seems it edits the meta data or something to allow it to fall to 8.1. I guess coming back around there are only two options
And possibly another option would be converting it to 8.1/5 since no fallback is available. Which Dolby probably would like I guess. Time to begin the process of recoding my content then. |
This PR adds Dolby Vision profile 10 (AV1 based) playback support.
Profile 10 includes profile 10.0 (not backward compatible), profile 10.1 (HDR10 compatible) and profile 10.4 (HLG compatible).