As I already suggested, enable Windows Game mode
OBS (Open Broadcaster Software) is free and open source software for video recording and live streaming. Stream to Twitch, YouTube and many other providers or record your own videos with high quality H264 / AAC encoding.
obsproject.com
Also, you can run OBS as admin.
Watch the video on VLC player as windows playes isn't good enough.
For recording use CQP instead of CBR.
The best way is running the Auto-configuration Wizard (tools menu) en apply the settings it gives. Do NOT change anything.
Restart OBS
Test as is.
If all goes well, change the quality preset for a better one. Test.
Keep it in simple output mode.
Done.