Hello,
I have a problem with MediaRecorder. I want to record video. But fail
to prepare the MediaRecorder.
Here is the logs and source code. Is there anything wrong?
In the logs, [Failed to get camera(0x32e58) parameters].
I think that this is due to.
Why failed to get camera parameters?
Also, what should I do?
- Environment
-- Dev phone 1
-- OS 1.6
Thank you.
---- source code ----
private boolean initializeRecorder() {
Log.i(TAG, "initializeRecorder");
try {
releaseMediaRecorder();
mRecorder = new MediaRecorder();
mRecorder.setCamera(mCameraDevice);
mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
mRecorder.setMaxDuration(30000);
mRecorder.setOutputFile("/sdcard/sample.3gp");
mRecorder.setVideoFrameRate(10);
mRecorder.setVideoSize(176, 144);
mRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H263);
mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
mRecorder.setPreviewDisplay(mSurfaceHolder.getSurface());
mRecorder.setMaxFileSize(50000000);
mRecorder.prepare(); // <-
occur exception
Log.i(TAG, "initializeRecorder prepared"); // <- not called
return true;
} catch (IllegalStateException e) {
releaseMediaRecorder();
e.printStackTrace();
} catch (IOException e) {
releaseMediaRecorder();
e.printStackTrace();
}
return false;
}
--------
---- logs ----
I/ActivityManager(72): Starting activity: Intent
{ cmp=com.wataru.test15/.RecordVideoActivity }
D/test15(1698): test15 onPause()
I/RecordVideoActivity(1698): startPreview
D/CameraService(51): CameraService::connect E (pid 1698, client
0x1c3f8)
D/CameraService(51): Client::Client E (pid 1698)
D/QualcommCameraHardware(51): createInstance: E
D/QualcommCameraHardware(51): createInstance: X created
hardware=0x20068
D/CameraService(51): Client::Client X (pid 1698)
D/CameraService(51): CameraService::connect X
D/CameraService(51): getParameters(antibanding=off;antibanding-
values=off;effect=none;effect-
values=none,mono,negative,solarize,sepia,posterize,whiteboard,blackboard,aqua;jpeg-
quality=100;jpeg-thumbnail-height=384;jpeg-thumbnail-quality=90;jpeg-
thumbnail-width=512;picture-format=jpeg;picture-size=2048x1536;picture-
size-values=2048x1536,1600x1200,1024x768;preview-
format=yuv420sp;preview-frame-rate=15;preview-
size=480x320;whitebalance=auto;whitebalance-
values=auto,incandescent,florescent,daylight,cloudy,twilight,shade)
D/CameraService(51): setParameters(jpeg-thumbnail-
width=512;antibanding-values=off;preview-frame-rate=15;preview-
size=176x144;picture-format=jpeg;antibanding=off;jpeg-thumbnail-
height=384;picture-size=2048x1536;effect=none;whitebalance=auto;jpeg-
thumbnail-quality=90;jpeg-quality=100;whitebalance-
values=auto,incandescent,florescent,daylight,cloudy,twilight,shade;preview-
format=yuv420sp;effect-
values=none,mono,negative,solarize,sepia,posterize,whiteboard,blackboard,aqua;picture-
size-values=2048x1536,1600x1200,1024x768)
D/Camera(1698): app passed NULL surface
D/CameraService(51): setPreviewDisplay(0x0) (pid 1698)
D/CameraService(51): startPreview (pid 1698)
D/CameraService(51): startCameraMode(0) (pid 1698)
D/CameraService(51): mSurface is not set yet.
D/CameraService(51): startPreviewMode (pid 1698)
I/QualcommCameraHardware(51): initPreview E: preview size=176x144
D/QualcommCameraHardware(51): frame_thread E
W/RecordVideoActivity(1698): surfaceCreated
D/CameraService(51): setPreviewDisplay(0x310c8) (pid 1698)
I/RecordVideoActivity(1698): initializeRecorder
D/CameraService(51): getParameters(antibanding=off;antibanding-
values=off;effect=none;effect-
values=none,mono,negative,solarize,sepia,posterize,whiteboard,blackboard,aqua;jpeg-
quality=100;jpeg-thumbnail-height=384;jpeg-thumbnail-quality=90;jpeg-
thumbnail-width=512;picture-format=jpeg;picture-size=2048x1536;picture-
size-values=2048x1536,1600x1200,1024x768;preview-
format=yuv420sp;preview-frame-rate=15;preview-
size=176x144;whitebalance=auto;whitebalance-
values=auto,incandescent,florescent,daylight,cloudy,twilight,shade)
I/RecordVideoActivity(1698): initializeRecorder manually call
camera.getParameters()
I/RecordVideoActivity(1698): releaseMediaRecorder
D/CameraService(51): Client::connect E (pid 51, client 0x32e5c)
W/CameraService(51): Attempt to use locked camera (client 0x1c3f8)
from different process (old pid 1698, new pid 51)
W/CameraService(51): Tried to connect to locked camera (old pid 1698,
new pid 51)
I/MediaRecorderJNI(1698): prepare: surface=0x1f0be8 (id=2)
I/OMXVenc(51): component_init::292 Initializing component
OMX.qcom.video.encoder.h263
E/OMXVenc(51): get_parameter::922 unsupported index 267887431
E/OMXVenc(51): get_parameter::899 unsupported index 117440523
E/OMXVenc(51): set_parameter::1099 unsupported index in set_parameter
117440523
E/OMXVenc(51): get_parameter::922 unsupported index 100663301
E/OMXVenc(51): set_parameter::1142 unsupported index 100663301
E/OMXVenc(51): get_parameter::922 unsupported index 100663302
E/OMXVenc(51): set_parameter::1142 unsupported index 100663302
I/OMXVenc(51): send_command::690 attempt to move to new state 2
E/OMXVenc(51): Setting OMX_Video_ControlRateVariable
E/OMXVenc(51): process_state_change::2440 Rotation is: 0 in 258376
I/VENC_DRV(51): venc_drv_malloc::1155 /dev/pmem_adsp
I/VENC_DRV(51): venc_drv_malloc::1183 phys lookup success
virt=0x41364000 -- FD=27 -- size - 524288
W/InputConnectionWrapper.ICC(430): Timed out waiting on
IInputContextCallback
D/CameraInput(51): Intended mFrameWidth=176, mFrameHeight=144
E/CameraInput(51): Failed to get camera(0x32e58) parameters
E/MediaRecorder(1698): prepare failed: -2147483648
I/RecordVideoActivity(1698): releaseMediaRecorder
I/OMXVenc(51): send_command::690 attempt to move to new state 1
E/VENC_CONTEXT(51): VencContext_DestroyStatsThread::499 failed to join
stats thread
E/VENC_CONTEXT(51): VencContext_DeviceNotifyDestroy::532 Failed to
destroy stats thread
E/QCOmxcore(51): OMXCORE API : Free Handle 3f0c4
I/OMXVenc(51): component_deinit::1912 deinitializing component...
E/QCOmxcore(51): Unloading the dynamic library for
OMX.qcom.video.encoder.h263
W/System.err(1698): java.io.IOException: prepare failed.
--------
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en