android mediarecorder exception
Posted
by Arutha
on Stack Overflow
See other posts from Stack Overflow
or by Arutha
Published on 2010-06-17T13:40:46Z
Indexed on
2010/06/17
13:43 UTC
Read the original article
Hit count: 334
I try to use the MediaRecorder class to record a video but I get an exception : failed to get Camera parameters. Prepare failed.
Here's my code :
camera = Camera.open();
recorder = new MediaRecorder();
recorder.setCamera(camera);
recorder.setVideoSource(VideoSource.CAMERA);
recorder.setPreviewDisplay(m_holder.getSurface());
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setVideoEncoder(MediaRecorder.VideoEncoder.DEFAULT);
recorder.setMaxDuration(10000);
recorder.setOutputFile(file.getPath());
recorder.prepare();
Any idea ?
© Stack Overflow or respective owner