mediarecorder

Android MediaRecorder start failed: -12

拈花ヽ惹草 提交于 2019-12-11 11:36:57
问题 I've been trying to make an app (API 8) that records video, without audio. I've followed the instructions on the Android tutorial. My code is as follows: mCamera.unlock(); recorder = new MediaRecorder(); recorder.setCamera(mCamera); recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT); recorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT); recorder.setVideoEncoder(MediaRecorder.VideoEncoder.DEFAULT); recorder.setOutputFile(getOutputMediaFile(MEDIA_TYPE_VIDEO).toString()); /

MediaRecorder start failed: -16

不打扰是莪最后的温柔 提交于 2019-12-11 07:17:03
问题 So I realize there are many solutions out there for MediaRecorder start errors, however most of them revolve around "start failed: -19", which has been linked to "NO_INIT" See comments in selected answer here. I haven't found any solution, or even an explanation for -16. If someone knows where i can find the names of these error codes, or has a solution for code -16 Please put the answer here!! Here is the code I'm using. (HTC Thunderbolt, Stock) mr.setVideoSource(MediaRecorder.VideoSource

android mediarecorder error (MediaRecorder start failed : -19)

余生长醉 提交于 2019-12-11 06:46:26
问题 When I try to make the camera recorder in my program I get this error: E/MediaRecorder﹕ start failed: -19 code is try { final SurfaceView sv = (SurfaceView) findViewById(R.id.srvView); MediaRecorder mrec = new MediaRecorder(); mrec.setCamera(camera); mrec.setAudioSource(MediaRecorder.AudioSource.MIC); mrec.setVideoSource(MediaRecorder.VideoSource.CAMERA); mrec.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4); mrec.setVideoFrameRate(10); mrec.setVideoSize(480, 320); mrec.setAudioEncoder

IllegalStateException [start called in an invalid state: 1] on restarting Android MediaRecorder

依然范特西╮ 提交于 2019-12-11 03:19:37
问题 I am trying to implement simple logic to start/stop recording with MediaRecorder of Android. The cycle is connect to localSocket / set options / mRecorder.prepare(); mRecorder.start(); mRecorder.stop(); mRecorder.reset(); Then, loop between 2 and 3. In the first cycle, 1,2,3 works fine as intended, however, I've got an error on the second start(restart) after the first stop. com.example.app E/MediaRecorder﹕ start called in an invalid state: 1 What is the MediaRecorder state 1 ? What do I miss

mediarecorder.stop() -> timed out waiting for incoming camera video frames

可紊 提交于 2019-12-11 02:33:29
问题 this is a little pain in the ass lately for me. Some of the devices on which I'm running my app, are getting this error. Basically, application starts recording, goes to background. When app is being brought to front, it should perform mediarecorder.stop() and restart recording. Somehow, some of the devices have problem with this. In those situations, I'm getting black screen and "timed out waiting for incoming camera video frames" message. Camera is locked and can't be used anymore even when

Android MediaRecorder - Start Failed: -2147483648 on 2.3.3

柔情痞子 提交于 2019-12-11 02:25:17
问题 The MediaRecorder works on other versions of Android but not on 2.3.3: try { MediaRecorder mRecorder = new MediaRecorder(); mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4); mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT); mRecorder.setOutputFile( path + "r_" + FileName ); int version = android.os.Build.VERSION.SDK_INT; Log.d("MP3Downloader", "V: " + version ); if( version >= 8 ) { mRecorder

“Seekable” file descriptor to use with MediaRecorder Android 6.0 (API 23)

a 夏天 提交于 2019-12-10 23:49:09
问题 So I am trying to use my Android as a webcam. My code is working perfectly for API <= 22. I am using ParcelFileDescriptor 's createPipe() method to create pipe for reading and writing. In short, my writing to the pipe looks like following: ParcelFileDescriptor[] parcelFileDescriptors = ParcelFileDescriptor.createPipe(); ParcelFileDescriptor mParcelWrite =new ParcelFileDescriptor(mParcelFileDescriptors[1]); MediaRecorder mMediaRecorder = new MediaRecorder(); mMediaRecorder.setOutputFile

Detect supported audio encoders on Android to prevent crash “The given audio encoder 2 is not found”

孤街醉人 提交于 2019-12-10 17:19:38
问题 When an Android device does not support a mandatory audio-encoder, you get: (X=numeric index of the encoder) E/MediaProfiles(4048): The given audio encoder X is not found A/AudioSource(4048): frameworks/base/media/libstagefright/AudioSource.cpp:58 CHECK(channels == 1 || channels == 2) failed. A/libc(4048): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1) In native code. No Exception to react to. App is just force closed. Is there any way to query an Android >3.x device if AAC AMR-NB and AMR

MediaRecorder problems on starting video capturing on android

会有一股神秘感。 提交于 2019-12-10 17:16:45
问题 I'm trying to develop an App that amongst other things can record videos from its User. So I need to capture the video with the front facing camera if there is one. I build a camera preview and this works fine. I used the Android How-To Sites to build a MediaRecorder and set it up. If I use a CamcorderProfile my Media Server dies when I call start(). If I set up the encoder by myself the media server throws a runtime exception at start() with the message "start failed: -19" I found some

How to encapsulate a custom MediaRecorder in Android Kotlin?

耗尽温柔 提交于 2019-12-10 12:09:16
问题 I am new to Kotlin programming. I use the following code to record audio as part of my AudioRecorderDialogFragment: fun startVoiceRecorder(voiceFilename: String) { if (mAudioRecorder == null) { // We don't have an AudioRecorder, so we build one mAudioRecorder = MediaRecorder() mAudioRecorder?.setAudioSource(MediaRecorder.AudioSource.MIC) mAudioRecorder?.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4) mAudioRecorder?.setAudioEncoder(MediaRecorder.OutputFormat.MPEG_4) val audioOutputFile =