Alright, it's time to use the very exciting PeerTube feature, Live Streaming, which has
been in PeerTube for quite a while, but we haven't covered it yet, so I thought I'd go
through it.
The first thing you need to know about streaming on PeerTube is that it's really resource-intensive.
Streaming is not your regular run-of-the-mill hosting videos of your cat that you uploaded.
It is a real beast, and that's because you're having to take data coming in a
stream from your computer, turn it into something that can be given to the public,
and then let them download it, and you're having to do that live, which is pretty
unforgiving. Consequently, you need a powerful VPS, and hosting companies will
need to allocate you a more premium plan so that you have the resources needed
to do all that work. If you jump over to Fetihost and you're in a dashboard,
like say the discount bucket warehouse here, and we have a look at their plan,
typically, you know, they've got the cheaper plan with the basic requirements
to host videos, and that's fine, but you'll notice as you go up the payment pyramid,
you'll find your live streams are usually located on a more expensive plan.
So you're going to want to select that and change over so that you're not
going to have a bad time while streaming. Now, closely related to this,
you want to make sure in your PeerTube settings, under settings,
configuration, live streaming, that live streaming is enabled.
And if you're saying to yourself, I did check live streaming enabled,
and I hit save. And then when I came back, it was disabled.
It might be because your host has actually got you on a lower tier plan
and they're not letting you do live streaming.
They may be disabling that setting so that you don't get yourself in trouble.
It's one of these tricky things when you're running a company
that's hosting third party software, if they haven't given you a setting
to disable live streaming in the back end, you're having to do these
kind of like constant monitoring to make sure the settings don't go awry.
So if you're finding that this is being disabled,
even though you didn't disable it, check that your hosting provider
actually has you on a plan that supports live streaming.
So the next thing you'll need to do is download OBS.
And if we go to OBSproject.com,
you can choose the appropriate version for your computer, download it
and install it. OBS is an industry standard.
It's probably the most common streaming software that I've seen
amongst people who do YouTube and Twitch streaming, at least.
So download that and install it.
So now you have all your ingredients chopped up in the right place
to get started streaming.
So the first thing you want to do is go to your peer tube instance,
click Publish, click on Go Live
and choose which channel you want to have your live stream on
and one of either a normal or permanent and recurring stream.
For today, we're just going to go with permanent and recurring.
That's just because it's automated and it's easy.
Basically, when you hit Start Streaming, it starts to stream
to the same container.
You don't need to change the settings each time, which is nice
and convenient.
You might do a normal live later when you want to schedule stuff
and you want to label stuff specifically for that stream.
But this is just the easiest option to get going for now.
So we hit Go Live and then
we have all our various obvious options.
For now, just because this is a test to make sure that it actually works,
we're just going to choose Privacy Unlisted for obvious reasons.
We are testing this and we don't want it to push out a video to the public.
And then if we go over to Live Settings,
you just want to make sure the privacy of the new replay is private.
And actually, maybe we'll just turn this off typically for now
because you don't want to be testing if live streaming is working
while at the same time, your server is dealing with re-encoding
live streams to publish them when the live stream ends.
So let's just disable that.
And we now have over here the two key settings
that we're going to need to put into OBS to connect to your PeerTube instance.
All right, on to the next stop over in OBS.
When you open OBS, it may ask you to configure a few things.
You can skip that for now.
Just try to get to this basic screen with no configuration setup helper.
You will see something that looks like this.
The first thing we're going to do is add some stuff to show on our live stream.
For today, it's going to be really basic.
I'll do an audio input so you can hear me.
And I'm just going to choose the MacBook Pro microphone.
So that will be awful for anyone watching a stream.
I would not recommend doing it,
but I just want it to be different from this guy here, video capture device.
Add that so that you can see me and I will use my FaceTime camera over here.
Hi, it's me.
And then we will add the we will add a image.
Just to make it a little bit more, you know, exciting from our.
Here we go. OK.
So let's resize everything.
So we're going to make the video for the camera to fit the screen like this.
And then we will make a little consultantron image.
Like it's kind of like a news broadcast or a presentation,
or it's like I can kind of consult a throne, raise your arm and point a consultantron.
Page when a consultantron raising his arm and pointing at a consultantron is perfect.
This is exactly what consultron would want.
We can see our microphones working.
We can see our consultantron is consulting.
It is time to push this out onto the Internet.
To do that, we jump over to settings, stream,
and you choose custom from this, you know, maybe used to YouTube.
Each one has kind of a different option for custom.
It uses two values and you may recognize pure tube had two values.
So we go over here.
You can see the live RTMP URL, hit copy and we'll paste that in.
And then the stream key, which you want to keep the secret
because basically if anyone knows it, it's like your password.
They can now get in and stream stuff on your server without your permission
and you hit paste.
Now, this is where there's a little catch.
Some service providers like FETI host have encrypted communication.
So if you have a look at your URL here,
HTTPS, that is a secure communications encryption between
the pure tube server here and your computer at home.
And if you see on your address bar here, HTTPS,
there's a decent chance that this is also encrypted.
And the problem is that pure tube is not showing this as RTMPS.
It's just showing it as RTMP.
So in the case of FETI host, you need to add an S here.
Now, you may not need to on your pure tube instance.
You may be using hosting that does not encrypt the stream using SSL,
but we do.
So just keep that in mind.
You will know that it's not working because when you go OK here
and you hit start streaming, it will give you an error.
So if you hit start streaming and you get an error,
well, go back here, get rid of the S and hit OK and try again.
So let's hit start streaming and we are now streaming.
You can see the time here.
You can see the bit rate.
And if we jump over to our pure tube instance here,
we can hit watch the video.
So now you can see it's streaming and, you know, it seems to be working OK.
But it's getting a little choppy.
See this, it's paused and it stopped and it's it's reloading
and thinking about things and something's not quite right about it.
Right. And this is because despite this being put on a pretty powerful server,
I have gone and made the settings way too much.
So they're kind of guaranteed to jam up a pretty powerful plan on FETI host.
So this is a scenario that you have to consider when you're using
pure tube and you're self hosting.
You are responsible for making sure that you don't feed things into a server
that it can't possibly handle or change the settings on a server
so that it's not going to be able to handle what it's given.
So the strategy that I would use to handle this situation is
start off by cutting all your settings down
to the most basic, safe, possible setting that they could be.
Then once the stream is stable, increase the settings.
So let's stop the stream for a second because that's not working.
And we can start off with the settings that can cause a problem over on pure tube.
So first things first, over in the live streaming page,
we want to check these various options.
First, maximum simultaneous live streams.
If we had 10 allowed maximum simultaneous live streams,
that's probably going to be an issue for a lot of servers.
You might want to start off making sure that it's one,
because the thing is you might be kind of reducing all your settings
and, you know, making it as easy as possible on the server.
But if there's some other person in parallel live streaming,
6K, 60 FPS video, then you're going to have a hard time telling,
you know, exactly what the problem is.
So I would reduce this to one maximum live stream
just so you can make sure that everything you do is truly you doing it.
The other thing you want to do is disable transcoding for live streams.
So this is checked and you have all of these different options on.
What's happening is the live stream coming up from your computer
is being converted into all these different formats before it gets sent out.
And that can be extremely heavy on the server too.
So disabling that is a pretty good idea as well.
And let's hit update.
Now let's look at the settings that are more typically the problem.
And these are the ones inside OBS.
Now we hit settings over here.
Click on output.
We'll see one likely source of the issue, which is a very high video bit rate.
And yeah, this is a very high video bit rate.
It is probably 10 times higher than it needs to be.
So I would reduce this to say 2000.
Let's just omit philosophy of reducing things down to a low level,
getting things stable and then increasing it.
Reduce it down lower than you probably would, which is 2000.
Audio bit rate, I mean, audio doesn't use a lot of resources.
160 is fine.
I honestly wouldn't touch audio.
I think it's unlikely to be the source of your problems.
Now, if we jump over to video, we've got our, I think,
main culprit for why this wasn't working.
It is a 6K video, which is really big.
So let's knock it down to 1080 and then the output resolution is 1080.
And I think that 1080 is a really decent resolution to live stream at.
And I would probably recommend that we can output at a lower resolution.
Like 1280s, just so that it's even smaller for the server.
So in line again, we're keeping things as small as possible.
Let's output at that resolution, hit OK.
And then we can hit start streaming again and jump over to our live stream.
Here it is.
And it's now running much smoother.
If we look on the settings there, we can see that it's 720.
And now from this point, what I would probably do is I would stream
for half an hour, see if it's choppy at all, see if you run into any issues.
And then if everything's looking good, increase the settings to the size
that you would ideally like to have them.
And this is it's a bit like Mastered On.
If you've watched any of the Mastered On tutorials, we're kind of used
to big Silicon Valley media companies doing the work for us
of just handling massive amounts of data.
You know, you could live stream 24 hours a day at 4K to YouTube
from a webcam and YouTube just has to deal with that, you know.
But PeerTube Mastered On, they put into your hands
responsibility for wasteful data use effectively.
And yeah, you will probably need to decide whether a 60 frame per second
4K video is really necessary for your audience to enjoy watching
you talking at your desk.
So that's the basics of streaming on PeerTube.
I hope that was helpful.
This is the first video I've done on PeerTube streaming.
So let me know if you have any questions in the comments
or things that you've run into.
There are multiple other features like the ability to integrate chat
and use some of those plugins.
If you want to know how to use OBS, there is an infinite amount
of resources out there.
But if there's any questions that you have related to PeerTube
and its integration with OBS specific PeerTube things,
or if you run into any problems with PeerTube streaming
and you want some help or advice,
throw over questions in the comments.
I'm happy to help out.
And also there is a full written article that's on the FitiHOST
blog, which you can check out, which goes through all the stuff.
It's an ever-evolving thing.
We're always updating it as new things come up.
So you can check there if there's anything you think
may be missing in the video, it may now be in the blog.
And yeah, please share this video around.
Recently, I have discovered that the threat of us,
Lemmy and PyFed and Embin are really good places for sharing links.
And it would be great to get more of these videos and tutorials
out there as a person who's had to figure out the stuff.
A lot of the time there isn't really a comprehensive resource
on how to do the configuration and set up of some of these things.
So it would be good if that stuff was out there
and more people knew these resources were available.
And it's not bad for business as well.
So it's a good way to help out, even if you're not a customer.
All right, thank you very much for watching
and we'll see you out there on the fit of us.