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

MKV Dolby Vision Support #7667

Merged
merged 8 commits into from
Aug 26, 2020
Merged

MKV Dolby Vision Support #7667

merged 8 commits into from
Aug 26, 2020

Conversation

willtrking
Copy link
Contributor

This adds in support for reading Dolby Vision data from MKV files per the modifications to the Matroska spec here ietf-wg-cellar/matroska-specification#390

This should address #7267

@google-cla google-cla bot added the cla: yes label Jul 24, 2020
@krocard krocard requested a review from kim-vde July 24, 2020 08:30
@steffenmanden
Copy link

steffenmanden commented Jul 30, 2020

Just for the sake of convenience, here is some test material with DV profile 5 and 8 (video only, no audio in the files):

https://www.makemkv.com/download/dvtest/

@willtrking
Copy link
Contributor Author

Great stuff @steffenmanden! I tested locally and ExoPlayer properly extracts the DV info. I'm working on cutting them down to the first few frames to be of a smaller file size so I can included them in this PR as test media.

@willtrking
Copy link
Contributor Author

willtrking commented Jul 31, 2020

During the process of generating small enough MKV test media for this PR, I determined I needed to start from shorter mp4 test media as there isn't a current MKV editor that will properly handle Dolby Vision. I also noticed that ExoPlayer currently lacks Dolby Vision mp4 tests, even though it support Dolby Vision within mp4's already.

I generated short mp4 test media from Dolby's public Dolby Vision sample's using Dolby's public mp4 muxer/demuxer and have included tests to validate them in this PR as well. If you take a look at the .dump files, you will see the dolby vision codec / mime properly detected. These files also play properly in the real world using the ExoPlayer demo application on an nvidia shield.

Will update again when MKV test media is included.

Dolby's public Dolby Vision samples can be found here

Copy link
Contributor

@kim-vde kim-vde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR! Unit tests for MKV would really be helpful. Hope you manage to generate test content :)

@steffenmanden
Copy link

just wanted to note that mkvtoolnix now supports DV data and therefore mkv testdata should be possible to make for the testcase

@willtrking
Copy link
Contributor Author

@kim-vde Apologies for the delay. MKV test files have been added

@kim-vde
Copy link
Contributor

kim-vde commented Aug 19, 2020

Thanks @willtrking. Do you confirm that the test assets have been generated from public content and can therefore be open-sourced?

@cannikin
Copy link

cannikin commented Aug 22, 2020

MediaInfo will be adding support for recognizing Dolby Vision inside MKV files in their next release: MediaArea/MediaInfo#478 (comment)

Very excited for this PR as it's the missing piece of the Dolby Vision playback puzzle! Thanks so much @willtrking!

@willtrking
Copy link
Contributor Author

Yes @kim-vde, as mentioned these were generated from Dolby's public samples at the link below

https://developer.dolby.com/tools-media/sample-media/video-streams/dolby-vision-streams/

@kim-vde
Copy link
Contributor

kim-vde commented Aug 25, 2020

Hi @willtrking,

I am afraid that it is not sufficient for the samples to be public in order to use them as test contents. My previous message was incorrect, sorry for that.

We need to make sure that we are allowed by Dolby to modify the samples and add them to our tests. I don't think it is the case here (see the Terms of use). Maybe you know more about this?

An alternative would be to use content that you own.

@cannikin
Copy link

The problem is that not just anyone can create Dolby Vision clips in something like iMovie—you need to apply for and purchase a plugin from Dolby in order to create Dolby Vision-enabled content and add it into a professional video editing suite, like Davinci Resolve. I imagine not many people outside of professional film editors have access to these tools.

@willtrking I'm not familiar enough with the data structure of these video clips...is it possible to just munge the actual video content with random characters, but keep the DV metadata intact?

If not, is there anything we can do for now to get the code merged until we can find public domain clips @kim-vde? Can @willtrking remove the tests that depend on the embedded video clips until we can replace them?

@willtrking
Copy link
Contributor Author

I see @kim-vde

Unfortunately I'm not really able to produce dolby vision content at home, at least easily or cheaply.

I found open source dolby vision content from Netflix at the link below, but this content uses a version of the Creative Commons license that specifically states that any content that is altered may not be shared, and the content would need to be altered to make it small enough to be a reasonable test.

https://opencontent.netflix.com/

I could simply remove the test media from the PR if that would be acceptable.

@andrewlewis
Copy link
Collaborator

@ybai001 Do you have any minimal Dolby Vision media we could add to the project to use for testing? Thanks!

@willtrking
Copy link
Contributor Author

Munging the data is an interesting idea @cannikin, it may actually be possible to do using dolby's mp4 demuxer.

If this worked, it would result in a final video final that contains a partial piece of the original Dolby Vision metadata from the dolby vision data linked above, plus a video I created.

The file would, of course, still contain some amount of data that is covered by Dolby's Terms of Use as I cannot produce the Dolby Vision metadata on my own.

I'm not enough of a licensing expert to know if that would be acceptable @kim-vde

@steffenmanden
Copy link

As far as i can see, no terms are listed for the LG demo files:

https://4kmedia.org/lg-earth-dolby-vision-uhd-4k-demo/

@willtrking
Copy link
Contributor Author

@steffenmanden to my knowledge, that source (4kmedia.org) is not associated with LG, which would mean the content may have terms located elsewhere

@cannikin
Copy link

Another thing I thought about was reaching out to users in a thread like this https://liftgammagain.com/forum/index.php?threads/dolby-vision-and-textless.14828/ and see if someone that already has a license can help us out by generating some clips and giving them to us under something like the MIT license.

@steffenmanden
Copy link

steffenmanden commented Aug 25, 2020

LG support says we are allowed to use it and also shorten the video. Got screens and will get an email
Screenshot_20200825-193049_Chrome

@cannikin
Copy link

Here's a post over at makemkv.com where someone created a 10 second DV file from scratch: https://makemkv.com/forum/viewtopic.php?p=95224&sid=7675e2b1d2b2d4e8f6ece2fd45ef0af1#p95224 They're not 100% sure it works because they don't have a device capable of playing DV, but it sounds like this PR should be able to test it!

@kim-vde kim-vde merged commit bcad98b into google:dev-v2 Aug 26, 2020
@kim-vde
Copy link
Contributor

kim-vde commented Aug 26, 2020

I merged the PR without the tests.

The samples from LG cannot be used because we need a clear and specific license.

And even if we find content that’s clearly licensed, we would probably need to change the structure of our code in order to include this license, which seems too much overhead.

So I suggest we only add tests if the content is owned by the PR writer or is derived from content that is already in our test samples. Dolby Vision tests would still be very helpful (for MKV or for MP4) so, if you are able to generate such content, please open a new PR to add the tests.

@willtrking
Copy link
Contributor Author

Thank you @kim-vde !

@kim-vde
Copy link
Contributor

kim-vde commented Sep 1, 2020

@willtrking I found some test samples that can be used (Dolby Vision.zip). Could you make one of them shorter, transcode it to Matroska and add MP4 and Matroska tests (or explain me how to do it)? Thanks!

@google google locked and limited conversation to collaborators Oct 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants