Closed silveryTitan closed 3 years ago
During further debugging, it was found that the writeHeader method under the commandsManager.createStream(writer) method reported an error. What caused this??
I need more info. Share me a full logcat to know which command fail and let me know server used and configuration of that server
My rtmp website is rtmp://u.yuezangbao.com/live. in China
I don’t know what information you need, so I copied everything from clicking the "start stream" button to reporting the error. Please take a look.
2021-11-12 15:51:45.324 18148-18148/com.pedro.rtpstreamer D/AudioRecord: set(): inputSource 0, sampleRate 32000, format 0x1, channelMask 0xc, frameCount 6400, notificationFrames 0, sessionId 0, transferType 0, flags 0, opPackageName com.pedro.rtpstreamer uid -1, pid -1 2021-11-12 15:51:45.336 18148-18148/com.pedro.rtpstreamer I/MicrophoneManager: Microphone created, 32000hz, Stereo 2021-11-12 15:51:45.337 18148-18148/com.pedro.rtpstreamer I/AudioEncoder: 1 encoders found 2021-11-12 15:51:45.337 18148-18148/com.pedro.rtpstreamer I/AudioEncoder: Encoder OMX.google.aac.encoder 2021-11-12 15:51:45.337 18148-18148/com.pedro.rtpstreamer I/AudioEncoder: Encoder selected OMX.google.aac.encoder 2021-11-12 15:51:45.344 18148-19768/com.pedro.rtpstreamer I/OMXClient: IOmx service obtained 2021-11-12 15:51:45.352 18148-19768/com.pedro.rtpstreamer W/ExtendedACodec: Failed to get extension for extradata parameter 2021-11-12 15:51:45.352 18148-18148/com.pedro.rtpstreamer I/AudioEncoder: prepared 2021-11-12 15:51:45.354 18148-18148/com.pedro.rtpstreamer I/VideoEncoder: 2 encoders found 2021-11-12 15:51:45.354 18148-18148/com.pedro.rtpstreamer I/VideoEncoder: Encoder OMX.qcom.video.encoder.avc 2021-11-12 15:51:45.354 18148-18148/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 2141391878 2021-11-12 15:51:45.354 18148-18148/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 2141391876 2021-11-12 15:51:45.354 18148-18148/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 2141391872 2021-11-12 15:51:45.354 18148-18148/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 2141391881 2021-11-12 15:51:45.354 18148-18148/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 2141391882 2021-11-12 15:51:45.354 18148-18148/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 2141391880 2021-11-12 15:51:45.354 18148-18148/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 2141391879 2021-11-12 15:51:45.355 18148-18148/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 2130708361 2021-11-12 15:51:45.355 18148-18148/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 2135033992 2021-11-12 15:51:45.355 18148-18148/com.pedro.rtpstreamer I/VideoEncoder: Color supported: 21 2021-11-12 15:51:45.355 18148-18148/com.pedro.rtpstreamer I/VideoEncoder: Encoder selected OMX.qcom.video.encoder.avc 2021-11-12 15:51:45.363 18148-19772/com.pedro.rtpstreamer I/OMXClient: IOmx service obtained 2021-11-12 15:51:45.376 18148-18148/com.pedro.rtpstreamer I/VideoEncoder: Prepare video info: YUV420SEMIPLANAR, 480x640 2021-11-12 15:51:45.377 18148-18148/com.pedro.rtpstreamer I/VideoEncoder: bitrate mode CBR not supported using default mode 2021-11-12 15:51:45.378 18148-19772/com.pedro.rtpstreamer I/ExtendedACodec: setupVideoEncoder() 2021-11-12 15:51:45.379 18148-19772/com.pedro.rtpstreamer W/OMXUtils: do not know color format 0x7fa30c06 = 2141391878 2021-11-12 15:51:45.380 18148-19772/com.pedro.rtpstreamer W/OMXUtils: do not know color format 0x7fa30c04 = 2141391876 2021-11-12 15:51:45.380 18148-19772/com.pedro.rtpstreamer W/OMXUtils: do not know color format 0x7fa30c00 = 2141391872 2021-11-12 15:51:45.380 18148-19772/com.pedro.rtpstreamer W/OMXUtils: do not know color format 0x7fa30c09 = 2141391881 2021-11-12 15:51:45.381 18148-19772/com.pedro.rtpstreamer W/OMXUtils: do not know color format 0x7fa30c0a = 2141391882 2021-11-12 15:51:45.381 18148-19772/com.pedro.rtpstreamer W/OMXUtils: do not know color format 0x7fa30c08 = 2141391880 2021-11-12 15:51:45.381 18148-19772/com.pedro.rtpstreamer W/OMXUtils: do not know color format 0x7fa30c07 = 2141391879 2021-11-12 15:51:45.382 18148-19772/com.pedro.rtpstreamer W/OMXUtils: do not know color format 0x7f000789 = 2130708361 2021-11-12 15:51:45.386 18148-19772/com.pedro.rtpstreamer I/ACodec: setupAVCEncoderParameters with [profile: Baseline] [level: Level1] 2021-11-12 15:51:45.387 18148-19772/com.pedro.rtpstreamer I/ACodec: [OMX.qcom.video.encoder.avc] cannot encode HDR static metadata. Ignoring. 2021-11-12 15:51:45.387 18148-19772/com.pedro.rtpstreamer I/ACodec: setupVideoEncoder succeeded 2021-11-12 15:51:45.387 18148-19772/com.pedro.rtpstreamer I/ExtendedACodec: [OMX.qcom.video.encoder.avc] configure, AMessage : AMessage(what = 'conf', target = 52) = { int32_t color-format = 21 int32_t i-frame-interval = 2 string mime = "video/avc" int32_t width = 480 int32_t bitrate = 1228800 int32_t max-input-size = 0 int32_t frame-rate = 30 int32_t height = 640 int32_t encoder = 1 } 2021-11-12 15:51:45.396 18148-18148/com.pedro.rtpstreamer I/VideoEncoder: prepared 2021-11-12 15:51:45.397 18148-18148/com.pedro.rtpstreamer I/VideoEncoder: started 2021-11-12 15:51:45.399 18148-19771/com.pedro.rtpstreamer I/MediaCodec: MediaCodec will operate in async mode 2021-11-12 15:51:45.417 18148-18148/com.pedro.rtpstreamer I/AudioEncoder: started 2021-11-12 15:51:45.419 18148-19768/com.pedro.rtpstreamer I/MediaCodec: MediaCodec will operate in async mode 2021-11-12 15:51:45.441 18148-18148/com.pedro.rtpstreamer I/MicrophoneManager: Microphone started 2021-11-12 15:51:45.445 18148-19780/com.pedro.rtpstreamer E/RtmpClient: establishConnection: NoSSL 2021-11-12 15:51:45.766 18148-19776/com.pedro.rtpstreamer I/RtmpClient: send sps and pps 2021-11-12 15:51:45.858 18148-19780/com.pedro.rtpstreamer I/Handshake: writing C0 2021-11-12 15:51:45.859 18148-19780/com.pedro.rtpstreamer I/Handshake: C0 write successful 2021-11-12 15:51:45.859 18148-19780/com.pedro.rtpstreamer I/Handshake: writing C1 2021-11-12 15:51:45.859 18148-19780/com.pedro.rtpstreamer I/Handshake: writing time 1636703505 to c1 2021-11-12 15:51:45.859 18148-19780/com.pedro.rtpstreamer I/Handshake: writing zero to c1 2021-11-12 15:51:45.859 18148-19780/com.pedro.rtpstreamer I/Handshake: writing random to c1 2021-11-12 15:51:45.861 18148-19780/com.pedro.rtpstreamer I/Handshake: C1 write successful 2021-11-12 15:51:45.861 18148-19780/com.pedro.rtpstreamer I/Handshake: reading S0 2021-11-12 15:51:45.927 18148-19780/com.pedro.rtpstreamer I/Handshake: read S0 successful 2021-11-12 15:51:45.927 18148-19780/com.pedro.rtpstreamer I/Handshake: reading S1 2021-11-12 15:51:45.927 18148-19780/com.pedro.rtpstreamer I/Handshake: read S1 successful 2021-11-12 15:51:45.927 18148-19780/com.pedro.rtpstreamer I/Handshake: writing C2 2021-11-12 15:51:45.927 18148-19780/com.pedro.rtpstreamer I/Handshake: C2 write successful 2021-11-12 15:51:45.927 18148-19780/com.pedro.rtpstreamer I/Handshake: reading S2 2021-11-12 15:51:45.928 18148-19780/com.pedro.rtpstreamer I/Handshake: read S2 successful 2021-11-12 15:51:45.928 18148-19780/com.pedro.rtpstreamer I/CommandsManager: using default write chunk size 128 2021-11-12 15:51:45.931 18148-19780/com.pedro.rtpstreamer I/CommandsManager: send Command(name='connect', transactionId=1, timeStamp=0, streamId=0, data=[AmfString value: connect, AmfNumber value: 1.0, AmfObject properties: {AmfString value: app=AmfString value: live, AmfString value: flashVer=AmfString value: FMLE/3.0 (compatible; Lavf57.56.101), AmfString value: swfUrl=AmfString value: , AmfString value: tcUrl=AmfString value: rtmp://u.yuezangbao.com/live, AmfString value: fpad=AmfBoolean value: false, AmfString value: capabilities=AmfNumber value: 239.0, AmfString value: pageUrl=AmfString value: , AmfString value: objectEncoding=AmfNumber value: 0.0}], bodySize=201) 2021-11-12 15:51:46.001 18148-19780/com.pedro.rtpstreamer I/CommandsManager: read WindowAcknowledgementSize(acknowledgementWindowSize=2500000) 2021-11-12 15:51:46.098 18148-19780/com.pedro.rtpstreamer I/CommandsManager: read SetPeerBandwidth(acknowledgementWindowSize=2500000, type=DYNAMIC) 2021-11-12 15:51:46.100 18148-19780/com.pedro.rtpstreamer I/CommandsManager: read SetChunkSize(chunkSize=60000) 2021-11-12 15:51:46.101 18148-19780/com.pedro.rtpstreamer I/RtmpClient: chunk size configured to 60000 2021-11-12 15:51:46.110 18148-19780/com.pedro.rtpstreamer I/CommandsManager: read Command(name='_result', transactionId=1, timeStamp=0, streamId=0, data=[AmfString value: _result, AmfNumber value: 1.0, AmfObject properties: {AmfString value: fmsVer=AmfString value: FMS/3,5,3,888, AmfString value: capabilities=AmfNumber value: 127.0, AmfString value: mode=AmfNumber value: 1.0}, AmfObject properties: {AmfString value: level=AmfString value: status, AmfString value: code=AmfString value: NetConnection.Connect.Success, AmfString value: description=AmfString value: Connection succeeded, AmfString value: objectEncoding=AmfNumber value: 0.0, AmfString value: data=AmfEcmaArray length: 0, properties: {AmfString value: version=AmfString value: 3,5,3,888, AmfString value: srs_sig=AmfString value: SRS, AmfString value: srs_server=AmfString value: SRS/4.0.76(Leo), AmfString value: srs_license=AmfString value: MIT, AmfString value: srs_url=AmfString value: https://github.com/ossrs/srs, AmfString value: srs_version=AmfString value: 4.0.76, AmfString value: srs_authors=AmfString value: Winlin,Wenjie,Runner365,John,B.P.Y,Lixin, AmfString value: srs_server_ip=AmfString value: 172.17.0.4, AmfString value: srs_pid=AmfNumber value: 1.0, AmfString value: srs_id=AmfString value: 5310m6sp}}], bodySize=486) 2021-11-12 15:51:46.111 18148-19780/com.pedro.rtpstreamer I/CommandsManager: send Command(name='releaseStream', transactionId=2, timeStamp=1, streamId=0, data=[AmfString value: releaseStream, AmfNumber value: 2.0, AmfNull, AmfString value: ], bodySize=29) 2021-11-12 15:51:46.114 18148-19780/com.pedro.rtpstreamer I/CommandsManager: send Command(name='FCPublish', transactionId=3, timeStamp=1, streamId=0, data=[AmfString value: FCPublish, AmfNumber value: 3.0, AmfNull, AmfString value: ], bodySize=25) 2021-11-12 15:51:46.115 18148-19780/com.pedro.rtpstreamer I/CommandsManager: send Command(name='createStream', transactionId=4, timeStamp=1, streamId=0, data=[AmfString value: createStream, AmfNumber value: 4.0, AmfNull], bodySize=25) 2021-11-12 15:51:46.115 18148-19780/com.pedro.rtpstreamer I/RtmpClient: success response received from connect 2021-11-12 15:51:46.117 18148-19780/com.pedro.rtpstreamer I/CommandsManager: read Command(name='onBWDone', transactionId=0, timeStamp=0, streamId=0, data=[AmfString value: onBWDone, AmfNumber value: 0.0, AmfNull], bodySize=21) 2021-11-12 15:51:46.117 18148-19780/com.pedro.rtpstreamer I/RtmpClient: unknown onBWDone response received from unknown command 2021-11-12 15:51:46.238 18148-19780/com.pedro.rtpstreamer I/CommandsManager: read Command(name='_result', transactionId=2, timeStamp=0, streamId=0, data=[AmfString value: _result, AmfNumber value: 2.0, AmfNull, AmfUndefined], bodySize=21) 2021-11-12 15:51:46.238 18148-19780/com.pedro.rtpstreamer I/RtmpClient: success response received from releaseStream 2021-11-12 15:51:46.240 18148-19780/com.pedro.rtpstreamer E/RtmpClient: connection error java.io.IOException: Unimplemented message type: null at com.pedro.rtmp.rtmp.message.RtmpMessage$Companion.getRtmpMessage(RtmpMessage.kt:68) at com.pedro.rtmp.rtmp.CommandsManager.readMessageResponse(CommandsManager.kt:167) at com.pedro.rtmp.rtmp.RtmpClient.handleMessages(RtmpClient.kt:295) at com.pedro.rtmp.rtmp.RtmpClient.connect$lambda-0(RtmpClient.kt:196) at com.pedro.rtmp.rtmp.RtmpClient.lambda$2Ex0pWOcGVHPFRJWQRhtgifpZyQ(Unknown Source:0) at com.pedro.rtmp.rtmp.-$$Lambda$RtmpClient$2Ex0pWOcGVHPFRJWQRhtgifpZyQ.run(Unknown Source:2) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:764)
The problem is the endpoint. You must specify the stream name. Instead of: rtmp://u.yuezangbao.com/live Use this (you can replace name for any string): rtmp://u.yuezangbao.com/live/name
Thank you, now can push the stream. It is recommended to add streaming function. thanks
It is recommended to add streaming function
What do you mean?
Hello, I use Demo's ExampleRempActivity class to test push streaming. But an IOException was reported.
E/RtmpClient: connection error java.io.IOException: Unimplemented message type: null at com.pedro.rtmp.rtmp.message.RtmpMessage$Companion.getRtmpMessage(RtmpMessage.kt:68) at com.pedro.rtmp.rtmp.CommandsManager.readMessageResponse(CommandsManager.kt:167) at com.pedro.rtmp.rtmp.RtmpClient.handleMessages(RtmpClient.kt:295) at com.pedro.rtmp.rtmp.RtmpClient.connect$lambda-0(RtmpClient.kt:196) at com.pedro.rtmp.rtmp.RtmpClient.lambda$2Ex0pWOcGVHPFRJWQRhtgifpZyQ(Unknown Source:0) at com.pedro.rtmp.rtmp.-$$Lambda$RtmpClient$2Ex0pWOcGVHPFRJWQRhtgifpZyQ.run(Unknown Source:2) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:764)