I have found that setvideoencodingbitrate(800000)
works for most of the devices I am using but on the Samsung Galaxy S6 it seems to record at 1.3 MBs rather than 800 kbs as set.
I am assuming this is because the device doesnt support that bit rate (I could be wrong)
Is there a way of getting an android devices supported videoencoding bitrates? or at least seeing what the MediaRecorder
has been set to after calling on prepare? I cant seem to find any kind of mediaRecorder.getvideoencodingbitrate
call?
Code below.
mediaRecorder.setVideoEncodingBitRate(500000); //500000 works with galaxy s6
mediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
mediaRecorder.setVideoFrameRate(mCaptureProfile.framesPerSecond);
// Audio Settings
mediaRecorder.setAudioChannels(mCaptureProfile.audioNumChannels);
mediaRecorder.setAudioSamplingRate(mCaptureProfile.audioSampleRate);
mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
mediaRecorder.setAudioEncodingBitRate(mCaptureProfile.audioBitRate);
mediaRecorder.prepare();