Hi,
While recording video getting Exception from Prepare method as illegal
state exception
final SurfaceView surfaceview =
(SurfaceView)dialog.findViewById(R.id.SurfaceView01);
                                SurfaceHolder holder = surfaceview.getHolder();
                                final Surface target = holder.getSurface();
mRecordStop.setBackgroundResource(R.drawable.stoprecord);
mVideoRecorder = new MediaRecorder();
Log.i("video test", "setVideoSource");
        
mVideoRecorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);

                                                        Log.i("video test", 
"setOutputFormat");
        
mVideoRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);

                                                        Log.i("video test", 
"setVideoEncoder");
        
mVideoRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H263);
                                                        Log.i("video test", 
"setOutputFile");
                                                        
mVideoRecorder.setOutputFile("/sdcard/dummy.mp4");
                                                        
//mVideoRecorder.setVideoSize(240, 380);
                                                        
//mVideoRecorder.setVideoFrameRate(15);

                                                        Log.i("video test", 
"setPreviewDisplay");
                                                        
mVideoRecorder.setPreviewDisplay(target);

                                                        
Toast.makeText(VideoTemplateActivity.this, "Recorder Working",
5).show();
                                                        try {

                                                    Log.i("video test", 
"prepare");
                                                                
mVideoRecorder.prepare();
                                                        } catch 
(IllegalStateException e) {
                                                                
e.printStackTrace();
                                                        } catch (IOException e) 
{
                                                                
e.printStackTrace();
                                                        }

-- 
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