Re-Stream to Twitch, YouTube, etc - Self Hosted RTMP ( LINUX / DOCKER SERVER)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in today's video I'm gonna show you how to set up a docker nginx rtmp container to restream your stream to multiple services using Linux to start things off this video assumes that you have Linux Mint and docker installed on the computer you wish to handle rtmp streams if you don't meet these requirements don't worry I have a playlist in the video description that gives you step-by-step instructions on how to get here the first thing you're gonna want to do is go to the website hub docker comm and select explore now type in the search box ng I and X - rtmp and press Enter we want the first result as it's updated often and has the highest user rating click the result titled T Angulo / ng INX - rtmp once on this page scroll down to where it says how to use this is the installation command for this particular package highlight the command and select copy now open a terminal window right-click on the terminal window and paste the command press ENTER and docker will download it and start the container verify the container is running by typing in the following command docker space container space LS we can see that our new container has been running for about 6 seconds the next thing you're going to want to do is install a better text editor into your new container so let's login to the container and do that you can log into any container shell by typing in this command and using our container ID the command is docker space exe c space - IT the container ID space bash the container ID we need is right above the command line so highlight the nginx container ID right click and select copy next paste it at the end of our command line now finish up the command by typing space bas h then press Enter you can see that the command prompt has changed which means we are now inside the docker container what we want to do now is install the Nano text editor so we can adjust our rtmp settings to do that type the following commands apt - GE t space update and press Enter let it update anything it might need and continue on now we type the following command apt space install space nano that's na n o this should only take a few moments from here let's open up our nginx config file to do that type the following command nano space ford slash ET c /n g INX /n GI NX dot conf and press enter here we can see a bunch of configuration options most of which we won't be touching let's give ourselves a little working room use your arrow keys to move the cursor above the application live text and press enter' to bring it down a few lines now move the cursor below the closing curly bracket and do the same to give us some space below with our application live config having been spaced out we can start if you're only looking to stream to a single location and you're not looking to do local recording automatic record file management or transcoding you can simply use this config block alone for example here is how it would set up the config to stream to twitch first i would start a new line after where it says record off and type the following command push space rtmp colon slash slash live dot i ad dot twitch.tv slash app slash your stream key then i put a semicolon at the end now this may be enough for you and if it is you can save the config file and move on however I'm gonna suggest a way that I believe is better my method would allow much more flexibility in the future especially when it comes to local fire recording automatic FLV to mp4 conversion and full transcoding all of which will be covered in a future video to future-proof your config file do the following after the closing curly bracket we are going to create another config block to do this type application space live open curly braket new line live space on semicolon new line record space off semicolon new line and then the server you're actually streaming to which is probably twitch of course followed by a semicolon and then we finish it all off with a closing curly bracket oh but wait both applications are now named live we don't want that so let's fix the name of the second one to stream out next we go to the first one and edit the rtmp out setting 127.0.0.1 forward slash stream out what's happening with this config is the stream client streams to the server utilizing the live endpoint then the live endpoint fords that stream over to the stream out which actually sends the video to twitch and mixer and so on now I know some people may ask why would you add a step in the process by using - well to be honest generally speaking it's easier to manage because here's what you can do the first one could handle complex functions and the second one would be dedicated to feeding the streams to their desired locations alternatively let's say you wanted to set this up as a transcoding server where you actually encode your videos on the server now with my setup you have a choice here for local recording where you could record the incoming stream which may be at like 20,000 kilobits per second or the outgoing stream which could be at 4,000 kilobits per second you tell me what quality of stream would you like for local editing and youtube uploads the lower quality twitch stream or the high-resolution high bitrate copy my setup in the future will allow you to get the best quality copy by breaking apart the actual serving of the stream into two different processes but anyway as it stands now if you only need a rebroadcasting server by setting it up like this you'll be ready for later should your requirements change so set up your configuration file like this point your stream software to the live end point and you should be good just to cover it let's say you also wanted to add another stream location like you want to stream to twitch and mixer you would simply add a new push line right below our twitch push line like this push rtmp : / / mixer URL / your stream key semicolon and you'd be good to go it would stream to both of them add as many stream locations as your internet can handle and that's all the configuration you have to do when it comes to this setup now we're not gonna be streaming on the Internet we're gonna test this locally I do know for a fact this does work otherwise but what we're gonna do is we're gonna comment these to push lines out by putting hashtags in front of them this way the server isn't constantly trying to stream to an on location so now we'll save the file which can be done by holding down ctrl and pressing X on the keyboard the system will ask would you like to save the modified file select yes and now the system will ask you to confirm the file being overwritten press ENTER to confirm and you can close the terminal from here open a new terminal type in docker space container space LS to get your container ID now type in docker space restart and then the container ID which you can copy and paste from above press enter and now the new configuration settings should have taken effect now for testing the first thing we're going to do is get our IP address of the server and then we're going to open up OBS on our stream PC and configure it to stream through our nginx server to do that go to settings stream choose custom service type rtmp : / / the IP address of the server followed by /live click apply and ok now start a test stream and we can see from the status indicators in OBS that were successfully streaming to our server let's see what the test stream looks like via VLC so we'll open up VLC select media open network stream and type in the following rtmp : / / the IP address of the server / stream out and there you have it we can see that the server is indeed handling the rtmp stream correctly now that we know the server works we only have to configure a few remaining things on docker for example is the nginx server starting up with the computer I don't think it is so let's check it and fix it first let's do a quick restart back on the desktop open up terminal and type in the following command docker space container space LS and with that we can see that none of our containers are currently running a quick note here you can list all the containers in your system by typing in docker space PS - a to modify an existing container to auto restart with system restart type in the following command docker space update space - - restart equals o always spaced the container ID which will copy from above and press ENTER once that's done let's start the container by typing the following command docker space start space the container ID press Enter now let's check the status by typing in one more time docker space container space LS and press Enter and we can see nginx is running so let's do one more test and restart the computer back at the desktop open a terminal and type docker space container space LS and press ENTER and there it is nginx now auto starts with the computer and with that your server is basically set up aside for modifying the config files with your actual information you're good to go well guys those are the basics to make a Linux docker server based nginx multi-stream server hopefully this video has helped you and as always guys if you liked this video and want more like it do us a favor like comment and subscribe thanks for watching
Info
Channel: fixitfixitfixit
Views: 32,409
Rating: undefined out of 5
Keywords: fixitfixitfixit, streaming server, RTMP, NGINX, server, streaming, live stream, Linux, configure, tutorial, guide, docker, obs, twitch, twitch streaming server, rtmp server setup, rtmp server nginx, rtmp server obs, rtmp server mac, rtmp server for streaming, rtmp server ubuntu, rtmp server free, rtmp server, live streaming, 2 pc streaming setup without capture card, obs live stream tutorial, obs studio, obs studio tutorial, how to set up a rtmp server, how to make a private rtmp server
Id: EzmA8uksOG4
Channel Id: undefined
Length: 12min 35sec (755 seconds)
Published: Wed Apr 29 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.