myrao / ScreenRecorder

A demo of Android screen recorder, no root but SDK version should more than Android 5.0 API 21.
497 stars 174 forks source link

无法运行 #1

Closed tielan closed 7 years ago

tielan commented 7 years ago

java.lang.IllegalStateException 03-01 02:49:18.435 5733-5843/net.yrom.screenrecorder W/System.err: at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method) 03-01 02:49:18.435 5733-5843/net.yrom.screenrecorder W/System.err: at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:1033) 03-01 02:49:18.435 5733-5843/net.yrom.screenrecorder W/System.err: at net.yrom.screenrecorder.ScreenRecorder.recordVirtualDisplay(ScreenRecorder.java:108) 03-01 02:49:18.435 5733-5843/net.yrom.screenrecorder W/System.err: at net.yrom.screenrecorder.ScreenRecorder.run(ScreenRecorder.java:97)

myrao commented 7 years ago

您好,可以请你报一下设备信息么? 系统版本 / 手机型号 谢谢!

tielan commented 7 years ago

模拟器上面不行 用真机测试了一下 可以了

tielan commented 7 years ago

这个怎么 暂停

myrao commented 7 years ago

目前还真没有暂停的功能,你可以自行定义muxer的行为,不过我已经改为了直播推流,可能不再像以前那样的单一录制到本地了

Xyong37 commented 7 years ago

大神,关于录屏,我有点问题想请教一下,我用了官方提供的api,其他手机可以,oppo系列的手机测试了四台都不可以,请问你有遇到过这种问题吗?

myrao commented 7 years ago

目前测试过的 OPPO 手机不多,但是并没有遇到你说的无法录屏的现象,可以提供一下具体的现象描述及 Log 我可以帮你看看,但我也不能确保能够 Fix

Xyong37 commented 7 years ago

每次录屏会闪退 但是没有报具体的错误,我看到log上有一些打印 05-09 14:37:19.039 23417-23417/? E/Process: android_os_Process_getProcessNameByPid pid is 23417 05-09 14:37:19.039 23417-23417/? E/Process: android_os_Process_getProcessNameByPid value is .ks.activity.t1 05-09 14:37:19.089 23417-23450/? D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true 05-09 14:37:19.129 23417-23450/? I/Adreno-EGL: : EGL 1.4 QUALCOMM build: (I9d3821c5ab) OpenGL ES Shader Compiler Version: E031.25.03.04 Build Date: 11/20/15 Fri Local Branch: Remote Branch: Local Patches: Reconstruct Branch: 05-09 14:37:19.129 23417-23450/? I/OpenGLRenderer: Initialized EGL, version 1.4 05-09 14:37:19.139 23417-23450/? D/OpenGLRenderer: Enabling debug mode 0

myrao commented 7 years ago

这些 Log 大多都是 OpenGL 的,看不出原因,建议加个 ExceptionHandler 捕获一下全局的崩溃信息

Xyong37 commented 7 years ago

好的

Xyong37 commented 7 years ago

这是我截取到的错误,麻烦大神再帮我看一下,十分感谢 05-09 18:35:59.697 26362-26805/com.ks.activity.t1 E/ACodec: [OMX.qcom.video.encoder.avc] failed to set input port definition parameters. 05-09 18:35:59.697 26362-26805/com.ks.activity.t1 E/ACodec: [OMX.qcom.video.encoder.avc] configureCodec returning error -1010 05-09 18:35:59.697 26362-26805/com.ks.activity.t1 E/ACodec: [OMX.qcom.video.encoder.avc] configureCodec returning error -1010 05-09 18:35:59.697 26362-26805/com.ks.activity.t1 E/ACodec: signalError(omxError 0x80001001, internalError -1010) 05-09 18:35:59.697 26362-26804/com.ks.activity.t1 E/MediaCodec: Codec reported err 0xfffffc0e, actionCode 0, while in state 3 05-09 18:35:59.697 26362-26362/com.ks.activity.t1 E/MediaCodec: configure failed with err 0xfffffc0e, resetting... 05-09 18:35:59.697 26362-26598/com.ks.activity.t1 E/ACodec: [OMX.qcom.video.decoder.avc] ERROR(0x80001009) 05-09 18:35:59.697 26362-26805/com.ks.activity.t1 E/ACodec: [OMX.qcom.video.encoder.avc] ERROR(0x80001009) 05-09 18:35:59.697 26362-26598/com.ks.activity.t1 E/ACodec: signalError(omxError 0x80001009, internalError -2147483648) 05-09 18:35:59.697 26362-26805/com.ks.activity.t1 E/ACodec: signalError(omxError 0x80001009, internalError -2147483648) 05-09 18:35:59.697 26362-26597/com.ks.activity.t1 E/MediaCodec: Codec reported err 0x80001009, actionCode 0, while in state 6 05-09 18:35:59.697 26362-26804/com.ks.activity.t1 E/MediaCodec: Codec reported err 0x80001009, actionCode 0, while in state 10 05-09 18:35:59.707 309-1503/? E/OMX-VENC: ERROR: Omx_venc::Comp Init Returning failure 05-09 18:35:59.707 309-1503/? E/OMX-VENC: ERROR: venc_open failed 05-09 18:35:59.707 309-1503/? E/OMX: FAILED to allocate omx component 'OMX.qcom.video.encoder.avc' 05-09 18:35:59.707 26362-26805/com.ks.activity.t1 E/OMXMaster: A component of name 'OMX.qcom.audio.decoder.aac' already exists, ignoring this one. 05-09 18:35:59.707 26362-26362/com.ks.activity.t1 E/AndroidRuntime: FATAL EXCEPTION: main Process: com.ks.activity.t1, PID: 26362 android.media.MediaCodec$CodecException: Error 0xfffffc0e

myrao commented 7 years ago

看这样子是MediaCodec硬编码器这块的问题,你测试的这些OPPO机型用的是什么CPU?你可以先不用录屏,直接写个Camera的Demo取原始帧来进行编码看看会不会出问题,先锁定一下问题所在吧。

Xyong37 commented 7 years ago

MediaFormat mediaFormat = MediaFormat.createVideoFormat("video/avc", mWindowWidth, trans_height - 50); 问题在这个宽高上面,如果我把宽高随便写 ,我刚刚写了 200,100 这样测试没有问题

myrao commented 7 years ago

编码器对分辨率是有兼容性的,你在使用前要先遍历一下编码器的分辨率支持的范围

Xyong37 commented 7 years ago

嗯,谢谢大神指点