Run OBS as administrator, and turn off Psychovisual Tuning in your output encoder settings.
Also, do not record directly to .mp4. That container format requires metadata to be written at the very end of recording, so if anything happens where the file creation is cut short (such as any sort of crash), the resulting file will be completely corrupted. Instead, record to .mkv, and if you need .mp4 for editing, then remux it to .mp4 afterward. This can be done automatically in the advanced settings, or manually in the file menu.