Wieku / danser-go

Dancing visualizer of osu! standard maps and custom osu! client written in Go. Also a generator for osu! videos.
Other
743 stars 102 forks source link

Garbled output on latest AMD driver #337

Closed vipotaenko02 closed 11 months ago

vipotaenko02 commented 1 year ago

When recording a video through x264 on AMD Software 23.7.1, a garbled video is produced. The beginning of the video contains a green screen, and every now and then there are frame skips or returns, sometimes with cut images. x265 seems to work fine. Affected GPUs: RX 5XX and newer, others weren't tested Example of a produced video: https://drive.google.com/file/d/1TO_j6v6Ht0aNmBiyb7eQk8aALzSc2gnA/view?usp=sharing

Wieku commented 1 year ago

What are your settings?

Also, it's AMD. That's very often an answer in itself.

vipotaenko02 commented 1 year ago

Default settings for both encoders. Changing them gives no result. Tried changing color scheme (or how its called) and Constant Quality Rate. As for AMD, tried Danser on Linux with the same settings and got no issues. Also, I tried to install the latest ffmpeg on Windows and got the same problems. Other programs that rely on ffmpeg work fine, so I think it's something to do with ffmpeg arguments when making a video.

Wieku commented 1 year ago

Still would love to see the settings file and logs for the run with garbled video, with ffmpeg logs on (Recording -> Show ffmpeg logs option, ffmpeg logs will only be visible in the terminal though).

danser was build with bundled ffmpeg in mind, I'm not responsible if video breaks with other ffmpeg versions.

Tenkotataii commented 1 year ago

https://pastebin.com/Bb46rEmA https://pastebin.com/bjgKmxz9 https://youtu.be/YRj18juf8YM there is an example for having shit performance with rendering the video two measurable things:

  1. green screen when the map begins
  2. massive freezes throughout the video

also there is a logs copy (i have a console open while rendering) and settings file (forgot to add it lol)

Tenkotataii commented 1 year ago

same issues go with 4k, QHD or FHD and also the x264 and x265 codecs. i have seen no solutions to fix this.

Wieku commented 1 year ago

@Tenkotataii does the same green tint issue happen when you select I444 as pixel format? Be aware it won't be playable by Windows' video player.

Wieku commented 1 year ago

Also, if this fails, can you both try downgrading the drivers to pre 23.7.1? I think the latest one to this one is 23.5.2

vipotaenko02 commented 1 year ago

Downgrading helps, although sometimes ffmpeg session crashes when rendering a 4K video, and Danser suddenly stops recording. Issue is present only on the latest version of AMD Software (and AMD doesn't do any hotfixes, so I don't think that change was unintentional). I also tried NV12 color format, results are the same. So waiting for @Tenkotataii, as I've already downgraded the drivers.

Tenkotataii commented 1 year ago

image somehow it doesn't work with any of the profiles (baseline, main and high are all not working) Used I444 as a pixel format MARK IT AS A NEW ISSUE

Tenkotataii commented 1 year ago

downgrading on 23.5.2 fixed the issue

Wieku commented 1 year ago

@Tenkotataii @vipotaenko02 AMD released 23.7.2 drivers, can you check if it still has issues?

vixeie commented 1 year ago

@Tenkotataii @vipotaenko02 AMD released 23.7.2 drivers, can you check if it still has issues?

Hey, vixeie here, i also had a similar issue, and as an AMD user (Radeon RX 6500 XT), i recommend as you downgrade to 22.5.1 as it is the most stable version at the moment. (On the later versions, (23+), there is the OpenGL update that AMD released, therefore it made alot of apps that use OpenGL unusable).

vixeie commented 1 year ago

@Tenkotataii @vipotaenko02 AMD released 23.7.2 drivers, can you check if it still has issues?

Hey, vixeie here, i also had a similar issue, and as an AMD user (Radeon RX 6500 XT), i recommend as you downgrade to 22.5.1 as it is the most stable version at the moment. (On the later versions, (23+), there is the OpenGL update that AMD released, therefore it made alot of apps that use OpenGL unusable).

TLDR: i tried the latest one and it did cause the issue that the person described

Tenkotataii commented 1 year ago

is it even possible to fix?

vipotaenko02 commented 1 year ago

@Tenkotataii @vipotaenko02 AMD released 23.7.2 drivers, can you check if it still has issues?

Hey, vixeie here, i also had a similar issue, and as an AMD user (Radeon RX 6500 XT), i recommend as you downgrade to 22.5.1 as it is the most stable version at the moment. (On the later versions, (23+), there is the OpenGL update that AMD released, therefore it made alot of apps that use OpenGL unusable).

This has nothing to do with that update. For this we just simply revert aitoglxx.dll inside the driver so we get the latest drivers with old OpenGL implementation. This doesn’t help with danser though. So the issue here is not in OpenGL, but probably in ffmpeg.

Wieku commented 1 year ago

@vipotaenko02 That definitely is not an ffmpeg issue. If that was the case, other platforms would see it. libx264/libx265 don't use GPU at all. Probably issue is not visible with libx265 because encoding is slower so it may mask the gpu synchronization problems.

vipotaenko02 commented 1 year ago

@vipotaenko02 That definitely is not an ffmpeg issue. If that was the case, other platforms would see it. libx264/libx265 don't use GPU at all. Probably issue is not visible with libx265 because encoding is slower so it may mask the gpu synchronization problems.

Valid point. Then something in how danser and ffmpeg work goes wrong. Because danser works fine when I’m just watching the replay (not recording it) and ffmpeg works fine because it’s unrelated to GPU in the first place.

So, there’s another question. How can we re-add support for AMD encoder? Because it’s just an ffmpeg settings and right library, I think we can edit danser settings file to point to a custom library with right commands, and this can potentially fix the issue. I saw your point that it’s kinda bad (although I don’t understand, because every editing program supports it without any issues), but now it can help us.

Wieku commented 1 year ago

I don't think amf would change that. Synchronization works fine on Intel or NVIDIA. Something is breaking when danser tries to read frames back from GPU. I have to pinpoint why it breaks on AMD.

By looking again at your video it looks like AMD doesn't signal properly that frame has finished downloading.

Wieku commented 1 year ago

@vipotaenko02 can you join danser's discord? It would be better to communicate than bouncing back-and-forth on github

vipotaenko02 commented 1 year ago

@vipotaenko02 can you join danser's discord? It would be better to communicate than bouncing back-and-forth on github

Yep, just joined with same nickname as here.