Android setVideoEncodingBitRate () not defined in MediaRecorder package

I am trying to change the video encoding speed on Android using MediaRecorder.setVideoEncodingBitRate(int).

I looked at the Android documentation and set this method to set / change the bit rate, but when I try to use this method, I get setVideoEncodingBitrRate(int)not specified in the package MediaRecorder.

Why is this so?

+3
source share
2 answers

I suggest you check which version of the API you are using

setVideoEncodingBitRate() just come on v8 or Android 2.1 API

If you use a version less than it will not be available: D


You can also use it like this:

webCamRecorder = new MediaRecorder();
if (target_holder == null)
    return;
webCamRecorder.setPreviewDisplay(target_holder.getSurface());
webCamRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
webCamRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
webCamRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
webCamRecorder.setAudioEncodingBitRate(196608);
webCamRecorder.setVideoSize(640, 480);
webCamRecorder.setVideoFrameRate(30);
webCamRecorder.setVideoEncodingBitRate(15000000);
webCamRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
webCamRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
webCamRecorder.setOutputFile("your location to save");
+4
source

setVideoEncodingBitRate - , , (MediaRecorder.setVideoEncodingBitRate(int)), MediaRecorder.

MediaRecorder mr = new MediaRecorder();
mr.setVideoEncodingBitRate(someint);

, android.media.MediaRecorder?

0

All Articles