I am using mediaRecorder and camera to try and record a video, following the guide at http://developer.android.com/guide/topics/media/camera.html
On the mediaRecorder I set sources, set file, prep, and start the camera...which all works great.
I then call mediaRecorder.stop, which according to the guide is the first call you make during the stop process, and the application just hangs. No error, no exceptions, nada.
It's wrapped in a try/catch and nothing is thrown or caught.
Log.d(TAG, "try mediaRecorder stop");
try { mMediaRecorder.stop(); }
catch (Exception e) {...}
logcat doesn't seem to have anything useful either
09-18 08:34:28.079 D/MyCameraApp﹕ **try mediaRecorder stop**
09-18 08:34:28.273 D/jdwp﹕ processIncoming
09-18 08:34:28.273 D/jdwp﹕ handlePacket : cmd=0x1, cmdSet=0xC7, len=0x14, id=0x40001414, flags=0x0, dataLen=0x9
09-18 08:34:28.273 D/jdwp﹕ sendBufferedRequest : len=0x34
09-18 08:34:28.774 D/jdwp﹕ processIncoming
...repeat same messages forever...
09-18 08:34:43.374 I/AndroidRuntime﹕ VM exiting with result code 1, cleanup skipped.
When I view fileManager the video is indeed created and its size grows based on how long I left it alone before killing the app. If I try to open the video I get "Can't play this video" error.
Why is the application hanging up? I can't find a way to even see any useful error messages.
--start camera code incase I'm doing something wrong here--
mCamera.unlock();
mMediaRecorder.setCamera(mCamera);
mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
mMediaRecorder.setProfile(CamcorderProfile.get(1));
mMediaRecorder.setOutputFile(getOutputMediaFile(MEDIA_TYPE_VIDEO).toString());
try { mMediaRecorder.prepare(); }
catch (IOException e) {...}
catch (IllegalStateException e) {...}
try { mMediaRecorder.start(); }
catch (Exception e) {...}
Update 1
I have tried resetting device and adding a release to caught errors, still no clue where or why it might be failing.
Still no dice, any clues on how I can even attempt to get more information? About where/why it's crashing?
Update 2
I have tried on another device and am getting an illegalstateexception during mediarecorder start. Perhaps this sheds some light onto the issue? I opened another question since I'm not positive the two are the same: Android video recording - IllegalStateException on mediaRecorder.start