-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Regression since mpv 0.25: wrong colors with hardware decoding on Windows #4804
Comments
That file host is really fucking annoying, btw. |
|
@garoto More likely, that makes them all look wrong. Sounds like there was a regression in the DXVA2 color matrix loading code in between 0.24 and 0.26. |
I don't think there's anything like "DXVA2 color matrix loading code". |
Probably every video format is affected, I could also find the problem with other videos. dxva2-copy current (looks different to software decoding): Sample: Would be nice if the issue with damaged chroma channel with any hardware decoding could be fixed for next release. :) |
Those two images look identical to me. |
You can see that the red arrow head has more distinct dark outlinings with recent mpv versions when using hardware decoding, which is a sign of quality degradation (undesired blur). |
Oh, yes - I see it. Although this sample doesn't seem to have the BT.601/BT.709 issue you were talking about previously. |
Is it possible that this issue is just caused by misaligned chroma? If the colormatrix tag doesn't survive the abstraction layers, then maybe the chroma position tag doesn't either. A verbose log for both would help. |
Hope this helps: |
And the other version? |
Thought so. old mpv:
It goes from CL=mpeg2/4/h264 to CL=unknown, consistent with the result (the chroma plane seems misaligned based on the screenshot). This is probably the same issue as the other one. Some metadata does not survive. |
I just tried a completely different file (MP4 container, 4k H.264 59.95fps) and it shows the same behavior. |
i see the same also for some hevc files |
Is it possible this is an ffmpeg bug? I'm not entirely sure where that metadata comes from, whether it's mpv or ffmpeg. |
Linux + cuda also shows CL=unknown. |
Sounds like some pretty significant regression in whatever component is responsible for loading color space params. If it also affects cuda then I may be able to bisect it when I'm back on an nvidia GPU. |
cuda probably doesn't export this field in the first place. |
I gave mpv 0.27.0-13-ga4de782272 a try: So cuda has a quality drawback in general? |
To answer the question by myself: Yes, it apparently does. There is no great distortion going on, but the chroma channel gets slightly shifted by a pixel or a few vs. software decoding or vdpau. |
Unknown whether cuvid's API can export it, but ffmpeg's wrapper certainly doesn't. We should probably select a better fallback for this. Ideas? |
If we could figure out a way of distinguishing between jpeg and non-jpeg in guess_csp would could probably just set the default based on that and get it right 95% of the time? |
Yes, it could be set in that function. |
If the chroma location is missing, vo_gpu will use centered chroma. Select a better chroma location by default: normally, it will always be MPEG video chroma location. If full levels are used, use JPEG chroma location, because that sort of sounds like it could make sense as it might coincide with JPEG being decoded. See e.g. #4804.
Thank you, wm4! I can't recognize a difference to software decoding now. |
mpv version and platform
0.24: last version not affected
0.25 - 0.26: affected
build by shinchiro from 2017-08-19: affected
Windows 10 x64 Creators Update
Reproduction steps
Play a cartoon video with distinguishable colors and compare software decoding vs. any hardware decoding on Windows
Expected behavior
Colors/image quality of hardware decoding copy mode vs. software decoding should be without difference.
Actual behavior
Colors with DXVA2-copy look wrong.
0.26 software decoding:
https://abload.de/img/mpvsoftwarecmsuw.png
0.24 dxva2-copyback:
https://abload.de/img/mpvoldh6shl.png
0.26 dxva2-copyback:
https://abload.de/img/mpvdxva2copy44sx1.png
Log file
http://sprunge.us/PeDP
Sample files
http://www87.zippyshare.com/v/hzYy0T0D/file.html
The text was updated successfully, but these errors were encountered: