mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
27.77k stars 2.86k forks source link

Severe corruption/artifacting with opengl + gpu-next #11499

Open awused opened 1 year ago

awused commented 1 year ago

Important Information

mpv --version: mpv 0.35.1 Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects built on UNKNOWN FFmpeg library versions: libavutil 57.28.100 libavcodec 59.37.100 libavformat 59.27.100 libswscale 6.7.100 libavfilter 8.44.100 libswresample 4.7.100 FFmpeg version: 5.1.2

Reproduction steps

mpv --no-config --vo=gpu-next --gpu-api=opengl

opengl works fine without gpu-next, and gpu-next works fine with vulkan.

Expected behavior

Normal playback.

Actual behavior

Severe artifacting and corruption, even for the gui overlay. Does not persist when the videos are paused. https://i.imgur.com/iUeEieh.png https://i.imgur.com/MFPkgSl.png

Log file

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

Sample files

Seems to reproduce on every video file I've tried regardless of codecs.

haasn commented 1 year ago

Can't reproduce this locally. @philipl ?

philipl commented 1 year ago

Yep, reproduces as stated. I'm sure it's nvidia specific.

philipl commented 1 year ago

image

philipl commented 1 year ago

Compare with: image

awused commented 1 year ago

It might be related, but I tried gpu-next with vulkan (and gpu-context x11vk) for a bit and ran into frequent hangs. Playback seems fine as long as I don't touch my mouse, but interacting with other windows or resizing mpv seems to result in hangs where even mpv -v -v gives me nothing and I have to kill it. Video playback never recovers but audio playback does. No compositor for these tests.

mpv --no-config --vo=gpu-next --gpu-api=vulkan --gpu-context=x11vk --vulkan-queue-count=8 seems to reproduce it more often. I had vulkan-queue-count=4 in my config and after experimentation, higher queue counts seem to lead to more frequent hangs. Just rapidly maximizing and minimizing the window should trigger it.

haasn commented 1 year ago

Is it possible for you to somehow compile/test the libplacebo demo programs to see if they also exhibit similar issues? (In particular, plplay and colors)

philipl commented 1 year ago

Yup, reproduces there too. Here is colors. image

haasn commented 1 year ago

If even colors reproduces this issue them I'm slightly at a loss for words - that program does literally nothing other than clearing the framebuffer...

awused commented 1 year ago

For what it's worth, --no-config --vo=gpu-next --gpu-api=opengl seems to be the worst-case scenario. If I run my full opengl config with --vo=gpu-next I still get glitchy playback, but the artifacts aren't nearly as omnipresent. At first I believed it was just a corrupted or poorly encoded file.

monarc99 commented 1 year ago

@awused can you try different cscale values?

input.conf:

ctrl+d cycle-values cscale bilinear spline36 lanczos ewa_lanczos ewa_lanczossharp mitchell oversample

i have similar artefacts only with bilinear and oversample as cscale value. But that could be a different bug.

awused commented 1 year ago

I get the same artifacts with every one of those options except for ewa_lanczos and ewa_lanczossharp where they are significantly reduced but still present. Maybe if there are two different sources of artifacts those two options remove one of them. With --no-config --vo=gpu-next --gpu-api=opengl --cscale=ewa_lanczos:

04-01_11-59-06

Jertzukka commented 1 year ago

I believe I just got this same issue. For me it seems like that large resolution files, created from the same source file by scaling with ffmpeg do not artifact. The smaller resolution of the file, the more it artifacts. Also, if you increase the display resolution of an artifacting video, the image improves but there's always artifacting at the very bottom. Pausing the video clears any artifacting immediately. vo=gpu has no such issues and everything works fine.

As previously mentioned gpu-api=vulkan doesn't seem to artifact.

According to my pacman.log, I upgraded mpv from 35.1-4 to 35.1-6 around a month ago, but I only now noticed the issue so I suspect it is quite recent. I upgraded the following nvidia drivers just few days ago, so that would be more likely the culprit. [ALPM] upgraded linux61-nvidia (530.41.03-10 -> 530.41.03-13)

System details Package versions: - mpv 0.35.1-dirty Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects built on Fri Apr 21 07:11:25 2023 FFmpeg library versions: libavutil 58.2.100 libavcodec 60.3.100 libavformat 60.3.100 libswscale 7.1.100 libavfilter 9.3.100 libswresample 4.10.100 FFmpeg version: n6.0 - Operating System: Manjaro Linux KDE Plasma Version: 5.27.5 KDE Frameworks Version: 5.106.0 Qt Version: 5.15.9 Kernel Version: 5.15.114-2-MANJARO (64-bit) Graphics Platform: X11 Graphics Processor: NVIDIA GeForce GTX 1060 6GB/PCIe/SSE2 - Manjaro stable repo - Nvidia Driver 530.41.03

Screen recording of the artifacting. 400x400 video artifacting: https://0x0.st/HcLl.mp4 180x180 video, increasing the display size makes it better, making it smaller makes artifacting worse: https://0x0.st/HcLU.mp4 640x640 video, no artifacting. (Ignore different colormatrix value, happens even with bt709.) https://0x0.st/HcL0.mp4

Log file

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

Sample files

400x400 video which does artifact with vo=gpu-next. https://0x0.st/HcLE.mp4

haasn commented 1 year ago

Now testing on an RTX 3050, still can't reproduce this.

Traneptora commented 6 months ago

I can reproduce this on my RTX 3050.

mpv --no-config av://lavfi:testsrc --vo=gpu-next --gpu-api=opengl

image mpv-sucks.log

guidocella commented 6 months ago

I no longer get artifacts on the 550 driver, can anyone else still reproduce them?

Traneptora commented 6 months ago

I can reproduce this on 550. mpv --no-config av://lavfi:testsrc --vo=gpu-next --gpu-api=opengl --log-file=mpv-sucks.log image https://0x0.st/HRJl.log

philipl commented 6 months ago

It's not as bad. But I can still see it too. Screenshot from 2024-03-01 09-19-14