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.54k stars 772 forks source link

Stream to AfreecaTV failed #941

Closed zhaoyong1989 closed 7 months ago

zhaoyong1989 commented 3 years ago

AfreecaTV is RTMP protocol, connect server successfully but send packet failed.

09-18 10:28:46.422 2808 4229 E RtmpSender: send error: 09-18 10:28:46.422 2808 4229 E RtmpSender: java.net.SocketException: Broken pipe 09-18 10:28:46.422 2808 4229 E RtmpSender: at java.net.SocketOutputStream.socketWrite0(Native Method) 09-18 10:28:46.422 2808 4229 E RtmpSender: at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:117) 09-18 10:28:46.422 2808 4229 E RtmpSender: at java.net.SocketOutputStream.write(SocketOutputStream.java:140) 09-18 10:28:46.422 2808 4229 E RtmpSender: at com.pedro.rtmp.rtmp.message.RtmpHeader.writeHeader(RtmpHeader.kt:105) 09-18 10:28:46.422 2808 4229 E RtmpSender: at com.pedro.rtmp.rtmp.message.RtmpHeader.writeHeader(RtmpHeader.kt:96) 09-18 10:28:46.422 2808 4229 E RtmpSender: at com.pedro.rtmp.rtmp.message.RtmpMessage.writeHeader(RtmpMessage.kt:106) 09-18 10:28:46.422 2808 4229 E RtmpSender: at com.pedro.rtmp.rtmp.CommandsManager.sendVideoPacket(CommandsManager.kt:212) 09-18 10:28:46.422 2808 4229 E RtmpSender: at com.pedro.rtmp.rtmp.RtmpSender.start$lambda-2(RtmpSender.kt:100) 09-18 10:28:46.422 2808 4229 E RtmpSender: at com.pedro.rtmp.rtmp.RtmpSender.$r8$lambda$RWpSSbIll9sp_byGoOkFIfDGBxg(Unknown Source:0) 09-18 10:28:46.422 2808 4229 E RtmpSender: at com.pedro.rtmp.rtmp.RtmpSender$$ExternalSyntheticLambda0.run(Unknown Source:2) 09-18 10:28:46.422 2808 4229 E RtmpSender: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 09-18 10:28:46.422 2808 4229 E RtmpSender: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 09-18 10:28:46.422 2808 4229 E RtmpSender: at java.lang.Thread.run(Thread.java:923) 09-18 10:28:46.422 2808 4212 I ACodec_roi: + setRoiParameters 239 09-18 10:28:46.422 2808 4212 I ACodec_roi: - setRoiParameters 245 09-18 10:28:46.423 1002 3048 I VpuStream: VpuStream(3048)[deque] [vpu] algo_ref_12/0xb400006f67dfc808/4625, occupied core_index 0x87/0x1, sts(0), qos(15171385/1) 09-18 10:28:46.425 2808 4231 E RtmpClient: disconnect error 09-18 10:28:46.425 2808 4231 E RtmpClient: java.net.SocketException: Broken pipe 09-18 10:28:46.425 2808 4231 E RtmpClient: at java.net.SocketOutputStream.socketWrite0(Native Method) 09-18 10:28:46.425 2808 4231 E RtmpClient: at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:117) 09-18 10:28:46.425 2808 4231 E RtmpClient: at java.net.SocketOutputStream.write(SocketOutputStream.java:140) 09-18 10:28:46.425 2808 4231 E RtmpClient: at com.pedro.rtmp.rtmp.message.RtmpHeader.writeHeader(RtmpHeader.kt:105) 09-18 10:28:46.425 2808 4231 E RtmpClient: at com.pedro.rtmp.rtmp.message.RtmpHeader.writeHeader(RtmpHeader.kt:96) 09-18 10:28:46.425 2808 4231 E RtmpClient: at com.pedro.rtmp.rtmp.message.RtmpMessage.writeHeader(RtmpMessage.kt:106) 09-18 10:28:46.425 2808 4231 E RtmpClient: at com.pedro.rtmp.rtmp.CommandsManager.sendClose(CommandsManager.kt:199) 09-18 10:28:46.425 2808 4231 E RtmpClient: at com.pedro.rtmp.rtmp.RtmpClient.disconnect$lambda-5(RtmpClient.kt:411) 09-18 10:28:46.425 2808 4231 E RtmpClient: at com.pedro.rtmp.rtmp.RtmpClient.$r8$lambda$L6f1XZSd9tdbDvwE21RqUPtnFoA(Unknown Source:0) 09-18 10:28:46.425 2808 4231 E RtmpClient: at com.pedro.rtmp.rtmp.RtmpClient$$ExternalSyntheticLambda1.run(Unknown Source:2) 09-18 10:28:46.425 2808 4231 E RtmpClient: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 09-18 10:28:46.425 2808 4231 E RtmpClient: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 09-18 10:28:46.425 2808 4231 E RtmpClient: at java.lang.Thread.run(Thread.java:92 stream_log.txt 3

pedroSG94 commented 3 years ago

Hello,

This seems that server close connection. I was testing it but it fail using ffmpeg so this seems a problem with server side: gimpphoto

As you can see stream start but server close connection.

zhaoyong1989 commented 3 years ago

Thanks for your reply! Server did close connection from the log. But it is weird, PC OBS and iOS LFLiveKit stream successfully using same RTMP url.

pedroSG94 commented 3 years ago

Yes, it is really weird. I can't figure the reason about it. I tested the following:

But no luck for now, do you have any idea? I can discard a problem in the protocol in my side since ffmpeg get exactly same error that my library so I think this is related with a configuration not supported by AfreecaTV but I can't find anything in the web.

Could be possible notify the problem to AfreecaTV with a ticket to know the reason?. The web is in Korean so I suppose that support is in the same language and I don't know this language, so I would be happy if you could do it for me.

zhaoyong1989 commented 3 years ago

I tried to contact with afreecatv engineer on afreecatv developer website, unfortunately failed.

First, registration is required before clicking "contact us" button, but registration button is disable even if fill in information. Then i wrote a email to them, but mail receipt told me the email address is not exist.

I have no idea how to contact with their engineer

pedroSG94 commented 3 years ago

I will try do it by this way but it is difficult to receive a technics response because I think it is for common users: https://ghelp.afreecatv.com/index.php?pt=question

Also, we can ask about the problem to open a developer account.

For now, I will freeze this issue until we get more info. Continue with blind tests without any idea of the problem is not a good idea.

pedroSG94 commented 3 years ago

No reponse form AfreecaTV marked as help wanted

pedroSG94 commented 7 months ago

Closing as inactive. Open other issue if needed