nginx-rtmp-module icon indicating copy to clipboard operation
nginx-rtmp-module copied to clipboard

push to telegram not work

Open makapoh opened this issue 3 years ago • 2 comments

Hi! Telegram is use RTMPS, that's why i setup stunnel streaming to stunnel port works fine, but when i stream to nginx, push not work. On same config push to facebook works fine

nginx.conf

application tgtest { live on; record off; push rtmp://127.0.0.1:19350/s/; } application fbtest { live on; record off; push rtmp://127.0.0.1:19351/rtmp/; }

stunnel.conf

[fb-live] client = yes accept = 127.0.0.1:19351 connect = live-api-s.facebook.com:443 verifyChain = no [tg-live] client = yes accept = 127.0.0.1:19350 connect = dc4-1.rtmp.t.me:443 verifyChain = no

stunnel.log

2022.06.14 18:32:55 LOG7[main]: Found 1 ready file descriptor(s) 2022.06.14 18:32:55 LOG7[main]: FD=4 events=0x2001 revents=0x0 2022.06.14 18:32:55 LOG7[main]: FD=9 events=0x2001 revents=0x0 2022.06.14 18:32:55 LOG7[main]: FD=10 events=0x2001 revents=0x1 2022.06.14 18:32:55 LOG7[main]: Service [tg-live] accepted (FD=3) from 127.0.0.1:43576 2022.06.14 18:32:55 LOG7[3]: Service [tg-live] started 2022.06.14 18:32:55 LOG7[3]: Setting local socket options (FD=3) 2022.06.14 18:32:55 LOG7[3]: Option TCP_NODELAY set on local socket 2022.06.14 18:32:55 LOG5[3]: Service [tg-live] accepted connection from 127.0.0.1:43576 2022.06.14 18:32:55 LOG6[3]: s_connect: connecting 91.108.9.3:443 2022.06.14 18:32:55 LOG7[3]: s_connect: s_poll_wait 91.108.9.3:443: waiting 10 seconds 2022.06.14 18:32:55 LOG7[3]: FD=6 events=0x2001 revents=0x0 2022.06.14 18:32:55 LOG7[3]: FD=12 events=0x2005 revents=0x0 2022.06.14 18:32:56 LOG5[3]: s_connect: connected 91.108.9.3:443 2022.06.14 18:32:56 LOG5[3]: Service [tg-live] connected remote server from ip:56522 2022.06.14 18:32:56 LOG7[3]: Setting remote socket options (FD=12) 2022.06.14 18:32:56 LOG7[3]: Option TCP_NODELAY set on remote socket 2022.06.14 18:32:56 LOG7[3]: Remote descriptor (FD=12) initialized 2022.06.14 18:32:56 LOG6[3]: SNI: sending servername: dc4-1.rtmp.t.me 2022.06.14 18:32:56 LOG6[3]: Peer certificate not required 2022.06.14 18:32:56 LOG7[3]: TLS state (connect): before SSL initialization 2022.06.14 18:32:56 LOG7[3]: TLS state (connect): SSLv3/TLS write client hello 2022.06.14 18:32:56 LOG7[3]: TLS state (connect): SSLv3/TLS write client hello 2022.06.14 18:32:56 LOG7[3]: TLS state (connect): SSLv3/TLS read server hello 2022.06.14 18:32:56 LOG7[3]: TLS state (connect): TLSv1.3 read encrypted extensions 2022.06.14 18:32:56 LOG7[3]: TLS state (connect): SSLv3/TLS read finished 2022.06.14 18:32:56 LOG7[3]: TLS state (connect): SSLv3/TLS write change cipher spec 2022.06.14 18:32:56 LOG7[3]: TLS state (connect): SSLv3/TLS write finished 2022.06.14 18:32:56 LOG7[3]: Remove session callback 2022.06.14 18:32:56 LOG7[3]: 2 client connect(s) requested 2022.06.14 18:32:56 LOG7[3]: 2 client connect(s) succeeded 2022.06.14 18:32:56 LOG7[3]: 0 client renegotiation(s) requested 2022.06.14 18:32:56 LOG7[3]: 1 session reuse(s) 2022.06.14 18:32:56 LOG6[3]: TLS connected: previous session reused 2022.06.14 18:32:56 LOG6[3]: TLSv1.3 ciphersuite: TLS_CHACHA20_POLY1305_SHA256 (256-bit encryption) 2022.06.14 18:32:56 LOG7[3]: Compression: null, expansion: null 2022.06.14 18:32:56 LOG6[3]: Session id: 097CBC47B22A0558C829BF89D88322D126A954B5871F3C5DE5849D9C46B6DD45 2022.06.14 18:32:56 LOG7[3]: TLS state (connect): SSL negotiation finished successfully 2022.06.14 18:32:56 LOG7[3]: TLS state (connect): SSL negotiation finished successfully 2022.06.14 18:32:56 LOG7[3]: New session callback 2022.06.14 18:32:56 LOG7[3]: Deallocating application specific data for session connect address 2022.06.14 18:32:56 LOG6[3]: Session id: BEAF38D3AEE110A4E0216C4644F4986C67FC27CED7C83C4D85EE526DF4E73D30 2022.06.14 18:32:56 LOG7[3]: TLS state (connect): SSLv3/TLS read server session ticket 2022.06.14 18:35:17 LOG6[3]: Read socket closed (readsocket) 2022.06.14 18:35:17 LOG7[3]: Sending close_notify alert 2022.06.14 18:35:17 LOG7[3]: TLS alert (write): warning: close notify 2022.06.14 18:35:17 LOG6[3]: SSL_shutdown successfully sent close_notify alert 2022.06.14 18:35:17 LOG6[3]: TLS socket closed (SSL_read) 2022.06.14 18:35:17 LOG7[3]: Sent socket write shutdown 2022.06.14 18:35:17 LOG5[3]: Connection closed: 13592684 byte(s) sent to TLS, 4010 byte(s) sent to socket 2022.06.14 18:35:17 LOG7[3]: Remote descriptor (FD=12) closed 2022.06.14 18:35:17 LOG7[3]: Local descriptor (FD=3) closed 2022.06.14 18:35:17 LOG7[3]: Service [tg-live] finished (0 left)

makapoh avatar Jun 14 '22 14:06 makapoh

solution:

application live { live on; record off; exec_push /usr/bin/ffmpeg -analyzeduration 0 -i rtmp://127.0.0.1/live/$name -c copy -pix_fmt yuv420p -f flv rtmp://127.0.0.1:19350/s/key; }

makapoh avatar Jun 15 '22 05:06 makapoh

solution:

application live { live on; record off; exec_push /usr/bin/ffmpeg -analyzeduration 0 -i rtmp://127.0.0.1/live/$name -c copy -pix_fmt yuv420p -f flv rtmp://127.0.0.1:19350/s/key; }

Thanks!

MrTime avatar Jul 11 '22 19:07 MrTime