Hello,
Did you use the sample repo https://github.com/xamarin/monodroid-samples/tree/main/android5.0/Camera2VideoSample?
If so, I've tested the sample and make it usable.
You could modify your mediarecoder part as the following code:
mediaRecorder.SetAudioSource (AudioSource.Mic);
mediaRecorder.SetVideoSource (VideoSource.Surface);
mediaRecorder.SetProfile(CamcorderProfile.Get(CamcorderQuality.Q720p));
mediaRecorder.SetOutputFile(GetVideoFile(Activity).AbsolutePath);
int rotation = (int)Activity.WindowManager.DefaultDisplay.Rotation;
int orientation = ORIENTATIONS.Get (rotation);
mediaRecorder.SetOrientationHint (orientation);
mediaRecorder.Prepare ();
Best Regards,
Alec Liu.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.