Giter VIP home page Giter VIP logo

Comments (4)

Noxalus avatar Noxalus commented on May 24, 2024

Hi @varnish97, what do you mean by private key? What kind of service do you want to use? What you just need is a RTMP URL that contains your key.

from multi-streaming-server.

varnish97 avatar varnish97 commented on May 24, 2024

I would like to assign a private key to each client, so as to provide a broadcast to every person.
Ie I'll explain:
privateKey1 - Youtube (User1), Twitch (User1), Hitbox (User1).
privateKey2 - Youtube (User2), Twitch (User2), Hitbox (User2).
etc....

How would you advise me to do?

from multi-streaming-server.

Noxalus avatar Noxalus commented on May 24, 2024

I didn't do anything like that myself, but if I properly understood what you want to achieve, you need to have a custom RTMP URL for each user. In this project, I use only one URL (rtmp://192.168.42.42:1935/live) which is referring to the live application from the Nginx configuration (here). So basically, what I do would be to create a new application in the Nginx conf for every user, something like this:

rtmp {
    server {
        listen 1935;
        chunk_size 8192;

        // Applications for User1

        application live-privateKey1 {
            live on;
            record off;
            
            allow publish {{ my_ip_address }};
            deny publish all;

            push rtmp://localhost/youtube-privateKey1/${name};

            exec ffmpeg -i rtmp://localhost/$app/$name -c:v libx264 -preset veryfast -c:a copy 
                -b:v 3500k 
                -bufsize 3500k
                -maxrate 3500k 
                -s 1280x720 -r 30
                -f flv rtmp://localhost/twitch-privateKey1/$name;

            push rtmp://localhost/dailymotion-privateKey1/${name};
            push rtmp://localhost/hitbox-privateKey1/${name};
        }
        
        application youtube-privateKey1 {
            live on;
            record off;
            
            allow publish 127.0.0.1;
            deny publish all;

            push rtmp://a.rtmp.youtube.com/live2/{{ youtube_key_user1 }};
        }

        application twitch-privateKey1 {
            live on;
            record off;
            
            allow publish 127.0.0.1;
            deny publish all;

            push rtmp://live-cdg.twitch.tv/app/{{ twitch_key_user1 }};
        }

        application dailymotion-privateKey1 {
            live on;
            record off;
            
            allow publish 127.0.0.1;
            deny publish all;

            push rtmp://publish.dailymotion.com/publish-dm/{{ dailymotion_key_user1 }};
        }

        application hitbox-privateKey1 {
            live on;
            record off;

            allow publish 127.0.0.1;
            deny publish all;

            push rtmp://live.hitbox.tv/push/{{ hitbox_key_user1 }};
        }

        // Applications for User2

        application live-privateKey2 {
            live on;
            record off;
            
            allow publish {{ my_ip_address }};
            deny publish all;

            push rtmp://localhost/youtube-privateKey2/${name};

            exec ffmpeg -i rtmp://localhost/$app/$name -c:v libx264 -preset veryfast -c:a copy 
                -b:v 3500k 
                -bufsize 3500k
                -maxrate 3500k 
                -s 1280x720 -r 30
                -f flv rtmp://localhost/twitch-privateKey2/$name;

            push rtmp://localhost/dailymotion-privateKey2/${name};
            push rtmp://localhost/hitbox-privateKey2/${name};
        }
        
        application youtube-privateKey2 {
            live on;
            record off;
            
            allow publish 127.0.0.1;
            deny publish all;

            push rtmp://a.rtmp.youtube.com/live2/{{ youtube_key_user2 }};
        }

        application twitch-privateKey2 {
            live on;
            record off;
            
            allow publish 127.0.0.1;
            deny publish all;

            push rtmp://live-cdg.twitch.tv/app/{{ twitch_key_user2 }};
        }

        application dailymotion-privateKey2 {
            live on;
            record off;
            
            allow publish 127.0.0.1;
            deny publish all;

            push rtmp://publish.dailymotion.com/publish-dm/{{ dailymotion_key_user2 }};
        }

        application hitbox-privateKey2 {
            live on;
            record off;

            allow publish 127.0.0.1;
            deny publish all;

            push rtmp://live.hitbox.tv/push/{{ hitbox_key_user2 }};
        }
    }
}

Then, you just have to send the stream on the corresponding RTMP URL depending on the user (rtmp://192.168.42.42:1935/live-privateKey1 for User1).

But I'm pretty sure there is a better way to do that. Please ask the same question on the Nginx RTMP module project (here), they might have a better answer to your problem.

from multi-streaming-server.

varnish97 avatar varnish97 commented on May 24, 2024

Thank you, great! I also had to rate Conceived in this way, Thank you very much

from multi-streaming-server.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.