Android mediarecorder stop failed
If the recorder is not in a recording state, then the stop could fail.
See
http://developer.android.com/reference/android/media/MediaRecorder.html
audio and video recording errors in android
The camera API appears to require that many of the sources are set, including the audio, video, and preview surface. The following code is more complete:
recorder = new MediaRecorder();
recorder.setPreviewDisplay(previewSurface);
recorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setVideoEncoder(MediaRecorder.VideoEncoder.MPEG_4_SP);
recorder.setMaxDuration(1000 * 10);
recorder.setOnInfoListener(self);
recorder.setVideoSize(200, 200);
recorder.setVideoFrameRate(15);
recorder.setOutputFile("/sdcard/test.mp4");
recorder.prepare();
recorder.start();
Related Topics
How to Make an Http Request Using Cookies on Flutter
How to Parse This Nested JSON Array in Android
Accessing Contents of R.String Using a Variable to Represent the Resource Name
Retrofit - Multipart Request: Required Multipartfile Parameter 'File' Is Not Present
Can't Stop the Ringing Alarm from Another Activity
How to Evenly Distribute Buttons Across the Width of a Linearlayout
How to Synchronise Projects to Github with Android Studio
How to Set Up Dagger Dependency Injection from Scratch in Android Project
How to Use Ms Visual Studio for Android Development
Android - Acceleration Down (Smash)
Progressbar Togther with Asynctask
How to Attach Multiple Files to Email Client in Android
Passing Strings Between Activities in Android
How to Disable Instant Run for Android Studio 3.0
Importing Google-Play-Services Lib into Intellij Idea 12 (And 13)