I am following the tutorial on https://developer.android.com/guide/topics/media/camera.html#capture-video
As such I follow the below order when trying to start the camer
Comparing agains my code, it seems you're missing two calls:
mediaRecorder.setVideoSize(int width, int height)
mediaRecorder.setPreviewDisplay(SurfaceHolder surfaceHolder)
The latter is most likely to be causing the crash as Android requires a valid preview surface to start recording. This is done so to prevent hidden cameras apps.
There are dozens of questions related to recording without a preview surface, but this one seems to sum up what you need to do to bypass this restriction.
The basic idea is to resize your surface to be 1x1 and pass it to your mediaRecorder
instance. Keep in mind that this may not work in all devices though.
If you are accessing mic hardware multiple times, like, using MediaRecorder and AudioRecord classes at a time will also make this exception.