https://obsproject.com/forum/threads/best-settings.140188/#post-514693 @FerretBomb comment #2
1) NEVER RECORD TO MP4 DIRECTLY, FOR ANY REASON. It is not a recording-safe format; if anything goes wrong during the recording, even for a split second, the ENTIRE recording will be corrupted and absolutely not recoverable by any means. Record to MKV, and remux to MP4 after the recording is complete from OBS' File menu, Remux Recordings.
2) Record using CQP or CRF, not CBR. CBR is only used for streaming, where the back-end infrastructure requires it. CQP/CRF are quality-target based encodes, and will use as much or as little bitrate as is needed to maintain a constant image quality. No wasting bitrate on simple/slow scenes, no choking on fast-moving or complex scenes. 22 is a good starting point. 16 will result in much larger files, but near-perfect video. 12 should only be used if you plan to edit and re-encode later, and will be VERY large. Anything lower than 12 shouldn't be used unless you know exactly why you need it, and what problems it can cause.