2

I want to setup RTMPS and learned that only way around is by using nginx and stunnel. I have the setup and it works with just one configured key.

I have several different keys and all are dynamic. A lot of different urls too.

My Goal is to add a parameter or some way by which i can send the custom url to nginx and it can send to Stunnel, and it can read the custom url and forward the encrypted stream to that url.

I am able to get everything done right via ngnix and stunnel but with preconfigured key only - But i want Dynamic key here.. just like a parameter where you can simply plug and send the stream.

I even tried to set this way.

push rtmp://127.0.0.1:19350/rtmp/;

so i can simple forward the stream to rtmp://127.0.0.1:19350/rtmp/my-key and it takes my-key and forward the stream via stunnel to facebook. but i cannot get it work.

I am about to bang my heads in walls. Kindly give me some pointers.. I am not sure how to do it via ffmpeg as it says it cannot find rtmps protocol.

My Nginx Config:

# RTMP configuration
rtmp {
    server {
        listen 1935; # Listen on standard RTMP port
        chunk_size 4000;
 # This application is to accept incoming stream
        application live {


                live on; # Allows live input from above
                exec_push rtmp://127.0.0.1:19350/rtmp/$name;
                allow play 127.0.0.1;
                dash on;
                dash_path /var/tmp/dashme;

                hls on; # Enable HTTP Live Streaming
                hls_cleanup on;
                hls_sync 100ms;
                hls_fragment 2s;
                hls_path /var/tmp/live/;


        }

and My Stunnel Config:

setuid = nobody
setgid = nobody
pid=/tmp/stunnel.pid
output = /var/log/stunnel.log
;include = /etc/stunnel/conf.d

[fb-live]
client = yes
accept = 127.0.0.1:19350
connect = live-api-s.facebook.com:443
;verifyChain = no
Yogesh Agarwal
  • 631
  • 1
  • 6
  • 8

1 Answers1

0

You can't use the $name variable when pushing rtmp, you have to put in a persistent stream key

Jamie
  • 1