braice / MuMuDVB

A DVB IPTV streaming software
http://mumudvb.braice.net/
GNU General Public License v2.0
216 stars 133 forks source link

Multi Tuner / single config file #239

Closed whittinghamj closed 5 years ago

whittinghamj commented 5 years ago

Hi guys,

So I have multiple octo tuners from TBS.

I can run multiple mumudvb's with a config file per tuner and thats fine but that uses multiple HTTP ports for unicast which I dont like.

I thought I could specify the different tuners in one single conf file with one http port but it doesnt seem to be working.

Here is my config file

############### multicast_ipv4=0 unicast=1 port_http=1202

card=0 tuner=0 autoconfiguration=full freq=10773 pol=H srate=22000

card=1 tuner=0 autoconfiguration=full freq=10714 pol=H srate=22000

Any suggestions would be great.

thanks

kslimani commented 5 years ago

You could use a proxy server like Nginx which listen on your desired port and proxy pass to each mumumdvb custom instances/ports using, for example, a path nomenclature.

whittinghamj commented 5 years ago

Yeah, I thought of that but I'm stuck on the older TBS MOI with Matrix TV. WGET and CURL dont work so can't install remote software which sucks. NGINX was my first thought.

kslimani commented 5 years ago

I never tested TBS MOI with Matrix TV, so i don't know how it works.

From my understanding :

1 tuner = 1 frequency = 1 MuMuDVB instance = 1 tcp (http) port (if enabled in config).

This is why i thought about Nginx. For example adapter0 listening on 127.0.0.1 on port 8000, adapter1 on 8001, etc... then use something like :

server {
  listen 80;
  listen [::]:80;

  server_name example.com;

  location /adapter0 {
      proxy_pass http://localhost:8000/;
  }

  location /adapter1 {
      proxy_pass http://localhost:8001/;
  }

 # etc...
}
Saentist commented 5 years ago

If using some re-streaming portal there is no problem to have even different port on any service. Nginx can be used with more smart scenario mumudvb > nginx + nginx-rtmp-module

whittinghamj commented 5 years ago

Thanks for the suggestion but I run into issues when I try your code.

So, using

location /adapter1 { proxy_pass http://localhost:8001/; }

loads the Mumudvb home page but then non of the links work.

I load channels_list.html and it errors out with a mumudvb page but there is nothing displayed which is odd. Mumudvb channels_list.html lists the channels when I access the URL for that page direct without the proxy.

Any ideas please? I'm still new to NGINX 👍

kslimani commented 5 years ago

You are correct. It seems that urls in http responses are "absolute". (adding /adapter prefix will lead to 404 not found http errors. I missed that issue, sorry).

A possible workaround could be to use sub-domains. but it require custom dns server or adding entries in client computer network configuration. (not sure if it worth the effort to be able to use single http port)

whittinghamj commented 5 years ago

Actually I was able to do some digging with Google and put something together that works.

Its not point, click, stream but it gives the info needed to build a valid stream URL and the proxy does do what its meant to do.

If I get time, I might write something and share it on here.

Thanks for pointing me in the right direction.