I see the log:

08-05 11:26:33.220: VERBOSE/GSTMediaRecorder(1075): setOutputFormat:
THREE_GPP
08-05 11:26:33.220: VERBOSE/GSTMediaRecorder(1075): setParameters max-
duration=600000
08-05 11:26:33.220: VERBOSE/GSTMediaRecorder(1075): setVideoFrameRate:
20 fps
08-05 11:26:33.221: VERBOSE/GSTMediaRecorder(1075): setVideoSize:
352x288
08-05 11:26:33.221: VERBOSE/GSTMediaRecorder(1075): setVideoEncoder:
H263
08-05 11:26:33.221: VERBOSE/GSTMediaRecorder(1075): setAudioEncoder:
AMR_NB
08-05 11:26:33.222: VERBOSE/GSTMediaRecorder(1075): setOutputFile:
fd=13 offset=0 length=0
08-05 11:26:33.225: VERBOSE/GSTMediaRecorder(1075): destructor
08-05 11:26:33.226: INFO/ActivityManager(1084): Process
com.example.android.camerarec3 (pid 1220) has died.

It stops at setPreviewDisplay()
How to make a surface??
who can help me?


public class CameraRec3 extends Activity {
    /** Called when the activity is first created. */
        private static final int MAX_RECORDING_DURATION_MS = 10 * 60 * 1000;
    @Override

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        //sv for preview the camera video
        SurfaceView sv = (SurfaceView) findViewById
(R.id.mySurfaceView);
        SurfaceHolder holder = sv.getHolder();
        MediaRecorder recorder = new MediaRecorder();

        String filePath=("/sdcard/test.3gpp");
        recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
        recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
        recorder.setOutputFormat
(MediaRecorder.OutputFormat.THREE_GPP);

        recorder.setVideoEncoder (MediaRecorder.VideoEncoder.H263);
        recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
        recorder.setMaxDuration(MAX_RECORDING_DURATION_MS);
        recorder.setVideoSize(352,288);
        recorder.setVideoFrameRate(20);

        //we can use the getPath function to create file path
        recorder.setOutputFile(filePath);
        this.setRequestedOrientation
(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
        recorder.setPreviewDisplay(holder.getSurface());

        try
        {
                recorder.prepare();
        }
        catch (IllegalStateException e)
        {
            Log.i(this.getClass().toString(),e.getMessage());
        }
        catch (IOException e)
        {
            Log.i(this.getClass().toString(),e.getMessage());
        }
        recorder.start();
    }

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

Reply via email to