MediaRecorder.stop() stop failed: -1007

后端 未结 5 1777
情书的邮戳
情书的邮戳 2020-12-05 10:09

I am recording video with MediaRecorder. My code works fine on 2.3.3 but fails on 4.0.3.

The issue is following: the code mediaRecorder.stop() throws the RuntimeExep

5条回答
  •  星月不相逢
    2020-12-05 10:49

    I had -1007 error on some devices, mostly with android 9 and finally i solved this problem. The reason was that OMX.google.h264.encoder supports only video sizes evenly dividable by 16. I used displayMetrics.widthPixels and displayMetrics.heightPixels for video size and it is not meet requirements on all devices.

    Hope this helps someone!

提交回复
热议问题