yrom / ScreenRecorder

Implement screen capture without root on Android 5.0+ by using MediaProjectionManager, VirtualDisplay, AudioRecord, MediaCodec and MediaMuxer APIs
1.86k stars 528 forks source link

writeSampleData returned an error #47

Open kimonic opened 4 years ago

kimonic commented 4 years ago

java.lang.IllegalStateException: writeSampleData returned an error at android.media.MediaMuxer.nativeWriteSampleData(Native Method) at android.media.MediaMuxer.writeSampleData(MediaMuxer.java:714) at com.hisense.screenrecord.recorder.ScreenRecorder.writeSampleData(ScreenRecorder.java:446) at com.hisense.screenrecord.recorder.ScreenRecorder.muxVideo(ScreenRecorder.java:290) at com.hisense.screenrecord.recorder.ScreenRecorder.access$500(ScreenRecorder.java:59) at com.hisense.screenrecord.recorder.ScreenRecorder$2.onOutputBufferAvailable(ScreenRecorder.java:541) at com.hisense.screenrecord.recorder.BaseEncoder$1.onOutputBufferAvailable(BaseEncoder.java:197) at android.media.MediaCodec$EventHandler.handleCallback(MediaCodec.java:1706) at android.media.MediaCodec$EventHandler.handleMessage(MediaCodec.java:1653) at android.os.Handler.dispatchMessage(Handler.java:112) at android.os.Looper.loop(Looper.java:216) at android.os.HandlerThread.run(HandlerThread.java:65)

MuLx10 commented 4 years ago

@kimonic Overlay permissions are not granted.