stubborn
stubborn

Reputation: 330

Determine maximum bitrate supported to record videos

Currently my bitrate is hardcoded to ~2mb/s. I want to set it to the maximum bitrate supported by the device, but I'm not sure how to check it.

Here's part of my code if it helps:

  MyRecorder = new MediaRecorder();

    // ...
        MyRecorder.SetVideoEncoder(VideoEncoder.H264);
        MyRecorder.SetVideoEncodingBitRate("2000000"); 
    // ...

How do I check what is the maximum supported rate or what is the recommended bitrate for recording High Quality videos?

Upvotes: 0

Views: 579

Answers (1)

Leo Zhu
Leo Zhu

Reputation: 15021

Maybe you could try this :

MediaRecorder mediaRecorder = new MediaRecorder();
CamcorderProfile camcorderProfile = CamcorderProfile.Get(CamcorderQuality.High);//Quality level corresponding to the highest available resolution.
var targetVideoBitRate = camcorderProfile.VideoBitRate;
mediaRecorder.SetAudioEncodingBitRate(targetVideoBitRate);

the more information you could refer to CamcorderProfile

Upvotes: 1

Related Questions