obsproject / obs-amd-encoder

AMD Advanced Media Framework Encoder Plugin for Open Broadcaster Studio
https://obsproject.com/forum/threads/amd-advanced-media-framework-encoder-plugin-for-obs-studio.52305/
GNU General Public License v2.0
454 stars 87 forks source link

General question about encoder performance #173

Closed zehDoughnut closed 7 years ago

zehDoughnut commented 7 years ago

Hello, I have a question about the performance of the encoder, and if my results are 'normal' or 'too low'.

System:

i7 2700K (overclocked to 4.7, fully stable) 8GB DDR3-1600 Ram (2x4) Gigabyte Z68X-UD3H (latest BIOS) Sapphire R9 Fury X The footage was recorded to a seperate SATA SSD (850 Evo) None of the hardware was/is affected by thermal throttling.

Plugin version: 1.4.3.2 OBS version: 0.16.6 (64bit, Capture method: Game capture) Log: https://gist.github.com/anonymous/2802f36e01ddf96bbbd04acb04cec777

I'm shoooting for 1080p 60fps. However, none of the presets manage to give me more than 50fps on average (best case scenario) on any game. I did the same on my workstation a couple of day ago, with a more poweful 6850K, to eliminate an eventual CPU bottleneck. Didn't hit 60fps either.

Xaymar commented 7 years ago

So first off, please don't lie: You do not have Plugin Version 1.4.3.2 installed, you have 1.4.2.3 installed.

17:35:47.268: [AMF Encoder] Version 1.4.2.3

Lying to me will only end up in you getting to support. And having said that, you should follow the Troubleshooting Guide properly and actually upgrade to 1.4.3.2. Now on to your settings:

And finally, OBS does not have enough GPU time to render solid 60 fps. The encoder can only encode what it actually receives, if OBS doesn't submit exactly 60 frames per second then the encoder also can't encode 60 frames per second.

17:52:45.111: Output 'adv_file_output': Total encoded frames: 3994
17:52:45.111: Output 'adv_file_output': Total drawn frames: 3996
17:52:45.111: Output 'adv_file_output': Number of lagged frames due to rendering lag/stalls: 35 (0.9%)
17:58:06.695: Output 'adv_file_output': Total encoded frames: 5795
17:58:06.695: Output 'adv_file_output': Total drawn frames: 5799
17:58:06.695: Output 'adv_file_output': Number of lagged frames due to rendering lag/stalls: 344 (5.9%)
zehDoughnut commented 7 years ago

Excuse me. My intention wasn't lying, I simply misread the number. I was using constrained baseline and VBR_LAT because those seem to give me the best results. My intended use is recording, not streaming just to clear that up.

And finally, OBS does not have enough GPU time to render solid 60 fps. The encoder can only encode what it actually receives, if OBS doesn't submit exactly 60 frames per second then the encoder also can't encode 60 frames per second.

So does that mean that there's simply too much load on the Graphics Card overall?

Xaymar commented 7 years ago

I was using constrained baseline and VBR_LAT because those seem to give me the best results.

'Constrained Baseline' is the worst profile you could pick for quality. It only allows for the minimum subset of H264 features to be used. Use Main or High, or Constrained High if you do not want B-Frames to be supported at all.

Additionally, VBR_LAT looks good because it constantly overshoots the Target and Peak Bitrate if it wants to. It's like Constrained QP mode on x264, except not really - it will try to get close to the Target Bitrate, will try to peak at most to the Peak bitrate and if everything fails just uses the Min/Max QP limits.

Also, if your goal is recording, why don't you just use the presets? Recording, High Quality, Indistinguishable and Lossless are all presets for recording, just select and go.

zehDoughnut commented 7 years ago

Got you, set it to high now. I was using these settings because the recording presets gave me either terrible fps on my output file, or a massive drop of the ingame framerate (around 50-60% in most games)

Benman2785 commented 7 years ago

please provide your settings - a fury can handle alot without FPS drops

and you still doesnt tell is if you want to RECORD or STREAM -> because both need different settings...

Xaymar commented 7 years ago

@zehDoughnut Do you still get the same frame drop? If so, make sure that your disk isn't in some way bottlenecking you. Always record to a secondary disk or SSD if possible, or use a fast access time RAID.

@Benman2785 He provided everything needed, in log and in writing.

zehDoughnut commented 7 years ago

@Xaymar I'm using a 850 Evo, that neither my OS nor my games are installed on. It's still dropping to around 50-55fps sometimes, and overall looks choppy. I can provide videos if that helps.

Xaymar commented 7 years ago

Would be nice to have, make sure to also include a log file with the debug option ticked and obs started with --verbose --log_unfiltered as the command line arguments.

zehDoughnut commented 7 years ago

Sorry for the delayed response, I've been busy lately. Before I updated to the new 1.4.3.3 version of the plugin, I completely reinstalled OBS and everything related to it. Recording itself seems to work now, I think it's just being limited by my 2700K now.

Here's a log file anyway. https://gist.github.com/09209e09827ee286d042ae3a546eb6ad

Benman2785 commented 7 years ago

your 2700k shouldnt limit it -> i have FX-8150 @4.2GHz and have no limits // i only notice 15% less FPS when OBS is active (due to VCE taking some load)

but 60FPS should be pretty stable with fitting game-graphic-settings // i will check your log this night (because im lazy) - but can you provide your settings you used in your game?

zehDoughnut commented 7 years ago

I play on High settings, only Texture filtering is on Ultra, AA disabled and 110% resolution scale.

On Argonne forest (which is one of the less CPU intensive maps) I get around 30-50fps on average, sometimes 60 - 70 when there's nothing going on.

Benman2785 commented 7 years ago

that is a lot you gpu has to handle // better reduce to 1080p30 OR reduce your game-settings until you reach 70-80FPS without OBS -> so you will be around 60FPS and benefit form 60fps capture

resolution scale of 110% make it looks nicer but is ~7% more load on GPU start with lowest settings and slightly improve quality until you hit stable 70FPS and then use OBS to record

it makes no sense to record 1080p60 when you only achieve 30-50fps

ps as said use CBR for streaming (because VBR_LAT wont work on any stream-platform due to high peaks)

zehDoughnut commented 7 years ago

I can easily hit 100fps in BF1 with these settings, it only drops that low when actually recording.

Benman2785 commented 7 years ago

yeah - u have a Fury X - mh, did you tried a different game? usually the impact shouldnt be that hard

zehDoughnut commented 7 years ago

Well lightweight games like Overwatch, Counter Strike and Insurgency do just fine, where as games like the previously mentioned Battlefield 1, or GTA 5, Squad, Just Cause 3 do have some struggles maintaining a playable framerate.

Xaymar commented 7 years ago

A few things you can try is:

That is about all that should have an effect on fps, aside from QP values themselves due to bandwidth requirements.

Edit: Oh and you could attempt to use DX11+OpenCL or Host mode. Both can do 4K 60fps on my system, not sure if one will run better for you.

zehDoughnut commented 7 years ago

I set my Keyframe interval to 5 and enabled OpenCL, works much better now!

Recording is stable 60fps. and ingame fps only rarely drop below 60 :)

Xaymar commented 7 years ago

So it's due to Bandwidth constraints. You might want to get a better CPU+Mainboard then, PCI-E bandwidth is really important for solid recordings.

zehDoughnut commented 7 years ago

Noted. I'll see what Zen and Kaby Lake will bring.

Xaymar commented 7 years ago

Since there is nothing left in this issue that should keep it open (and it's been 9 days since the last comment), I'll close this one.