when i add video source and video encoder, it gives error in
recoreder.prepare() (prepare failed) while the same code is working
only for audio.
i am not finding what i am doing wrong.Please help

setContentView(R.layout.camera);
preview=(SurfaceView)findViewById(R.id.surface);
previewHolder=preview.getHolder();
previewHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
recorder = new MediaRecorder();
String url = "/sdcard/dcim/test.3gp";
camera = Camera.open();
Camera.Parameters parameters = camera.getParameters();
parameters.setPreviewSize(352, 288);
parameters.set("orientation", "portrait");
camera.setParameters(parameters);
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setOutputFile(url);
recorder.setVideoFrameRate(15);
recorder.setVideoSize(480, 320);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setVideoEncoder(MediaRecorder.VideoEncoder.H263);
recorder.prepare();
recorder.start();
Thread.sleep(100000);
recorder.stop();
recorder.release();

} catch (Exception e) {
e.getMessage();
}

On Nov 17, 10:32 pm, android_dev <pankaj.i...@gmail.com> wrote:
> HI,
> i am trying to record video and upload to web, i have given my best
> effort but no luck, i am not sure if it is possible with android 1.6.
> Please help me to figure out the solution. is it possible to do
> that.its really urgent

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to