GPUOpen-LibrariesAndSDKs / AMF

The Advanced Media Framework (AMF) SDK provides developers with optimal access to AMD devices for multimedia processing
Other
617 stars 151 forks source link

[Question]: Every 4 seconds of recording gets blury #467

Open Satont opened 8 months ago

Satont commented 8 months ago

When i upgraded drivers to 24.X, recording of screen gets blury/pixelated every 4 seconds.

Software doesnt metter, i tried to use AMD software for recording video with AV1, same behavior.

You can see that behavior on 00:04, 00:08.

https://github.com/GPUOpen-LibrariesAndSDKs/AMF/assets/42675886/ee3ea034-68c2-48d7-87d8-2af4fe735466

Downgrading drivers to 23.X helps.

My videocard is rx 7800xt, cpu is ryzen 5600. Recording in 1080@60fps, i have 3 monitors, main one 2560x1440@165hz, others two 1920x1080@60. Bitrate 6000kbps. Tried set my monitor to 120hz, tried completely disable 165hz monitor and record on 60hz monitor - same behavior. 30 fps stream - same behavior.

I'm sorry if it's wrong place to ask, where i should post this issue then?

MikhailAMD commented 8 months ago

Which app did you use?

Satont commented 8 months ago

Which app did you use?

Tried OBS, tried AMD Adrenaline "Record and Stream"

le-xot commented 8 months ago

https://drive.google.com/file/d/1ZlhJ4SPzHhR2z9TSMFDI7iRNjAdY-nKl/view

image_2024-03-27_19-18-10 photo_2024-03-27_19-22-15

I have a similar problem on my rx 7700xt. The blinking occurs when i-frames appear. I used the QCTools program to analyze my recording. You need to look at the 4th graph. In the first part of the video, when I shake the camera, there is a big difference in frames, which makes the graph uneven and you can't see the blurring. Next, when I stop the camera and only the grass is moving you can see the peaks - these are i-frames. They occur every 2*60 frames, exactly as I have the keyframe interval set. It is when i-frame appears that the picture becomes very blurred. In the last part of the video, when the picture becomes static, you can observe the same peaks that blur the picture every 2 seconds.

When I did the test I physically disconnected my 165hz monitor and left only 1080p@60hz.

Using driver version 23.x helps to solve the problem, but new games start to lag because of the old driver.

MikhailAMD commented 8 months ago

In OBS as a temporary measure you can try VBR rate control mode. And/or increase VBV: add "VBVBufferSize=6000000" to AMF/FFmpeg Options string. Also try to increase peak bitrate: "PeakBitrate=8000000" - somewhat larger than bitrate. - All values in bits per second

le-xot commented 8 months ago

image https://clips.twitch.tv/HealthyIronicTortoiseDoggo-heUytR-hw1DU-BaK

I doubled the buffer size and tripled the bitrate per peak. It became much better, but if you look closely at the mountain - you can see how the picture is recomputed exactly every second = keyframe interval. Is there anything else I can do to even out these "spikes" of bitrate?

le-xot commented 8 months ago

I don't understand what this has to do with RDNA2 if the 7000 series graphics cards are built on the new RDNA3 architecture

MikhailAMD commented 8 months ago

Update: the problem was identified and fixed. I will update you when the fix appear in the driver release. Thanks for your help.

GamingJamz commented 6 months ago

Is there a solution yet ?

MikhailAMD commented 6 months ago

Sorry for the delay, Windows driver with the fix is public from v 24.4.1.

GamingJamz commented 6 months ago

Unfortunately its not fixed for my system [https://www.youtube.com/watch?v=bMS-D-W5JP4&t=8s :(](https://www.youtube.com/live/bMS-D-W5JP4?si=k-zNsqbo1Pt1OJOA :(

MikhailAMD commented 6 months ago

Can you please share GPU version, driver version, and the file produced by OBS?

GamingJamz commented 6 months ago

https://github.com/GPUOpen-LibrariesAndSDKs/AMF/assets/170002515/c251b652-3192-4e61-a850-747ff737183d

I have the Sapphire RX 7700 XT Pulse

24.5.1 is the adrenalin edition.

its worse when streaming: https://www.youtube.com/watch?v=bMS-D-W5JP4 :(

Thanks for the quick response.

Laraasofiee commented 6 months ago

Hello, I have been experiencing this issue for some time and have been trying to draw attention to it. The issue has persisted across at least three driver versions and is consistently reproducible with all GPU encoders (AVC, HEVC, AV1) in OBS Studio (tested with version 24.5.1) and presumably also in ReLive.

It seems that the keyframe interval also has an influence on the problem. When set to 2, an abnormal pixelated image appears every 2 seconds in the recording. When set to 0 (automatic), it occurs more sporadically.

To visually illustrate the problem, I have uploaded the files to my Google Drive. I have deliberately selected a low bitrate for a high resolution, but the issue also occurs at higher bitrates with lower resolutions, though it is less visible (6,000 bitrate for 936p/1080p at 60 fps).

I first noticed this issue while watching a friend stream on Twitch. He was using the AVC encoder with a bit rate of 6,000 and a resolution of 936p/1080p at 60 fps on his 7900 XTX while playing Elden Ring. The problem becomes especially noticeable in scenes with a lot of vegetation or complex details.

[2160p 3,5 Mbit/s 2 Keyframes] https://shorturl.at/coGO5 [2160p 3,5 Mbit/s 1 Keyframe] https://shorturl.at/jLNPX [2160p 3,5 Mbit/s 0 Keyframes] https://shorturl.at/guxz0

le-xot commented 6 months ago

@Laraasofiee @GamingJamz

Personally for me with my rx7700xt, the following settings helped: image image VBVBufferSize=16000000 PeakBitrate=24000000 I doubled VBVBufferSize and the PeakBitrate compared to the my bitrate settings. You can watch my VOD to compare the settings. Personally, I am completely satisfied with these settings.

Johl7 commented 6 months ago

Just to add an observation regarding AMF on RDNA2, the PeakBitrate param seems to be not behaving as intended, when enabling it and setting to a certain value it will behave as the target bitrate value instead.

GamingJamz commented 6 months ago

Is there a custom code to add for this in OBS ?

Just to add an observation regarding AMF on RDNA2, the PeakBitrate param seems to be not behaving as intended, when enabling it and setting to a certain value it will behave as the target bitrate value instead.

rhutsAMD commented 5 months ago

Hi @GamingJamz , could you please try disabling VBAQ? Disabling VBAQ should help alleviate the pulsing artifact in the grass area.

Inside “AMF/FFmpeg Options”, please add EnableVBAQ=false