Question / Help Multicast Streaming from and IIS7 Server?

Mark Weiss

Member
I am trying to set up as live stream on my web server. I already know how to stream on Youtube/Facebook with OBS. But what I want to do is have total control of the streaming and do it from my own server.
15 years ago, I streamed on my server via Windows Media Encoder, but it was limited, the number of viewers, by the bandwidth of my connection.
I read that today it is possible to multicast. But I need a little help setting that up.
It looks like OBS can do custom stream configuration, so hopefully that will make this possible.
I have two PCs dedicated to this. One is the web server, running IIS7. The other has the BMD Intensity Pro 4K card in it. Everything is hooked to a business class cable internet connection.
I want to embed live stream on one or more of my web sites. So I need to encode it, but also embed it. And it needs to use multicast so there is no limit on number of viewers.
Can someone point me in the right direction, or if documentation for how to do this specific task exists, can you point me to that?
Much appreciated!
 

Mark Weiss

Member
Thanks for the quick reply!

I have all Windows 7 & 10 machines (our server is running 7 64-bit), but I do see they have binaries for Windows:

http://nginx-win.ecsds.eu/download/

I looked at that site and there is a staggering number of links! Are these all different versions? If I understand correctly, the ones further down the list are newer revisions? Not sure what to download here. But I have the feeling I'm closer to a solution.
 

Mark Weiss

Member
Thank you for answering those questions. I'll have to experiment with nginx and see what it can do.

One more question: should I run nginx on the web server in parallel with IIS7, or should it run on the video capture machine? If the latter (since that's where the capture hardware is). The web server is probably not up to the specs needed for video capture anyway. It's based on a Core2 Duo CPU. The machine I have doing capture is a Core2 Quad clocked at 4GHz.

Would this topology work:

My network has two routers--inner (secure) tier and outer (web server, guest computers) tier.
Video capture machine on 192.168.1.100 node (behind inner tier router)
Server on outer tier router at 192.168.0.109 (behind the router that is connected to the cable modem)
Do I run nginx on the capture machine and then somehow pipe it through forwarded ports in the inner tier router, via links to the video capture stream machine from the web page on the outer tier server? Or does the capture machine HAVE to reside on the same subnet as the web server, if the web server is to link to the video stream from within a web page?

I hope I make sense with the above. I know just enough to get into trouble!
 
As long as no firewall is blocking the outgoing video stream on port 1935 the server can be anywhere. I wouldn't run it on the video capture machine. If you want a lot of connections at the same time you could also run it on a cloud vps.
Running it in parallel with IIS7 is not a problem if you want to use it host the website and videoplayer.
 

Mark Weiss

Member
I managed to get the nginx server up and running. Had to edit the config file to tell it to use port 8080 because of a socket access permission issue (most likely because IIS7 is using port 80). Once I did that, I was able to get the server to come up and get the greeting page of nginx.

So in essence, I'm running two servers in parallel on my outer tier server machine. I need to port forward 8080 (port 80 already forwarded for the web server) in my outer tier router.

I have OBS set to create a stream (following the instructions on another part of this site) where it uses the Record feature but instead of to a file, it goes to a file path as: udp://224.0.0.1:9999 (I guess this means that OBS is sending out video on port 9999, so I need to forward that port on my inner tier router so that the outside web server on the other side of this router can see it.

What remains is how to configure nginx to do the multicast. I don't see an interface or console for nginx. Still need to figure out what to do in there to make that work. Assuming I solve that, then all that remains is linking to the stream and putting a window with the link on the web site. Convoluted, but probably doable! Am I on the right track here?
 
You sidetracked a little bit. NGINX can be a web server but is doesn't have to. If you remove the http block in the nginx.conf the web server is gone. Then add the rtmp configuration block provided in the tutorial(https://obsproject.com/forum/resources/how-to-set-up-your-own-private-rtmp-server-using-nginx.50/ Step 3).
The rtmp stream is using port 1935. Make sure you restart the server after changing stuff in the config.
Follow the guide(Step 4) on what you should put into the obs stream destination settings. If the stream is up you then can play it eg. with vlc for testing with the url rtmp://<ip of your server>/live/<the streamkey used in obs>. This can be done from everywhere if you setup port forwarding and use your public ip.
If you got everything running you should look into how to secure the server so just you can stream from you local network: https://github.com/arut/nginx-rtmp-module/wiki/Directives#access
 

Mark Weiss

Member
That link is for the Linux instructions. We're running all Windows machines. The Windows binaries don't have any instructions. Can it be configured by editing the .conf file? The Readme file says:

"*** Default installation instructions;
* New: unzip this version with folder structure
* Old: overwrite with this version
* Check nginx.conf, nginx-org.conf and nginx-win.conf
* Windows optimization registry file: check your current values BEFORE setting the new ones"

There seems to be no console like IIS7 has, so it's not apparent how to configure this.

One step at a time...

To be sure, this server, correctly configured, should allow me to multicast to multiple viewers on the net without multiplying the bandwidth requirements by the number of viewers, am I correct?
 
The configuration is all done by editing the config file. That's the same for all platforms. You need to have the nginx-rtmp module installed or it won't work.
The bandwidth will multiply with the number of viewers as every client that connects get's sent a copy of the stream. This is "multicasting" in the sense that you are not actively pushing the stream to a certain client but everybody can connect to it. "Multicasting" in the sense of "uploading it once to the internet" is not how that works here. That's why i suggested maybe using vps in the cloud to act as the distribution server.
If you want real local network multicasting this can be done with NDI.
Another alternative software to nginx with the nginx-rtmp module that runs on windows is the Red5 media server, but i don't have any instructions on hand for that or experience.
 
Last edited:

Mark Weiss

Member
Bandwidth multiplication is what I'm trying to prevent. I don't have a couple of OC48 pipes coming into my studio--just business cable internet. The upstream is rather slow.

What is VPS and meaning by 'in the cloud' and what is NDI? You mean like using sites like Twitch.tv and Youtube? That's what I'm trying to avoid--these places have overbearing rules about copyright, even if for a few seconds some music is heard in the video, they cut off your stream and slap you with a strike and a 90 day lockout. I'm going to be streaming an audiophile society meet soon, and lots of music and short movie clips will be heard/seen in part of the camera's field of view. So cloud streaming like Youtube/Facebook/Vimeo is out.

What I'm trying to accomplish is to be able to serve a few dozen or a hundred viewers who can't attend due to geographic reasons. My stream is 2.5mb/s. My uplink can handle that with a bit of room left over for regular internet access.

I have heard of Red5 but steered clear of it due to reading how difficult it is to set up and how heavy it is on system resources. Just a Core2 Duo with 4GB RAM for the HTTP server.

Is what I'm trying to do impossible?
 
There is no other way then using some kind of content delivery network or vps instances. VPS refers to a virtual private server so a virtal machine that runs somewhere in a datacenter that has a good connection and can handle the traffic. Newtek NDI is for transmitting video in a local network and supports real multicast(but this can not be used outside your local network).
You could setup your own content delivery network with multiple servers but with the knowledge you currently have i just wouldn't recommend it for now.
There are a lot of cdn platforms out there, https://streamshark.io/ and https://video.ibm.com/ just to name two. Just google "livestream cdn" and pick one.
 

Mark Weiss

Member
Those solutions are expensive! Definitely not for me. Youtube was free, but their copyright police bots are overbearing. As soon as it recognized a pattern match--BAM! Shut down, and privileges revoked.

Guess I'm going to have to try one service after another until I find one that doesn't monitor every byte I send out.

Setting up my own content delivery network was my intent, but I don't have the internet bandwidth to unicast to multiple clients. I mistakenly thought that RTMP was the magic key to sending out one stream and having it propagate throughout the 'net. Guess I was mistaken.. :(
 

Tomasz Góral

Active Member
You thought wrong concepts.
Multicast transmission - only in local network, almost all routers blocking multicast signal (offcourse you can change this options in good routers, but next routers block this type transmission).
Is only one way, send unicast, buy or rent server, e.g. from cloud.
what you need:
2,5Mb/s one stream who send to network server,
server rtmp in cloud (i pay $1-2 per hour), with 500Mb/s network
100 people = 250Mb/s
Total (my) cost :
- event (handball, basketball, football) 3h, cost start from $4
per month maintaining server data in cloud, cost start <$1

Offcourse you need 2-3hour for configure nginx on first time on server.
Now i have system for 50 server, but if need i can add next servers in few minutes.
 

Mark Weiss

Member
The various multicasting sites I looked at charge an average of $700/month for streaming service. And it goes up if you need more than a few streams.

I'm starting to form the opinion that IP multicasting depends on routers outside my network to replicate packets, so that may be outside my control.

I've signed up for an account on Twitch and we'll see if they ban me when we have our audiophile society meet. There will be short snippets of 3D movie play, high decibel music playback demos, and mostly my own recordings of orchestras and fireworks and some laboratory demonstrations. Now Youtube revoked my privileges for a few minutes of TV going on in the background. I'm locked out for 90 days. That's why I don't want to depend on any streaming service.
 

Tomasz Góral

Active Member
And i say build you own service it's easy.
Get cloud (e.g. ArubaCloud $4 per month, from OVH.com or DigitalOcean.com per hour) linux server (e.g. CentOS), install nginx-rtmp and you got own stream server, it very very easy, of course, it is easier to use YT or Twitch.
 

Boildown

Active Member
Have you tried Soundcloud? I thought they did live streams. No video though.

You can't multicast out to the internet, no one's ISP supports it and you'd effectively need a private multicast IP, which isn't a thing that can be purchased. On an network you control, you absolutely can multicast over it and its a good solution, but it doesn't work for the internet.

Btw, the privately scoped multicast addresses are in the range of 239.x.x.x. 224.x.x.x are often used by lan devices for routing and whatnot and shouldn't be used. There's other use cases for the ones between 224/8 and 239/8. So just stick with 239/8 unless you're sure you need something else.

Sounds to me like you just need to pick a free streaming service. There's a ton of them out there.
 

Mark Weiss

Member
I guess the best option is to try to find a multicast service that isn't run by overbearing copyright police. Realtime content matching that doesn't need to match closely, but only similar, has been a thorn in my side. For instance, my parrot was singing and I put it on Youtube and that caused a 'content match' and a claim from some record company. Ridiculous.
I'm trying to avoid depending on ANY corporate entity that can shut my stream down for any petty reason. Also, terms can change.. a free streaming service may end and become a payola service. Having it all under my control is what I was hoping to do, but I guess that's not possible.
It would seem that multicasting SHOULD be possible and maybe in a few years, someone will figure out a way to do it.
 
Top