In this guide, we will set up a multistreaming workflow using Azure, an Azure VM, MonaServer 2, and FFmpeg to broadcast to multiple platforms like LinkedIn Live and YouTube Live. We’ll use OBS Studio as the main streaming software. Let’s get started.
Motivation
Ever looked at those $15–$20/month streaming services and thought, “I have Azure credits—why am I paying for this?” Same here. Plus, my friend Luis Quintanilla introduced me to Owncast , which I plan to use soon. So, the question became: Can I achieve multistreaming using open-source tools? And if so, how do I stream to Owncast and other platforms at the same time?
Overview
The multistreaming setup works as follows:
- OBS Studio streams to a relay server running on an Azure VM.
- MonaServer 2 acts as an RTMP server, receiving the stream.
- FFmpeg restreams the RTMP feed to LinkedIn Live and YouTube Live simultaneously.
This approach minimizes bandwidth usage on your local machine (which is a pain in my home with so many devices and one kid) while ensuring a stable stream to multiple platforms.
Step 1: Setting Up an Azure VM
First, provision a virtual machine on Azure:
- Choose an Ubuntu-based VM (e.g., Standard B2s or higher).
- Ensure inbound ports for SSH (22) and RTMP (1935) are open.
- Install dependencies:
sudo apt update && sudo apt upgrade -y
sudo apt install -y ffmpeg git
Step 2: Installing MonaServer 2
MonaServer 2 is a lightweight RTMP server that will handle incoming streams from OBS Studio.
I followed the instructions on https://github.com/MonaSolutions/MonaServer2 which involved
installing gcc++, libss-dev (sudo apt get install gcc++ libssl-dev
) and LuaJIT manually.
With LuaJit I did not had an issue to compile it manually. With MonaServer 2 however, I modified:
MonaBase/include/Mona/Mona.h
and added #include <stdexcept>
after the includes (#include <cmath>
)
and then it compiled successfully. Then I manually copied MonaBase/lib/libMonaBase.so
into MonaServer
.
Run MonaServer
./MonaServer &
By default, MonaServer listens for RTMP streams on rtmp://<your-vm-ip>/live
.
Step 3: Configuring OBS Studio
- Open OBS Studio and go to Settings > Stream.
- Select ‘Custom’ as the streaming service.
- Set the RTMP server to:
rtmp://<your-vm-ip>/live
- No need to set the Stream Key.
- Click Apply and Start Streaming.
At this point, OBS will send the stream to your Azure VM running MonaServer.
You could test this by using VLC and opening rtmp://<your-vm-ip>/live
.
Step 4: Using FFmpeg to Restream
Now that MonaServer is receiving the stream, we use FFmpeg to send it to LinkedIn Live and YouTube Live.
ffmpeg -i rtmp://localhost/live/my_stream \
-c:v copy -c:a aac -b:a 128k -f flv "rtmp://a.rtmp.youtube.com/live2/YOUR_YOUTUBE_STREAM_KEY" \
-c:v copy -c:a aac -b:a 128k -f flv "rtmp://live.linkedin.com/media-server/YOUR_LINKEDIN_STREAM_KEY"
This command:
- Takes the RTMP input from MonaServer.
- Copies the video codec (avoiding re-encoding).
- Sends the output to YouTube and LinkedIn.
There are other options described here.
Step 5: Automating FFmpeg
For a more robust setup, create a script to keep FFmpeg running:
echo '#!/bin/bash
while true; do
ffmpeg -i rtmp://localhost/live/my_stream \
-c:v copy -c:a aac -b:a 128k -f flv "rtmp://a.rtmp.youtube.com/live2/YOUR_YOUTUBE_STREAM_KEY" \
-c:v copy -c:a aac -b:a 128k -f flv "rtmp://live.linkedin.com/media-server/YOUR_LINKEDIN_STREAM_KEY"
sleep 5
done' > start-stream.sh
chmod +x start-stream.sh
nohup ./start-stream.sh &
Or you can even put your streams in a txt file.
This ensures FFmpeg restarts automatically if it stops.
Conclusion
With this setup, you can multistream from OBS Studio to LinkedIn Live and YouTube Live using Azure, an Azure VM, MonaServer 2, and FFmpeg. This method optimizes bandwidth and ensures a stable stream for multiple platforms.
If you are interested in what I stream checkout The Raccoon Bytes, otherwise if you have questions or run into issues, let me know in the comments!