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

--deband=no --cscale=spline36 breaks if video is metadata rotated and in nv12 format #8223

Closed
CounterPillow opened this issue Nov 1, 2020 · 11 comments · Fixed by #13619
Closed

Comments

@CounterPillow
Copy link
Contributor

Important Information

Provide following Information:

  • mpv version
$ mpv --version
mpv 0.32.0-786-gc07089a250 Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects
 built on Mon Oct 26 02:26:28 CET 2020
FFmpeg library versions:
   libavutil       56.60.100
   libavcodec      58.112.100
   libavformat     58.63.100
   libswscale      5.8.100
   libavfilter     7.88.100
   libswresample   3.8.100
FFmpeg version: N-99733-g7b0d179195
  • Linux Distribution and Version: Arch Linux, kernel 5.9.2
  • Source of the mpv binary: mpv-build
  • GPU driver and version: mesa 20.2.1, radeonsi
  • Possible screenshot or video of visual glitches

shot-20201003_142220-0001

Reproduction steps

mpv --no-config --profile=gpu-hq --deband=no --hwdec=vaapi sample.mp4

Compare to

mpv --no-config --profile=gpu-hq --hwdec=vaapi sample.mp4

Expected behavior

Let me disable memes

Actual behavior

Chroma plane all messed up

Log file

https://0x0.st/idAF.log

Sample files

https://0x0.st/idmr.mp4

@CounterPillow
Copy link
Contributor Author

CounterPillow commented Nov 1, 2020

Looks to be related to cscale=spline36.

@philipl
Copy link
Member

philipl commented Nov 1, 2020

And specifically for nv12 format. You can repro with --vf=format=nv12 and software decoding.

@philipl philipl changed the title --deband=no breaks a metadata-rotated video if VA-API hwdec is used --deband=no --cscale=spline36 breaks if video is in nv12 format Nov 1, 2020
@philipl
Copy link
Member

philipl commented Nov 1, 2020

mpv --no-config --cscale=spline36 --deband=no --vf=format=nv12 sample.mp4

@CounterPillow
Copy link
Contributor Author

You should've probably kept in the title that the rotation metadata is relevant, I can't reproduce it with videos that aren't rotated.

@philipl philipl changed the title --deband=no --cscale=spline36 breaks if video is in nv12 format --deband=no --cscale=spline36 breaks if video is metadata rotated and in nv12 format Nov 1, 2020
@CounterPillow
Copy link
Contributor Author

--cscale=haasnsoft or ewa also does not fare much better, but has different artefacting:
mpv-shot0001

@hooke007
Copy link
Contributor

So far, there is no better way than to change the following three parameters.
--hwdec=no
--cscale=bilinear/bicubic_fast/oversample
--deband=yes

@hooke007
Copy link
Contributor

I can confirm it still exist in the win10 and auto-copy. The tags are not accurate.

@haasn
Copy link
Member

haasn commented Feb 19, 2022

Worth pointing out that this is fixed in gpu-next

@madjxatw
Copy link

madjxatw commented Apr 2, 2022

Worth pointing out that this is fixed in gpu-next

But cscale yet cannot be set individually with gpu-next, it simply takes the setting for scale.

@mdmjmsa
Copy link

mdmjmsa commented Nov 22, 2022

any update on this issue?

@okias
Copy link

okias commented Dec 20, 2023

I can confirm (Linux 6.5.0-5-amd64). Debian 13 (trixie).

mpv 0.37.0 Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects
libplacebo version: v6.338.1
FFmpeg version: 6.1-5
FFmpeg library versions:
   libavutil       58.29.100
   libavcodec      60.31.102
   libavformat     60.16.100
   libswscale      7.5.100
   libavfilter     9.12.100
   libswresample   4.12.100

Looking at output with -vo vaapi I assume the GPU processing missing some checks:

$ mpv -vo vaapi VID_20231220_133642.mp4
 (+) Video --vid=1 (*) (h264 3840x2160 29.916fps)
[vo/vaapi] OSD format not supported. Disabling OSD.
[vo/vaapi] Warning: this compatibility VO is low quality and may have issues with OSD, scaling, screenshots and more.
[vo/vaapi] vo=gpu is the preferred choice in any case and includes VA-API support via hwdec=vaapi or vaapi-copy.
Using hardware decoding (vaapi).
[autorotate] Video rotation with this format not supported
VO: [vaapi] 3840x2160 vaapi[nv12]
[vo/vaapi] Video is flagged as rotated by 90 degrees, but the video output does not support this.
[vo/vaapi] vaPutSurface() failed (invalid parameter)
[vo/vaapi] vaPutSurface() failed (invalid parameter)

mpv -vo gpu VID_20231220_133642.mp4 --deband=no --cscale=spline36 = greyscale video with color crossing lines
mpv -vo gpu VID_20231220_133642.mp4 --deband=no --cscale=bilinear = fine

ffmpeg -display_rotation 0 or 180 also resolve the problem.

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

Successfully merging a pull request may close this issue.

9 participants