I would like to give users the ability to set different permissions.
I tried this solution
camcorderProfile = CamcorderProfile.get(CamcorderProfile.QUALITY_720P); .... .... mCamera.unlock(); recorder.setCamera(mCamera); recorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT); recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT); recorder.setProfile(camcorderProfile);
It worked perfectly: good quality and all ...
When I installed it in
camcorderProfile = CamcorderProfile.get(CamcorderProfile.QUALITY_480P);
with FLASH on , the video turned greenish and some other weird colors.
I read online and people said it was because QUALITY_480P was probably not supported on my phone. Well, that makes sense.
So I started working on another solution, so I tried ...
recorder.setVideoSize(640, 480);
It worked great
but the video looked VERY ugly.
Then I checked the list of supported videos.
List<Size> GetSupportedVideosResolutions = params.getSupportedVideoSizes();
Resolution: 1280x720 listed, therefore
I tried to install the following:
recorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT); recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT); recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4); recorder.setVideoSize(1280,720); recorder.setVideoEncoder(MediaRecorder.VideoEncoder.DEFAULT); recorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);
This gave me a RuntimeException error.
Question:
Why doesn't it let me set the higher resolutions available on the phone?
Any help would be greatly appreciated.
Thanks.
Edit: added error log
04-18 17:40:07.391: E/AndroidRuntime(30191): java.lang.RuntimeException: start failed. 04-18 17:40:07.391: E/AndroidRuntime(30191): at android.media.MediaRecorder.start(Native Method) 04-18 17:40:07.391: E/AndroidRuntime(30191): at test.com.VideoActivity.prepare_StartRecorder(VideoActivity.java:1009) 04-18 17:40:07.391: E/AndroidRuntime(30191): at test.com.VideoActivity.Recorder_Start_Stop(VideoActivity.java:1102) 04-18 17:40:07.391: E/AndroidRuntime(30191): at test.com.VideoActivity$6.onClick(VideoActivity.java:246) 04-18 17:40:07.391: E/AndroidRuntime(30191): at android.view.View.performClick(View.java:4489) 04-18 17:40:07.391: E/AndroidRuntime(30191): at android.widget.CompoundButton.performClick(CompoundButton.java:104) 04-18 17:40:07.391: E/AndroidRuntime(30191): at android.view.View$PerformClick.run(View.java:18803) 04-18 17:40:07.391: E/AndroidRuntime(30191): at android.os.Handler.handleCallback(Handler.java:730) 04-18 17:40:07.391: E/AndroidRuntime(30191): at android.os.Handler.dispatchMessage(Handler.java:92) 04-18 17:40:07.391: E/AndroidRuntime(30191): at android.os.Looper.loop(Looper.java:137) 04-18 17:40:07.391: E/AndroidRuntime(30191): at android.app.ActivityThread.main(ActivityThread.java:5493) 04-18 17:40:07.391: E/AndroidRuntime(30191): at java.lang.reflect.Method.invokeNative(Native Method) 04-18 17:40:07.391: E/AndroidRuntime(30191): at java.lang.reflect.Method.invoke(Method.java:525) 04-18 17:40:07.391: E/AndroidRuntime(30191): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1209) 04-18 17:40:07.391: E/AndroidRuntime(30191): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1025) 04-18 17:40:07.391: E/AndroidRuntime(30191): at dalvik.system.NativeStart.main(Native Method)