Flirting with Owncast, Raspberry Pi and OBS - Adventure in Self Hosing

bcoyle

Member
Owncast is an environment similar to youtube etc, just not as well known. There is no censorship and you are pretty much allowed to have you own channel with your own stuff. But, You should still pay attention to copyright laws.

Owncast has a central directory where other people have their channels and live broadcasts are highlighted. It has chat etc.

There are many solutions in the cloud, but can be costly if you use a lot of bandwidth. Also, you don't want to store a lot of videos there either.

So this is an experiment in self hosting.
Owncast has downloadable software that runs on a PI and make it pretty easy to get started.


Of course, upload speed is important, so you need good upload speeds to make this work.

So wish me luck and join in the adventure if interested.
 
Last edited:

bcoyle

Member
Step 2. Got the PI today - Put it together.
I got a pi 5, 8gb ram, 128gb sd card with preloaded OS.
The instructions were printed very small. Had to use a magnetizing glass.
Went to the god of all knowledge to help for a few details.
Plugged the power supply in, got a green light.
Connected a monitor, mouse,keyboard.
Came up alright.
Created account, password
selected english, timezone and browser type.
Connected the lan cable.
browser worked fine
I am totally impressed

IT IS SO TINY!
 

bcoyle

Member
So, why should you care about this forum channel?
So far, i've gotten a few views, but not enough interest to anybody to join.

So this would be of interest to less experienced people, new to cloud and server use.

Of course, it's easy to just say in these times , just go ahead and buy this or that. but truly, if this is a burden finance wise, then hint to the wife or kids, that you might like this as a present on a birthday or Christmas.

Anyway, i recommend buying a kit with pi 5 (not 4) with a full desk top, power supply, cables etc. I payed $130 for my klit (on amazon, came next day) ) with 8gb ram and 128gb main disc. The main disc is really just a big SD card, you might use for cameras. Think windows C drive.This will save you pain and when booting up for the first time. You just connect a usb keyboard and mouse, use the supplied hdmi cable to a monitor. Later , you can remove these and operate it headless (i.e. remotely if you wish.

The pi 5 aleady has a firefox and chrome brower installed along with a VCN server for remote operation. It truly has everything. The operating system is a denian 12 linux system. It also has a wireless connection along with a wired cat input. It truly is just a small form factor computer.
 

bcoyle

Member
So I started with a youtube video: https://www.youtube.com/watch?v=0BWc8TF0qI0

This is a video on setup / install of owncast on a pi.
It talks about what you need to know to get this going.
In the first part of the video he talks about flashing a new system on sd card.
I avoided this by buying a full kit with installed OS , PS, cables, box etc. Don't go cheap.

Please realize, even if I am talking about owncast, a lot of this also applies to other server types.

Since I got the full kit, I looked at the documentation first. I have old eyes, so needed a magnifying glass to view some of the diagrams.
The kit came with a pi pc board, a cooler fan and a box that I had to put together. Not hard.
Once assembled, I plugged in the power supply cable, the ubs keyboard and mouse. They suppled 2 hdmi cables, plugged one into a spare monitor. All this made it easy to deal with the pi for the first time. You can remove this later and talk to the pi remotely if you like.

On startup, the pi asks you a few questions about names, browser types etc.

To talk to the pi remotely , i downed loaded 2 programs to my main computer. They are both free. Google them to find the install pages

1. Putty: Creates a command window.
2 Realvnc LITE. This lets you do a remote desktop login. Be sure to get the LITE version which is free while the regualr version is not.


The video will fill you in with some of the details about installing the owncast server.

Th raspberry pi becomes just another computer on your local network with an address that looks like 192.168.1.x where x is a number assigned by your router on startup. Hopefully the same each time.
 

bcoyle

Member
Now a server is just a piece of software sitting a on a computer somewhere "LISTENING" on a port. You can talk to it by specifying the computer address 192.168.1.x and the port number. This address works well if you are talking on the local network using your browser. The x is whatevery the routewr assigned to the PI.

So lets say, your pi has an address of 168.192.1.17. Once the owncast server is running, it will respond to you (using a browser) with different commands.

If yiou know how to stream to youtube, owncast is similar. It has a target address and a stream key. For owncast, you are using the internal network address not the youtube address in the clouds.

So to stream to owncast , you need to edit obs stream setting.. FYI: in the owncast setup (remember the video), you created a stream key, yourself. This is needed to stream to owncast.

So the target owncast server is custom, rtmp://192.168.1.17:1935/live and the stream key is the one you created. Easy enough. Port 1935 is the port that the owncast server is listening on for you to stream to, while port 8080 is the port where you can watch the video.

One VERY IMPORTANT thing to remember is HOW MUCH UP BANDWITH do you have. For each user logged on, you are using your home bandwidth. Now I am lucky and have 400 up / down, so can support a number of users depending on my video bit rate. Owncast also has videos on how to install a server on a free (within reason) LINODE cloud account. There are limits on the stream data you can send without paying for extra, But you get a free permanent internet address.
 

bcoyle

Member
On my home computer, I can use a browser and watch the streaming video on 192.16.1.x:8080 by just typing in that ip address and port 8080. You could have the PI connect to you local TV and have it wirelessly and have you own private tv STREAMING channel (WITHOUT SENSORSHIP).

So great, you can stream to you local computer or tv set

What about the outside world????
 

bcoyle

Member
Now I know that many people know all this stuff, but for the benefit of newbe's, added this section to understand how a web address gets to your server.


At this point, we can talk from one computer to another on the local lan, using the target computer ip address and port number. Think of this like a telephone number with the computer being the area code and the port as the rest of the phone number. As example, the phone number 408-555-1234 has an area code of 408 and the phone number being 555-1234. The 408 is your router and the 555 is your computer and the 1234 is your port number.

Now a server is just a piece of software located on some computer, listening on a port for a message for it to do something. The computer has an IP address that identifies the computer. On the local lan, you can say 192.169.1.20 : 8080. the192.168.1.20 is the computer and the 8080 is the port , sometimes known as a service.

From the outside, i.e. the www, a remote computer wanting to connect to a service (owncast,ftp,etc) in your home lan network, has no idea how to get there. This is where DNS or domain name lookup comes into play. From the outside, you want to use a name instead of a ip address to get there. Many people have a web website. You normally get there by typing in a name like my_website.com using using a brower. You browser goes out to DNS or dynamic name server. Your browser talks to dns and gets an ip address in exchang and "ONLY" an ip address. There is no port information or ip address for the individual computer on your home network. just how to get to your router.

When you send a request to my_website.com : 8080, the browser gets the ip address from the DNS and creates a new target maybe 147.12.34.10 + 8080 to get 147.12.34.10:8080. At this point , the request comes into your router and it has no idea what this port 8080 is and on what local computer it is located on.

Now suppose you have 3 web cameras on your lan and each talks over port 1200 and has 3 different ip addresses. You can't just say :1200 coming into your router. But using PORT FORWARDING you can. Ffrom the outside, assign port 1201 to camera 1, 1202 to camera 2 and 1203 to camera 3. These are completely made up numbers you choose. In the router, you have a translation table (DNAT) that creates a new ip address and port number form the incoming made up port number.

Internally the 3 web cam have the following addresses :
Cam 1: - 192.168.1.21:1200
Cam 2 - 192.168.1.22:1200
Cam3 - 192.168.1.23:1200

Notice the .21,.22,.23 that identifes the indivual cameras.

The router DNAT table translates 1201,1202 and 1203 into

1201 as 192.168.1.21:1200 (cam 1)
1202 as 192.168.1.22:1200 (cam 2)
1203 as 192.168.1.23:1200 (cam 3)

When setting this up, you need to log onto your router as admin and create the tables. Different rotuers have differernt menus.

So the thing to keep in mind is that when using a domain name.

1. The name like my_website.com gets translated into your router ip address.
2. The port number you invent gets translated (via the DNST table in the router) into the real local computer ip and the correct port number for that service.

So you are sitting at home and you bring up vlc or media player and you want to set cam 1

You want the camera , not the website, so you might typing "cameras.my_website.com : 1201" for cam 1

ok, so what is the "cameras." tag.

When your media player asks for .cameras.my_website.com, what happens first is that my_website.com as the address gets looked up. This would be the ip address of the actual website. Now all DNS addresses also support the added ".some tag.also as a secondary address. This is stored in table that stores "A" records. This is used to point at servers other than the my_website. i use godaddy and I would just create a new A record and give it the ipaddress of my router. So .cameras.my_website would now point to my router.

So to talk to "cameras.my_website.com:1201" which is camera 1

1. media player asks DNS for the address of cameras.my_website.com
2 DNS looks up my_website.com
3 DNS sees secondary tag "cameras.", looks that up in the A record table and returns the external ip address of your router
4.Port forwarding in the router see 1201 and translates this to the camera 1 ip and port 1200.

Basically there are two lookups, one in the dns and one in the port worward part of you router.

Once you get your head around all this, you will find it not that hard.

If I got any of this wrong, please let me know.
 

bcoyle

Member
2 station onwcas smallt.jpg


Well, we have proceeded down the road. I'm running 2 owncast channels using casttor Ai to drive 2 copies of OBS. Used Caddy on the raspberry pi to convert HTTP TO HTTPS and have a web address with no port numbers. These 2 are featured on the owncast directory. This has been a little hard to get my head around at times but I have "mostly" arrived. The journey continues
 

bcoyle

Member
"IPTV" SERVER. It turns out that this is a pretty good HLS server and vlc will treat it as a HLS server, i.e m3u8. Pretty cool. So I can now run this as IPTV. In this mode, the owncast browser is not visible.
 

bcoyle

Member
WOW,AWESOME. Th best part is that you NOW also have IPTV / HSL / M3U8 server. Yes if you use a browser, you get the owncast interface, but use a vlc viewer or even the vlv source in obs, and you get the video by itself. Also you can embed this in your website. You can add /hls/stream.m3u8 to the url and it for sure plays the video. You can easily create a .m3u8 file and share with your friends, your own iptv. I think you can set it up also, that's it's private.
 
Top