-1

I am working on a app about recording videos, but I have problems using the app. When I click the record button, it stops. I have already checked the logcat, it said "setVideoSource failed." :( By the way, I am not really good at English, I may make some mistakes... QAQ And here is my code:

recorder = new MediaRecorder();
    recorder.setPreviewDisplay(holder.getSurface());
    recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
    recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
    recorder.setVideoFrameRate(25);
    recorder.setVideoSize(800,480);
    recorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
    recorder.setOutputFile(path);

1 Answers1

0

If you are using the Android Emulator, the Emulator camera is maybe set up wrong. More infos

Or you don't have the the right permissions.

thatmarcel
  • 388
  • 3
  • 15