Hello, in this tutorial you will learn how to live stream to YouTube using free VPS without OBS or GPU. In most free VPS does not have GPU then it is not supported for OBS. You do not have to open your PC for a long time during the live stream and able to keep an excellent connection with the YouTube server for YouTube unlisted live stream.
Step-up Free VPS on Oracle
I use the oracle free tier for this tutorial. It is a free VPS. You can get 2 free VPS from Oracle cloud. Only you have to do register on Oracle cloud. If you trouble with registration watch the first part of this video. After registration, you can continue other steps.
In your Oracle dashboard, click the “create a VM instance” button.
Name it, use any name you preferred. Click “edit” under configure and placement hardware.
To change the OS, click the “change image” button and select Ubuntu 18.04 as your OS. Under network configuration, check whether you select “New virtual cloud network”.
You have to add an SSH key for the instance. Select “paste public key” to add the SSH key. You have to install Putty Key App to generate and connect to the VPS.
Check the description for the download link. After installation of the Putty app. Open Putty Key Gen. Click the “generate” button then, move your cursor in this area. Copy the SSH key and paste it. Click the “create” button to deploy the VM instance. It may take few seconds. Save the private key in a safe place, it is necessary to connect the VM instance. You can see here, VPS is running.
Add Swap Space to Increase RAM
Copy public IP address of the VPS. Open the Putty app and paste the public IP address as the hostname. Under SSH click auth to add the private key that you previously saved. Now go back to the “session” tab and save your session using any name. Then you able to connect it again without entering credentials again. Click open to enter the terminal window. Type “ubuntu” to login into the virtual machine.
We have to add more memory to VPS before start the live stream. It helps to keep a smooth stream process.
Create a swap file and allocate space. I’ve used 1024 MB but you can take more.
sudo dd if=/dev/zero of=/mnt/swap.0 bs=1024 count=1048576
Next use this line to mount it.
sudo mkswap /mnt/swap.0
Switch to root account to activate the swap.
Use this to activate it.
echo "/mnt/swap.0 swap swap defaults 0 0" >> /etc/fstab
Next use this command.
check if it’s created successfully.
sudo swapon -s
Check again the created main and swap size for memory. The swap file is created successfully.
Install FFmpeg Video Encoder on VPS
Type “exit” to logout from the root user. For live streaming using Linux, you have to install the FFmpeg video encoder. FFmpeg uses for manipulations with audio and video as a command-line tool. Then we don’t want OBS Studio to broadcast.
Follow these commands one by one to install FFmpeg. First, use this to install the repository.
sudo add-apt-repository ppa:mc3man/trusty-media
Update list of packages on your VPS using this code.
sudo apt-get update
Get Install FFmpeg using this command. Type “Y” to proceed.
sudo apt-get install ffmpeg
Once you used this command you need to see the result like this. It indicates the successful installation of the encoder.
Upload files using SFTP FileZilla
You have to upload video and audio files using the SFTP client. I use FileZilla for this. You have to download and install this application before this step.
After installation, open the FileZilla client. Click the “server icon” at the top left corner. Then click the “new site” button to add a new server. Past your public IP address as host and 22 as the port. Change the protocol to SFTP, then change “Logging Type” to the key file. Enter user “Ubuntu” and select your private key file that was saved before. After setting all of these, click the “connect” button to connect the server.
Now, it is successfully connected to your remote server storage. In this application, the right-hand side remote server and left-hand side your local machine.
In your local machine, select the file that you want to upload. Right-click on it and click “upload”. In the button, you can see the progress of the upload.
You can upload other files using this method. Copy the path of your file and paste it on the notepad. Then copy the file name and paste it to the end of the path that you copied. You have to do this with both video and audio files.
-re -f lavfi -i "movie=filename=$VIDEO_SOURCE:loop=0, setpts=N/(FRAME_RATE*TB)" \
-thread_queue_size 512 -i "$AUDIO_SOURCE" \
-map 0:v:0 -map 1:a:0 \
-map_metadata:g 1:g \
-vcodec libx264 -pix_fmt yuv420p -preset $QUAL -r $FPS -g $(($FPS * 2)) -b:v $VBR \
-acodec libmp3lame -ar 44100 -threads 6 -qscale:v 3 -b:a 320000 -bufsize 512k \
-f flv "$YOUTUBE_URL/$KEY"
After that, you can get this streaming script in the guide. Please check the description. Replace the video and audio path with your paths. You have to replace the stream key also by using your key. You can find it on the YouTube live stream page of the channel.
Connect your VPS again using the SSH terminal. Use this code to list the files in this directory. You will see the uploaded files here.
Run Stream Script and Live on YouTube
After that, you have a new screen. It helps to keep the live stream up and running after the closing of the SSH terminal. Use this command to install the screen.
sudo apt-get install screen
Use this code to navigate your new screen. Press “Space Bar” to proceed.
Now paste your stream Script here and press “enter”.
Now your live stream is started. Check it on YouTube Live Stream Page. You, Will, get an excellent connection with this. There is no need for GPU or OBS to run live streams on YouTube.
Thank You. Have a good day. If you have anything comment below.