Ensure that your settings are compatible with each other. For example you cannot use MP4 as the recording file type if the Recording Video Codec is set to libvpx. libvpx is only for WebM.
If you are not recording audio is best to set it to No Audio. If you are recording it may perform best with AAC as the Audio Encoder.
Some camera streams do not allow being cut in the middle of a recording. Which leads your last MP4 recording to be unplayable. It is technically still all there it just has not been "closed". You can record WebM files to minimize this issue if you regularly switch modes.