似乎即使我将录像机配置文件设置为低,视频质量也是最高的。
这是我的代码:
camera.setDisplayOrientation(90);
camera.unlock();
recorder.reset();
recorder.setCamera(camera);
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
recorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_LOW));
//when removing these comments I get an exception on my 4.2.2 device when calling start() on the recorder.
/* recorder.setVideoFrameRate(24);
recorder.setVideoSize(480, 360);
*/
recorder.setOrientationHint(90);
file = FileUtils.getFileName(FileTypes.VIDEO);
if (!file.exists()) {
try {
file.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
}
recorder.setOutputFile(FileUtils.getFileName(FileTypes.VIDEO).toString());
recorder.setMaxDuration(45000);