When calling stop()
within my Video Capture activity, on occasion, the software will hang and will not come back to life. Only triggering an ANR by hitting \"Back\
This also happened to me because I was releasing the camera before performing stop() on the recorder. It also explains the error message "Timed out waiting for incoming camera video frames". It's waiting for a camera that is already released. Make sure to stop the recorder - and only then release the camera:
mMediaRecorder.stop();
mMediaRecorder.release();
camera.stopPreview();
camera.release();
I accidentally rejected an answer during review that was given using an 'edit' of the question:
user2171513 answered:
I was facing the same issue and the solution that I found was to add mCamera.lock(); right before mCamera.unlock(); before camera is set in MediaRecorder..
I also got a error like this. My activity contains a mutative SurfaceView that display preview,so after I start recording, the width of SurfaceView shrinked,and I could not stop the recording, get the ANR error。 I sovle the problem by fix the SurfaceView's dimension。 Hope it helpful