Actually you do mMediaRecorder.setOutputFormat()
twice: One time explicitly and afterwards mMediaRecorder.setProfile()
tries to do it again as you can see in your stacktrace.
The Android Media Recorder has a very low robustness for things like that.
So remove the line that says
mMediaRecorder.setOutputFormat();
and the error should go away. And btw. remove
mMediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
mMediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.MPEG_4_SP);
which is what mMediaRecorder.setProfile()
has already done as well.