Guides: Optimize your live streams with SRT: Mux setup guide
Phil: Hey, Phil from Mux here with a quick demo of
how you can use SRT on Mux to deliver a great live streaming
experience even when the network you're sending a video
from is less than perfect.
Okay, so on the left I've got OBS playing my
favourite movie, Big Book Bunny, and I've got my
live stream on the right.
My live stream at the moment is going out over
RTMP, it's going out at about 7 megabits a second.
It's completely stable, no dropped frames,
anything like that.
If we take a look at the live stream health.
Seems fine, completely stable, about 7 megabits,
30 frames a second.
So what I'm going to do is I'm going to use Network Link
Conditioner to introduce some problems on this network.
So I'm going to introduce 100 milliseconds of
extra latency, as well as introducing 5 percent
packet loss on both packets sent and packets received.
Let's see what that does to our RTMP stream.
So if you keep an eye on the bottom of OBS, we'll start to
see really quickly, we start dropping frames way above
like the 5 percent of packet loss that we introduced.
Um, eventually we'll probably actually see that this gets
a full RTMP disconnect as well, and then we'll start
to see reconnects kicking in.
If we take a look at the Mux dashboard, obviously
we see this big dive off in the bit rate and obviously
the frame rate as well.
So you probably wouldn't be able to watch this.
It would be a pretty easy.
Stuttery mess from playback side.
It's taking a lot longer than you want for frames
to get into the encoder.
Let's take a look at what this looks like with SRT instead.
Okay.
Now that live stream stopped, let's reconfigure
OBS to use SRT.
To do this, I need the SRT URL, stream key, passphrase,
but I'm also going to set up the latency of a connection.
So what this does is it tells SRT how much buffer.
To keep on each end of a connection.
To compensate for packet loss, reordering, jitter, latency,
all those sorts of things.
So I've set that to two seconds in this case,
which should be enough for the issues that we're
introducing on the network.
So let's start that stream again.
Okay, so our live stream's back up.
Now let's do the same again.
Let's turn on our network link conditioner.
And see what happens to our SRT stream with 5 percent
packet loss and that extra a hundred mil seconds round trip
time, if we take a look down here, it doesn't look like
we're dropping any frames.
We might see the bit rate start to spike a little
bit, and that's because, Hey, we're having to resend
a bunch of extra frames.
So sending some extra data, let's see how it looks so far.
So good.
Our live stream looks pretty stable.
We're not dropping any frames.
Uh, frame rates, consistent bit rates are consistent.
So it looks like things going well, even though
we're dropping quite a lot of packets.
This is what SRT is designed for.
It's designed to handle these imperfect network conditions
and make sure you can still live stream when this happens.
Let's take a look at how our asset looks.
Looks pretty good to me, even with all of that packet loss.
And all that extra latency.
So there you go.
That's how you can use SRT to improve reliability
of your live streams.
Even when the network isn't perfect.