media server logo

How to set up geo-distributed stream routing using SRT and Callaba 7.3

In this tutorial, we’ll cover organizing geo-distributed video stream delivery with multiple instances. 

Why use geo-distributed routing?

Reduced latency : Geo-distribution minimizes latency by serving video content from nearby servers. Load times are faster and and playback is smoother.

Efficient network routing: Strategic placement of instances optimizes network resources, reducing hops and the risk of network congestion for more efficient video delivery.

Better viewing experience : Faster loading times and smoother playback contribute to an enhanced user experience, rising user engagement with minimal delays.

Video Stream Route

Let’s imagine that we have a studio or an event going on in Stockholm, Sweden and we want to deliver video feed to London, as our audience is there.

So we will be sending our stream from Stockholm to London.

Preparing instances

To establish a connection between our servers (known as “instances” on AWS) , we first need to obtain those said instances.

For our use case, we will launch two instances — one in Stockholm and one in London. For some setups you might need more than one instance.

If this is you first time encountering with AWS, we have a detailed step-by-step tutorial explaining how to launch AWS instance with Callaba on board.

🔗 How to launch Callaba Cloud on Amazon Web Services

⚠️ Pro tip : Please make sure to read about stopping/terminating your instance to avoid unexpected charges from AWS.

Setting up "source" instance

Okay, now that we have our instances up and running, let’s set them up.

Log into the instance the would get the video feed first and woulв act as “the source” of you video. In our case, it is the instance located in Stockholm.

1 . Go to SRT Servers section 
Click “Add New”

2 . Name your server
Specify Ports and other settings if needed

Click “Save”

3. In the “SRT Servers” listing page, click Info (i)

Copy SRT Publisher URL

Use SRT Publsiher URL to send your stream to this server (from your encoder, streamng software or camera).

4. Once your stream is coming, you will see the incoming bitrate.

To see the statistics of your incoming stream, click the Stats icon.

Now that we have finished setting up our “source” instance, let’s move over to our next instance.

Setting up “destination” instance

1. Log into the instance that is going to be receiving the stream from the “source” instance.

In our example, this is “London” instance.

Open SRT Servers section

Click “Add New”

Name your SRT server

Specify ports and other settings

2. Scroll down, unfold Routing Settings

SRT Routing : select SRT master-slave cluster

Routing mode : Pull 

✧✧✧✧✧✧✧✧

💡Tip :

Pull is used by the receiver to retrieve the stream from the source.
Push is used by the source to send the stream to the receiver.

In our example our receiver instance in London is going to connect to the Stockholm server, request and receive [pull] the stream.

If we were to use Push, we’d have to set up routing on our source instance in Stockholm. 

✧✧✧✧✧✧✧✧

Click +Add SRT Host button

Routing Host : insert Public IP address of your “source” instance 
(in our case this is the IP of the Stockholm instance)

Routing SRT Port : Receiver Port of your source instance

Source SRT server name : Name of the SRT server you’ve created in your source instance

Unfold “Allowed streams”

Click +Add Stream

In the new item that appears, specify 

Role : Puller

✧✧✧✧✧✧✧✧

💡Tip :

In Callaba, “allowed streams” define what streams are…well, allowed.
This functionality is made for security reasons.
Every allowed stream has a “Role” that defines the type of stream that is allowed. 
There are four roles in total : Publisher, Receiver, Pusher and Puller. 

When you create an SRT Server, Publisher and Receiver streams are created automatically. 

To be able to Push or Pull, you need to add a new allowed stream with an appropriate role.

By default, streams have no Stream ID. 
Thus, you can stream either using a default Stream ID or by Host and Port. If you put your own Stream ID, you will have to replace default Stream ID with your own.

✧✧✧✧✧✧✧✧

Click “Save”

4. To see that our Pull is working, we need to add a final receiver.
This can be anything : you can create a web player in Callaba, use VLC player to view the stream or add your own receiver.

In the SRT Servers listing page, click Info (i) icon.
Use SRT Receiver URL to retrieve the stream, from the server.

In this tutorial, we will create a Web Player to act as our final receiver. 

Go to Web Players section,

Click “Add New”

Name your Web Player
Set your SRT Server as your input

Click “Save”

In the Web Players listing page, you will see your incoming bitrate.
You can also click the Preview button to view your stream.

In the SRT Servers listing page, you will see both the incoming and the outgoing bitrate.

You can also go check the Stats section for both SRT Servers on both instances to see detailed data about your stream.

This is the end of our tutorial.

If you have any questions, please contact us at: [email protected]
We will respond to you within 24 hours.
Happy streaming!