2. You can customize the returned MediaRecorder object:
https://developer.android.com/reference/android/media/MediaRecorder#setVideoFrameRate(int)
Dim FrameRate As Int = 12
MediaRecorder.RunMethod("setVideoFrameRate", Array(FrameRate)) 'set to 30 by default
I'm having some trouble getting this right. I'm unsure where to put this code.
The documentation states that setVideoFrameRate "Must be called after setVideoSource()". I can't find such a call. It also says that it throws a "IllegalStateException" if "if it is called after prepare() or before setOutputFormat()".
I noticed that setOrientationHint is called in PrepareSurfaceForVideo. The documentation states that "This method should be called before prepare()."
Since setOrientationHint needs to be called before "prepare()" I assumed that would be a good place to call setVideoFrameRate. I added it after
MediaRecorder.RunMethod("setOrientationHint", Array(orientations.Get(Floor(rotation / 90))))
but I'm getting an IllegalStateException.
So my question is, where is the right place to call setVideoFrameRate and setVideoEncodingBitRate?