If you were to try settings, x264
If by default you are having issues then(default is VeryFast)
- add a check mark on 'enable advanced enconder settings'
and change Encoder Preset to: superfast (test it, if still laggy issues then try ultrafast)
Just in case the "faster" it is the lower quality it will be, so you will need to increase the Video Bitrate - so if 2500 is not enough, try 3000, 3500 or up to 5000. If 5000 has zero issues then you can go higher as well.
Also in Recording Quality, use "Same as stream"... then only make the changes in the streaming area.
Forgot to say, in the Streaming part you can try as Encoder the Intel QSV and change up there the video bitrate / quality - remember Recording when used 'same as stream' it will use those "streaming" settings for the recording.