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

Add Dolby Vision data pass through #90

Closed
wants to merge 1 commit into from

Conversation

chainikdn
Copy link
Contributor

#87

@CrendKing
Copy link
Owner

Thank you. How do I test if it's working? Any public sample video and steps to verify in player like MPC?

@chainikdn
Copy link
Contributor Author

Google -> "dolby vision sample" ;)

@CrendKing
Copy link
Owner

As I understand, DV is an alternative implementation of HDR? And you are trying to pass the DV metadata to the renderer, right?

So what's not working? I downloaded some samples, I can't tell any difference between those DV videos and normal videos. Do I need to manually turn on HDR in Windows? Do I need specific video renderer (MPCVR? madVR?) Can you show me some screenshots before and after this fix?

@chainikdn
Copy link
Contributor Author

Are you kidding? O_o
https://4kmedia.org/lg-earth-dolby-vision-uhd-4k-demo/
Play it via MPC VR and via EVR. See the difference.

@CrendKing
Copy link
Owner

CrendKing commented Oct 25, 2023

I do see the differences in color and contrast now with the video you provided. But I still can't tell any differences in some other DV videos such as https://4kmedia.org/lg-dolby-vision-uhd-4k-demo/. Not sure if that video being HDR is the key to trigger. Also it seems only MPC VR and mpv support DV out of box. madVR test build 181 doesn't (at least out of box).

All of these details are not straight obvious for someone uninitiated on the topic. That's why I asked you for setup instructions at beginning. Could have saved us both much time.

@chainikdn
Copy link
Contributor Author

chainikdn commented Oct 25, 2023

But I still can't tell any differences in some other DV videos

meaning it's some kind of fake DoVi w/o any meta-data... dunno

Also it seems only MPC VR and mpv support DV out of box

it's right in the first message: "Latest MPC Video Renderer supports Dolby Vision" ;)

if (const ATL::CComQIPtr<IMediaSideData> sideData(outSample); sideData != nullptr) {
processSourceFrameIters[0]->second.hdrSideData->WriteTo(sideData);
bool ok = false;
if (sourceFrameNb >= 0) { //must be always set with AVS 3.6+
Copy link
Owner

Choose a reason for hiding this comment

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

In which case would sourceFrameNb differ from processSourceFrameIters[0]->first? When we emplace the source frame in AddInputSample(), the key to the _sourceFrames entry is _nextSourceFrameNb, which is also what you put into the frame prop. So in theory they should always be the same. Which means, processSourceFrameIters[0]->second.hdrSideData should be the same as iter->second.hdrSideData.

@chainikdn
Copy link
Contributor Author

Please read #87 carefully...
In some cases I need to set different source frame for the interpolated frame. I.e. not the "left" one, but "right".

@CrendKing
Copy link
Owner

CrendKing commented Oct 25, 2023

Gotcha. It's nice now both AVSF and VPSF pass the side data to output frame in consistent manner.

The only nitpick I have is that I personally don't like to use the output parameter in AVSF's PrepareOutputSample(). I would like to move the whole side data section in WorkerProc() to PrepareOutputSample(), just like what we do in VPSF. That way there is no need to output anything other than the bool result. Would you mind making that change, or I make that (cosmetic) change after I merge the PR? I could post it in a PR so you can review, if you want. Let me know.

@CrendKing
Copy link
Owner

Hi @chainikdn. Are you still working on this?

@CrendKing
Copy link
Owner

Close for inactivity.

@CrendKing CrendKing closed this Dec 17, 2023
@chainikdn
Copy link
Contributor Author

If you don't want to merge this - I'm good with my own build.

@CrendKing
Copy link
Owner

Huh? In October, I asked you to make a small change before I merge the PR, and you since disappeared. I tried to not invade your space by changing it myself, since you blamed me for "you'll rewrite everything from scratch anyway".

Let me ask again: please move the whole side data section in WorkerProc() to PrepareOutputSample(), just like what we do in VPSF. That way there is no need to output anything other than the bool result. If you have your reason to not do it, please say it so we can discuss.

@chainikdn
Copy link
Contributor Author

chainikdn commented Dec 18, 2023

You asked if you can rewrite everything from scratch and obviously you can cause that's what you will do anyway. No need asking me if you can do this or not. Yes, you can :D This is why I didn't wanted to make any PRs at all, just give you all the necessary info so you could do it on your own from the beginning.

Are you still working on this?

No I'm not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants