Question / Help Issue with x264 encoding (i7 8700k)

astaroth223

New Member
Hello,
I'm having a strange issue with encoding and i hope you could help me with this.
I was trying to make a high quality record of the game. When i'm using GPU (NVENC encoder) the result video is very clear and running smooth. The only issue is that it takes like ~20% of its computing power. Normally it isn't a problem, but some games are using 100% of my GPU, so i wanted to use my CPU to encode, since its usually only at 35% at max during gaming...
And for some reason using this encoder makes the video insanely laggy (80% lost frames). The strange thing is that in both cases the preview and the game runs very smooth. Only the output video is damaged. And - very important - gaming and encoding with x264 used my CPU at 60%...
I'm attaching the log file. I know that my settings are very high. I'm wondering why the rendered video lost 80% of its frames when my CPU was loaded only at 60%... I would be very grateful for every help.
 

Attachments

koala

Active Member
Nvenc doesn't put any additional load on the GPU, because it is a dedicated circuit on the GPU. Use it.
You lose most frames with x264, because your CPU doesn't seem to be able to encode a resolution this high with 60 fps.

You will get even better results, if you limit the fps of your game by enabling vsync or limit the frame rate to 60.
 

astaroth223

New Member
Are you sure about that? Nvenc seems to be working good, only if my gpu is not loaded at 100%... Just did a test with a game, and the video became laggy (cpu at 35% load).
 

Zidakuh

Member
When using OBS to record or stream, you only want to have your GPU use up 95%, or it will interfere with your recording.
OBS composes the video feed on the GPU after all, so it needs a little bit of headroom for that.
 

koala

Active Member
The cause for these kind of lags isn't nvenc, the cause is your game fully loading the GPU. OBS needs a bit of GPU resources to composite the scene. This is independent of the encoder. And before you ask if you can OBS make compositing on a second GPU: this isn't giving a performance increase, because the raw image data has to be transferred from one GPU to the other, and this is problematic due to the reduced pci-express bandwidth.
 

koala

Active Member
If you don't want to restrict your game so it doesn't fully load the GPU, capture card to 2nd pc is probably the most stable/robust configuration, as long as the 2nd pc has the power to encode the footage flawlessly. You can use nvenc on the 2nd pc for this, if you get a nvidia graphics card in the 2nd pc. With x264 you need a really powerful cpu.
 

astaroth223

New Member
By restricting the game do you mean lower the settings? Or maybe there is a way to give obs a higher priority than a game?
 

koala

Active Member
By restricting the game i mean lower the settings (fps, visual complexity) until the GPU isn't loaded fully. Unfortunately, it isn't possible to give OBS higher priority on the GPU than the game. There is no scheduler on the GPU that would handle this. This is a design thing in GPU hardware or driver. It seems, GPU manufacturers assume there will only be one application at a time that will use GPU resources, so no resource balancing between different applications required.
 

astaroth223

New Member
ok, thank you.
The last think that i'm concern about is the fact that x264 encoder lost 80% of the frames, when my cpu was loaded only at 60% (while playing the game that didn't use 100% of gpu). Is there something that can be done about this?
 

koala

Active Member
I took a second look into your logfile, and it seems you have Windows DVR background recording on. Essentially, if this is on, you are running 2 encodings+recordings at the same time: Windows and OBS. A killer with your huge screen resolution. Disable Windows background recording and see how it improves OBS' behavior.
 
Top