Most content creators on YouTube, Facebook, Twitch, and other live streaming platforms face a common problem: how to do 24/7 live streaming without keeping their machine on. This guide provides a better solution for that. Not only for 24/7 live streaming, it helps you multi-stream at once to many platforms such as YouTube and Twitch. You can set any RTMP endpoint.
In the previous video of Minex, we showed you how to run a 24/7 live stream on a terminal. This is a well-organized server with a user interface. This live streaming server maintains an excellent connection with social media platforms. You can run your live stream smoothly and with minimal latency. Follow all the steps correctly until the end.
Setup VPS Server (Ubuntu)
You can create this server for free if you get a VPS. The best solution is the Oracle Cloud Platform free tier, but you can use any service provider. If you want a cheap VPS provider, check the article in the video description. Using any provider, deploy a virtual machine with Ubuntu 18.04 or 20.04, CentOS 7 or 8, or macOS Partial. This VPS should have at least 4GB RAM to run the live stream smoothly. You can install this server below this requirement and test how it performs.
Install Live Streaming Server
After you deploy the server, connect to it using SSH and get the terminal. You can use any SSH client you prefer. Get super user access by typing sudo su
, then update all applications currently installed on the server. All of the commands and guidelines used in this tutorial are well written in the article. I suggest you follow the article for a better understanding and new updates.
Next, go to the Ant Media Server GitHub Community Edition page and copy the link of the zip file that is the latest release of the app. Download it to the server using this command:
wget [zip file link]
Then, download the installation script as well:
wget [installation script link]
Give 755 permissions to the script file and make sure it is executable:
chmod 755 [script file]
Now, run the installation script. First, find the downloaded Ant Media file using this command:
ls
Copy the name of the zip file and paste it at the end of this command:
sudo ./install_ant-media-server.sh [zip file name]
This process takes a few minutes. Once the installation is finished, enter a command that changes IP iptables settings if you are using the Oracle Cloud. Enter this command:
sudo iptables -I INPUT -p tcp --dport 5080 -j ACCEPT
The installation process is over.
Setup Firewall Rules (Open Ports)
The next step is to add a few new ports to your server firewall to open them. This process can vary by service provider, but follow a similar sequence. Go to the firewall section of your server provider, add a new rule, and enter this IP range as the source IP address:
0.0.0.0/0
For the destination, enter these TCP ports:
5080, 1935, 5443, 8081
And these UDP ports:
5000-65000
Then, save the rules. All the port details are in the article; check them in the description.
Getting Started with Live Stream Server
You can enter the Ant Media Server user interface by typing your public IP address of the server at port 5080. When you enter the Ant Media Server for the first time, you have to create an admin account with credentials. Log into the application using the credentials you entered.
Ok, this is your dashboard where you can see your server status. Let’s see how you can use this application to start a live stream to multiple platforms. Choose one of the default applications or create a new application using the ‘New Application’ button at the bottom of the page.
After you navigate to the application, you have to create a new playlist for each streaming platform or multiple platforms. As a demo, I am going to stream to YouTube, Twitch, and Facebook at once with a pre-recorded video.
To create a new playlist, click the ‘New Live Stream’ button, and you will get a drop-down menu. Select ‘Playlist’, name it as you wish, and there is an option to loop the playlist. If you tick on this option, your playlist will loop an infinite number of times until you stop the process.
Upload Prerecorded Videos
You can use an external source to upload your media library or internally on the server. Ant Media Server gives you an option to upload the media files on the server. You just need to switch to the ‘VOD’ tab and upload the media file. Then, click ‘Upload VOD’ and browse your video file. Uploading time depends on the size of the file.
Ok, the file uploaded successfully. Next, you have to create a direct link to this media file. Click the embed icon of the video and paste the code into a notepad. Get the first part of the URL up to the app name, then add /streams/
at the end. Next, add the video ID and indicate the file format at last. After that, you can create a direct link to that file using this format:
http://your-ip:5080/[app-name]/streams/[video-id].[format]
Check the article for more information.
After creating your playlist, you need to add media to the playlist. Click the pencil icon at the right corner, and you can add a new playlist item as a URL. This URL should be a direct link to your media file; otherwise, it will not play. You can add more than one media file, which means you can set up a list of media files. It plays every media file, and if you set the loop option, it keeps on playing.
Create RTMP Endpoint URLs
Next, create an RTMP endpoint URL for each platform. They follow a similar format. I will show you an example from Facebook. Go to the live stream dashboard of your social media platform and get the stream server URL. At the end of the server URL, add the stream key. This is your RTMP endpoint URL. Let’s add the created stream address to Ant Media Server.
Click the drop-down menu at the right corner of the playlist, then select ‘Edit RTMP Endpoints’. Paste the created URL here. You can add more than one RTMP endpoint here, so I am going to add YouTube and Twitch URLs as well. Check the article for more details about the RTMP server URL build.
Start Multi-Platform Live Stream
Ok, it is finished. You just need to start your broadcast. Click the drop-down menu again next to the pencil icon and press ‘Start Broadcast’. Now it is on air. Let’s see how it works. You can see that Facebook streaming has started, as well as the YouTube streaming at the same time. Here, Twitch streamed the video. Using this self-hosting live stream server, you can run your 24/7 music streaming. There are many paid services, but this is very easy and you don’t need to spend too much money.
If you have any issues regarding the tutorial, open the question directly on the Minex community forum because most of the YouTube comments are missed by us. Hope you enjoy the video. Like, share, and subscribe to the channel for more awesome content like this. Thank you for watching Minex.