MediaRecorder.stop() hanging with Android 4.0 (ICS)

后端 未结 9 1191
夕颜
夕颜 2021-02-04 01:08

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\

相关标签:
9条回答
  • 2021-02-04 02:03

    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();
    
    0 讨论(0)
  • 2021-02-04 02:07

    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..

    0 讨论(0)
  • 2021-02-04 02:07

    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

    0 讨论(0)
提交回复
热议问题