I guess there is no solution
so the answer: MediaRecorder/Android is buggy or Mobile companies didn’t care of all Android features while developing their devices
Update
MediaCodec
is also buggy with canvas
mSurface = mMediaCodec.createInputSurface();
mSurface.lockHardwareCanvas()
It works on much more devices with MediaCodec but still some devices may fail to record video correctly using this method
So final answer: don’t ever use lockCanvas
or lockHardwareCanvas
when working with MediaCodec
or MediaRecorder
, it’s buggy..
The only way – OpenGl ES
other links about issue:
https://github.com/googlesamples/android-Camera2Video/issues/86
https://issuetracker.google.com/issues/111433520