pedroSG94 / RootEncoder

RootEncoder for Android (rtmp-rtsp-stream-client-java) is a stream encoder to push video/audio to media servers using protocols RTMP, RTSP, SRT and UDP with all code written in Java/Kotlin
Apache License 2.0
2.57k stars 776 forks source link

Rtmp from file, library "libwvm.so" not found #627

Closed yurensmile closed 4 years ago

yurensmile commented 4 years ago

Hello, pedro, when i use this lib to rtmp from file, there is an error occur, the device is EMUI 4.0.2 (android 6.0), the video is recorded by your library. It generates the error "library "libwvm.so" not found". Is it the huawei's system(EMUI) error? Do you have solution to deal with it? thank you very much.

Below is the log.

07-20 15:36:44.835 24299-24299/? I/art: Late-enabling -Xcheck:jni
07-20 15:36:44.889 24299-24324/com.pedro.rtpstreamer E/HAL: load: id=gralloc != hmi->id=gralloc
07-20 15:36:44.902 24299-24299/com.pedro.rtpstreamer W/System: ClassLoader referenced unknown path: /data/app/com.pedro.rtpstreamer-2/lib/arm64
07-20 15:36:44.938 24299-24299/com.pedro.rtpstreamer I/HwCust: Constructor found for class android.app.HwCustHwWallpaperManagerImpl
07-20 15:36:44.948 24299-24299/com.pedro.rtpstreamer W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter androidx.vectordrawable.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
07-20 15:36:44.989 24299-24299/com.pedro.rtpstreamer I/art: Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$2>
07-20 15:36:44.990 24299-24299/com.pedro.rtpstreamer I/art: Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$2>
07-20 15:36:45.138 24299-24337/com.pedro.rtpstreamer E/HAL: load: id=gralloc != hmi->id=gralloc
07-20 15:36:45.138 24299-24337/com.pedro.rtpstreamer I/OpenGLRenderer: Initialized EGL, version 1.4
07-20 15:37:03.913 24299-24299/com.pedro.rtpstreamer E/WVMExtractor: Failed to open libwvm.so: dlopen failed: library "libwvm.so" not found
07-20 15:37:03.915 24299-24299/com.pedro.rtpstreamer I/FFMPEGExtractor: Users across the process calls!
07-20 15:37:03.923 24299-24299/com.pedro.rtpstreamer I/Utils: vstride = 0,vsliceHeight = 0
07-20 15:37:04.107 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unsupported profile 64 for video/avc
07-20 15:37:04.107 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unsupported profile 64 for video/avc
07-20 15:37:04.107 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unsupported profile 64 for video/avc
07-20 15:37:04.107 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unsupported profile 64 for video/avc
07-20 15:37:04.107 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unsupported profile 64 for video/avc
07-20 15:37:04.107 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unsupported profile 64 for video/avc
07-20 15:37:04.107 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unrecognized level 0 for video/avc
07-20 15:37:04.107 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unrecognized profile 0 for video/avc
07-20 15:37:04.107 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unrecognized level 0 for video/avc
07-20 15:37:04.107 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unrecognized profile 0 for video/avc
07-20 15:37:04.107 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unrecognized level 0 for video/avc
07-20 15:37:04.107 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unrecognized profile 0 for video/avc
07-20 15:37:04.107 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unrecognized level 0 for video/avc
07-20 15:37:04.107 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unrecognized profile 0 for video/avc
07-20 15:37:04.109 24299-24299/com.pedro.rtpstreamer I/VideoCapabilities: Unsupported profile 16384 for video/mp4v-es
07-20 15:37:04.110 24299-24299/com.pedro.rtpstreamer I/VideoCapabilities: Unsupported profile 16384 for video/mp4v-es
07-20 15:37:04.116 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unsupported mime video/x-pn-realvideo
07-20 15:37:04.121 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unsupported mime video/mpeg
07-20 15:37:04.122 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unrecognized profile/level 0/0 for video/mpeg2
07-20 15:37:04.122 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unrecognized profile/level 0/2 for video/mpeg2
07-20 15:37:04.122 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unrecognized profile/level 0/3 for video/mpeg2
07-20 15:37:04.125 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unrecognized profile/level 32768/2 for video/mp4v-es
07-20 15:37:04.129 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unsupported mime video/vc1
07-20 15:37:04.134 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unsupported mime video/x-flv
07-20 15:37:04.136 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unrecognized profile/level 0/0 for video/mpeg2
07-20 15:37:04.136 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unrecognized profile/level 0/2 for video/mpeg2
07-20 15:37:04.136 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unrecognized profile/level 0/3 for video/mpeg2
07-20 15:37:04.153 24299-24299/com.pedro.rtpstreamer I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
07-20 15:37:04.162 24299-24299/com.pedro.rtpstreamer I/VideoEncoder: VideoEncoder OMX.IMG.TOPAZ.VIDEO.Encoder
07-20 15:37:04.162 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unsupported profile 64 for video/avc
07-20 15:37:04.162 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unsupported profile 64 for video/avc
07-20 15:37:04.162 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unsupported profile 64 for video/avc
07-20 15:37:04.162 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unsupported profile 64 for video/avc
07-20 15:37:04.162 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unsupported profile 64 for video/avc
07-20 15:37:04.162 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unsupported profile 64 for video/avc
07-20 15:37:04.162 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unrecognized level 0 for video/avc
07-20 15:37:04.162 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unrecognized profile 0 for video/avc
07-20 15:37:04.162 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unrecognized level 0 for video/avc
07-20 15:37:04.162 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unrecognized profile 0 for video/avc
07-20 15:37:04.162 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unrecognized level 0 for video/avc
07-20 15:37:04.162 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unrecognized profile 0 for video/avc
07-20 15:37:04.162 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unrecognized level 0 for video/avc
07-20 15:37:04.162 24299-24299/com.pedro.rtpstreamer W/VideoCapabilities: Unrecognized profile 0 for video/avc
07-20 15:37:04.164 24299-24299/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 2135033992
07-20 15:37:04.164 24299-24299/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 20
07-20 15:37:04.164 24299-24299/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 21
07-20 15:37:04.164 24299-24299/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 2130706433
07-20 15:37:04.164 24299-24299/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 19
07-20 15:37:04.164 24299-24299/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 2130706437
07-20 15:37:04.164 24299-24299/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 39
07-20 15:37:04.164 24299-24299/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 2130706434
07-20 15:37:04.164 24299-24299/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 2130706438
07-20 15:37:04.164 24299-24299/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 23
07-20 15:37:04.164 24299-24299/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 24
07-20 15:37:04.164 24299-24299/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 2130706449
07-20 15:37:04.164 24299-24299/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 22
07-20 15:37:04.164 24299-24299/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 2130706439
07-20 15:37:04.164 24299-24299/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 2130706440
07-20 15:37:04.165 24299-24299/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 25
07-20 15:37:04.165 24299-24299/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 26
07-20 15:37:04.165 24299-24299/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 27
07-20 15:37:04.165 24299-24299/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 28
07-20 15:37:04.165 24299-24299/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 2130706435
07-20 15:37:04.165 24299-24299/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 2130706441
07-20 15:37:04.165 24299-24299/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 2130706444
07-20 15:37:04.165 24299-24299/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 2130706450
07-20 15:37:04.165 24299-24299/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 2130706442
07-20 15:37:04.165 24299-24299/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 2130706443
07-20 15:37:04.165 24299-24299/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 2130708361
07-20 15:37:04.169 24299-24763/com.pedro.rtpstreamer I/OMXClient: Using client-side OMX mux.
07-20 15:37:04.178 24299-24299/com.pedro.rtpstreamer I/VideoEncoder: Prepare video info: SURFACE, 480x640
07-20 15:37:04.180 24299-24763/com.pedro.rtpstreamer W/ACodec: do not know color format 0x7f000001 = 2130706433
07-20 15:37:04.181 24299-24763/com.pedro.rtpstreamer W/ACodec: do not know color format 0x7f000005 = 2130706437
07-20 15:37:04.182 24299-24763/com.pedro.rtpstreamer W/ACodec: do not know color format 0x7f000002 = 2130706434
07-20 15:37:04.182 24299-24763/com.pedro.rtpstreamer W/ACodec: do not know color format 0x7f000006 = 2130706438
07-20 15:37:04.183 24299-24763/com.pedro.rtpstreamer W/ACodec: do not know color format 0x17 = 23
07-20 15:37:04.183 24299-24763/com.pedro.rtpstreamer W/ACodec: do not know color format 0x18 = 24
07-20 15:37:04.184 24299-24763/com.pedro.rtpstreamer W/ACodec: do not know color format 0x7f000011 = 2130706449
07-20 15:37:04.184 24299-24763/com.pedro.rtpstreamer W/ACodec: do not know color format 0x16 = 22
07-20 15:37:04.185 24299-24763/com.pedro.rtpstreamer W/ACodec: do not know color format 0x7f000007 = 2130706439
07-20 15:37:04.185 24299-24763/com.pedro.rtpstreamer W/ACodec: do not know color format 0x7f000008 = 2130706440
07-20 15:37:04.186 24299-24763/com.pedro.rtpstreamer W/ACodec: do not know color format 0x19 = 25
07-20 15:37:04.186 24299-24763/com.pedro.rtpstreamer W/ACodec: do not know color format 0x1a = 26
07-20 15:37:04.187 24299-24763/com.pedro.rtpstreamer W/ACodec: do not know color format 0x1b = 27
07-20 15:37:04.187 24299-24763/com.pedro.rtpstreamer W/ACodec: do not know color format 0x1c = 28
07-20 15:37:04.188 24299-24763/com.pedro.rtpstreamer W/ACodec: do not know color format 0x7f000003 = 2130706435
07-20 15:37:04.188 24299-24763/com.pedro.rtpstreamer W/ACodec: do not know color format 0x7f000009 = 2130706441
07-20 15:37:04.189 24299-24763/com.pedro.rtpstreamer W/ACodec: do not know color format 0x7f00000c = 2130706444
07-20 15:37:04.189 24299-24763/com.pedro.rtpstreamer W/ACodec: do not know color format 0x7f000012 = 2130706450
07-20 15:37:04.190 24299-24763/com.pedro.rtpstreamer W/ACodec: do not know color format 0x7f00000a = 2130706442
07-20 15:37:04.190 24299-24763/com.pedro.rtpstreamer W/ACodec: do not know color format 0x7f00000b = 2130706443
07-20 15:37:04.191 24299-24763/com.pedro.rtpstreamer W/ACodec: do not know color format 0x7f000789 = 2130708361
07-20 15:37:04.192 24299-24763/com.pedro.rtpstreamer I/ACodec: setupVideoEncoder succeeded
07-20 15:37:04.193 24299-24763/com.pedro.rtpstreamer W/ACodec: do not know color format 0x7f000789 = 2130708361
07-20 15:37:04.198 24299-24299/com.pedro.rtpstreamer I/VideoEncoder: prepared
07-20 15:37:04.208 24299-24299/com.pedro.rtpstreamer I/FFMPEGExtractor: Users across the process calls!
07-20 15:37:04.212 24299-24299/com.pedro.rtpstreamer I/Utils: vstride = 0,vsliceHeight = 0
07-20 15:37:04.216 24299-24767/com.pedro.rtpstreamer I/OMXClient: Using client-side OMX mux.
07-20 15:37:04.224 24299-24299/com.pedro.rtpstreamer I/AudioEncoder: prepared
07-20 15:37:04.227 24299-24770/com.pedro.rtpstreamer I/OMXClient: Using client-side OMX mux.
07-20 15:37:04.237 24299-24762/com.pedro.rtpstreamer I/MediaCodec: MediaCodec will operate in async mode
07-20 15:37:04.268 24299-24299/com.pedro.rtpstreamer I/VideoEncoder: started
07-20 15:37:04.272 24299-24773/com.pedro.rtpstreamer I/SrsFlvMuxer: flv: h264 sps/pps sent, sps=33B, pps=4B
07-20 15:37:04.274 24299-24299/com.pedro.rtpstreamer I/AudioEncoder: started
07-20 15:37:04.276 24299-24779/com.pedro.rtpstreamer I/OMXClient: Using client-side OMX mux.
07-20 15:37:04.281 24299-24778/com.pedro.rtpstreamer I/MediaCodec: [OMX.IMG.MSVDX.Decoder.AVC] setting surface generation to 24882177
07-20 15:37:04.282 24299-24779/com.pedro.rtpstreamer I/HwExtendedCodec: mime is [video/avc] at setVideoFormat
07-20 15:37:04.318 24299-24786/com.pedro.rtpstreamer I/SrsFlvMuxer: worker: connecting to RTMP server by url=rtmp://172.20.62.134:1935/live/a
07-20 15:37:04.321 24299-24786/com.pedro.rtpstreamer I/System: core_booster, getBoosterConfig = false
07-20 15:37:04.416 24299-24790/com.pedro.rtpstreamer I/RtmpConnection: handleRxInvoke: Got result for invoked method: connect
07-20 15:37:04.459 24299-24790/com.pedro.rtpstreamer I/RtmpConnection: handleRxInvoke: Got result for invoked method: createStream
07-20 15:37:04.471 24299-24786/com.pedro.rtpstreamer I/System.out: frame is not null 
07-20 15:37:04.471 24299-24786/com.pedro.rtpstreamer I/SrsFlvMuxer: worker: send frame type=9, dts=35, size=131072B
07-20 15:37:04.603 24299-24763/com.pedro.rtpstreamer E/ACodec: [OMX.IMG.TOPAZ.VIDEO.Encoder] ERROR(0x80001019)
07-20 15:37:04.603 24299-24763/com.pedro.rtpstreamer E/ACodec: signalError(omxError 0x80001019, internalError -2147483648)
07-20 15:37:04.603 24299-24762/com.pedro.rtpstreamer E/MediaCodec: Codec reported err 0x80001019, actionCode 0, while in state 6
07-20 15:37:04.604 24299-24773/com.pedro.rtpstreamer E/VideoEncoder: Error
    android.media.MediaCodec$CodecException: Error 0x80001019
pedroSG94 commented 4 years ago

This is the real error:

 24299-24763/com.pedro.rtpstreamer E/ACodec: [OMX.IMG.TOPAZ.VIDEO.Encoder] ERROR(0x80001019)
07-20 15:37:04.603 24299-24763/com.pedro.rtpstreamer E/ACodec: signalError(omxError 0x80001019, internalError -2147483648)
07-20 15:37:04.603 24299-24762/com.pedro.rtpstreamer E/MediaCodec: Codec reported err 0x80001019, actionCode 0, while in state 6
07-20 15:37:04.604 24299-24773/com.pedro.rtpstreamer E/VideoEncoder: Error
    android.media.MediaCodec$CodecException: Error 0x80001019

Do you have this error in fromfile mode only? Can you check if you can see this line in logcat using opengl example?

I/VideoEncoder: VideoEncoder OMX.IMG.TOPAZ.VIDEO.Encoder
yurensmile commented 4 years ago

Yes, in fomefile mode, that isthe whole error log. In opengl example, everything is work normally.

Besides, In another phone, Android 9(MIUI 12 20.6.18), everything is ok.

pedroSG94 commented 4 years ago

I was looking a way to reproduce this error but I can't do it. Can you tell me device model?

For now, try use FromFile constructor with context: https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/blob/master/rtplibrary/src/main/java/com/pedro/rtplibrary/base/FromFileBase.java#L77 After that, if the error persist, try with software encoder to discard problems with that encoder:

//before prepareVideo(...);
rtmpFromFile.setForce(CodecUtil.Force.SOFTWARE, CodecUtil.Force.FIRST_COMPATIBLE_FOUND);
yurensmile commented 4 years ago

The device model is HUAWEI GRA-UL10.

I'm not sure what's your meaning of "try use From File constructor with context",

I just add this line:

rtmpFromFile.setForce(CodecUtil.Force.SOFTWARE, CodecUtil.Force.FIRST_COMPATIBLE_FOUND);

after this line: https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/blob/master/app/src/main/java/com/pedro/rtpstreamer/filestreamexample/RtmpFromFileActivity.java#L70

it also generates error log:

07-25 16:42:38.042 10707-11290/com.pedro.rtpstreamer E/ACodec: [OMX.google.h264.encoder] ERROR(0x80001001)
07-25 16:42:38.042 10707-11290/com.pedro.rtpstreamer E/ACodec: signalError(omxError 0x80001001, internalError -2147483648)
07-25 16:42:38.042 10707-11290/com.pedro.rtpstreamer E/ACodec: [OMX.google.h264.encoder] ERROR(0x80001001)
07-25 16:42:38.042 10707-11290/com.pedro.rtpstreamer E/ACodec: signalError(omxError 0x80001001, internalError -2147483648)
07-25 16:42:38.042 10707-11289/com.pedro.rtpstreamer E/MediaCodec: Codec reported err 0x80001001, actionCode 0, while in state 6
07-25 16:42:38.042 10707-11289/com.pedro.rtpstreamer E/MediaCodec: Codec reported err 0x80001001, actionCode 0, while in state 0
07-25 16:42:38.044 10707-11299/com.pedro.rtpstreamer E/VideoEncoder: Error
    android.media.MediaCodec$CodecException: Error 0x80001001
pedroSG94 commented 4 years ago

I means this constructor: https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/blob/master/rtplibrary/src/main/java/com/pedro/rtplibrary/rtmp/RtmpFromFile.java#L36 I was few days doing tests but I can't find a way to reproduce that error.

For now, I will mark this as bug and try reproduce it.

yurensmile commented 4 years ago

Sorry, it's so long to reply you. It's so great that when i use that constfhaaructor, it can work. Thank you so much. the solution is: I change this line: https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/blob/master/app/src/main/java/com/pedro/rtpstreamer/filestreamexample/RtmpFromFileActivity.java#L70 TO:

 rtmpFromFile = new RtmpFromFile(getApplicationContext(), this, this, this);