I am trying to use MediaRecorder to record 240fps slow motion video on a Galaxy S9. The built-in camera app does this no problem with the “Slow Motion” selection. This, set for 30fps, works:
recorder = new MediaRecorder();
recorder.SetVideoSource(VideoSource.Camera);
recorder.SetOutputFormat(OutputFormat.Mpeg4);
recorder.SetVideoFrameRate(30);
recorder.SetVideoSize(1920, 1080);
recorder.SetVideoEncodingBitRate(17000000);
recorder.SetVideoEncoder(VideoEncoder.H264);
recorder.SetOutputFile(path);
recorder.SetPreviewDisplay(viewer.Holder.Surface);
But increasing the VideoFrameRate > 30, still records 30fps… I’ve tried a variety of values for the above, removed some settings, etc with no luck.
I have also tried the CamcorderProfile approach, but this doesn’t work either. In particular these:
CamcorderProfile.HasProfile(CamcorderQuality.HighSpeed1080p)
CamcorderProfile.HasProfile(CamcorderQuality.HighSpeed720p)
return false - as do all HighSpeed profiles. Though its clear the camera can do them.
Some posts I’ve read say that Camera2 is needed, however I’ve tried a variety of sample Xamarin projects for Camera2… none of these record > 30fps (Xamarin_Android___Camera2Video for example). I’ve not been able to find the Xamarin_Android version of Android-Slow-Motion-Camera2, though I’ve seen indications that it exists.
My goal is to record 240fps and play back at 30fps. Which I think requires some use of SetCaptureRate, but since I can’t get it to record 240fps, I haven’t gotten that far. SetVideoEncodingBitRate likely needs to be some other value too.
I’ve posted about this in forums of all kinds, with no responses at all. What am I missing here? Is this an Xamarin limitation? I’ve also read the suggestion that only system apps can do high speed recording. If that’s the case, why do CamcorderQuality.HighSpeed… options even exist. So, I’m not convinced.