sergey-dryabzhinsky / nginx-rtmp-module

NGINX-based Media Streaming Server
http://nginx-rtmp.blogspot.com
BSD 2-Clause "Simplified" License
1.02k stars 215 forks source link

Unable to restream to Telegram #350

Open mannyamorim opened 2 years ago

mannyamorim commented 2 years ago

We are able to use the NGINX RTMP module to re-stream to many public streaming services, using the push directive. This directive only allow pushing to RTMP targets and does not support RTMPS. If we use the NGINX SSL stream module to provide the SSL support we can easily work around this limitation (this approach as well as using Stunnel is quite prevalent). This workaround works for many platforms but fails for Telegram.

We have tested using the following configuration using OBS as the source client:

worker_processes  1;

error_log  xxxxx;

events {
    worker_connections  1024;
}

stream {
    server {
        listen 5000;

        proxy_pass dc1-1.rtmp.t.me:443;
        proxy_ssl on;
        proxy_ssl_protocols TLSv1.2 TLSv1.3;
        proxy_ssl_server_name on;
        proxy_ssl_verify on;
        proxy_ssl_verify_depth 5;
        proxy_ssl_trusted_certificate /etc/ssl/certs/ca-certificates.crt;
    }
}

rtmp {
    server {
            access_log xxxxx;

        listen 1935;

        application test {
            live on;
            push rtmp://127.0.0.1:5000/s/xxxxx;
        }
    }
}

There are no errors logged in the NGINX logs, in fact the logs show that the connection is established normally and the stream sent. On the Telegram application, no video is received. Note that when using FFMPEG or OBS to stream directly to Telegram, it works correctly.

makapoh commented 2 years ago

same problem with Telegram when push via stunnel, no video, but data sents to Telegram

kuznetcoff777 commented 2 years ago

@sergey-dryabzhinsky Hello! No updates yet?