How create custom channel using a remote Channels DVR server as a video source

Per Tailscale status page, both machines were active and also showed active under the settings section of both DVR servers. I was testing using a web browser vs a client. I suppose I could add Tailscale for the windows machine, but seems like that wouldn't be necessary if the Host Server is sharing with the Client Server which in turn feeds the local clients.

Just an FYI.
When connecting to a Channels DVR using tailscale, if using the Channels DVR built-in tailscale you don't specify the port#. i.e. 100.100.100.100

If instead using tailscale on the server device (and not the Channels DVR built-in tailscale) you must specify the port#. i.e. 100.100.100.100:8089

Not sure on other installs, but I know this is true for a Synology NAS.

So installed Tailscale at the OS Level for my Home DVR Server and have Tailscale installed at the Channels DVR Server level on the remote server.

Home DVR Server = 1.1.1.1 (as an example) <- Tailscale enabled at OS Level (Synology NAS)
Remote DVR Server = 2.2.2.2. (as an example) <- Tailscale enabled at the Channels DVR Server Level
Confirmed both IP addresses are valid (I can access the remote server from my home network using the following:

http://2.2.2.2:8089/admin/settings

I used the below to create a custom channel on my Home DVR Server:

#EXTM3U

#EXTINF:-1 channel-id="1.9" tvg-id="1.9" tvg-chno="1.9" tvg-logo="https://tmsimg.fancybits.co/assets/s28708_ll_h15_ac.png?w=360&h=270" tvc-guide-stationid="51960" tvg-name="WCJBDT" group-title="HD",ABC
http://2.2.2.2:8089/devices/ANY/channels/6001/hls/master.m3u8?

I'm still not able to get a live feed. Current error looks like this:

2023/08/28 21:29:26.502289 [ERR] Failed to start stream for ch1.9: M3U: Could not fetch playlist: 2.2.2.2:8089 (Timeout): Get "http://2.2.2.2:8089/devices/ANY/channels/6001/hls/master.m3u8?": context deadline exceeded

Will it work if you set up a custom source with hls and url with this as the url

http://2.2.2.2:8089/devices/ANY/channels.m3u?bitrate=3000

You may need to follow these additional steps on your Synology to get Tailscale to fully work:

The latest DVR pre-release now will support connecting two DVRs over the integrated Tailscale support without needing to install it on the OS.

Thanks for reporting this.

1 Like

Doesn't seem to matter for me which method is used, is the any benefit for omitting the port?

@eric
I've been testing using TailScale rather than using a session cookie and seem to have some amazing results. Rather than using HLS, I am able to use direct TS over WAN (~40ms latency) without issue. The individual channels are output in this format...

http://X.X.X.X/devices/ANY/channels/XX/stream.mpg?codec=copy&format=ts

There is no transcoder activity on the sender side and the channels start much quicker. Is TailScale just that much better at routing?

Also, is "codec=copy" needed or can I omit that and only specify "fortmat=ts"

Are you using URL as source or text? I've tried both and using your below code (obviously adjuting for my remote server IP and the correct channel number) and I get the following error. Usually I'm overlooking something obvious as I only understand about 20% of the code in these things.

I am able to use it with the transcoding, but as you pointed out, takes a while to load and I don't want to overtax the remote server as it's a entry level synology NAS (j series I beleive).
image

You can omit both. The stream.mpg endpoint is the raw TS that Channels uses. Both codec=copy and format=ts are redundant and superfluous.

The only downside of this is any TCP packets that get dropped will cause the stream to stall for much longer than using HLS which will retry the connection internally overcoming the TCP back off algorithm.

1 Like

May have changed with the latest prerelease (haven't tried), but it didn't work previously if you tried to specify the port# when connecting to a Channels DVR server with its built-in tailscale enabled. I have 4 servers, in 4 docker containers, using 4 different ports.

Nice, so if I have a work DVR in one location and a home DVR in another, I can turn on Tailscale on both DVR’s, and be able to access the work’s OTA channels at home? I’d just need to turn on Tailscale on my clients too? But what about the (mobile) work clients, if they are only accessing the channels from the work DVR, will they need Tailscale enabled too?

Just curious before diving in, trying to understand any caveats ahead of time. What a cool feature!

Tailscale is fantastic. When you dive in I recommend using both the integrated version in the channels clients (which will assign tailscale ip addresses to them) as well as using the stand alone app on your devices if possible (which will assign them a second tailscale ip address). There is no tailscale app for the apple TV for now, so you will have to use the built in support. Apple is planning on building the vpn support into the apple tv in TVOS17, and tailscale will hopefully release an app for the apple tv soo after that.

The stand alone app method has some advantages over the built in tailscale support with the way the guide loads remote channels and remembers your last used connections.

Yes i think so. I havent tested this.

If your work DVR is behind a cgnat, you will need tailscale. Whenever you use tailscale you connect to the DVR using “At Home”. If you are on the road, you could get into the second DVR by connecting to it using the Away From Home feature if the dvr port is exposed. But you will need to check with the developers to see if there is a restriction for how many “away from home” dvrs can be alive at once. Im not sure. I only use tailscale because in my case all my DVRs are behind cgnats.

1 Like

No, in the best case Tailscale will give you the same situation you had going directly (just without having to worry about ports and authentication) but in the worst case, could have to go through a relay node that gives you worse performance. There's nothing magical about Tailscale that would make it better than going directly in regards to performance.

If we're talking specifically about using these m3u's to export channels from one DVR to another, your clients do not need to have any sort of Tailscale enabled to be able to play the channels that are exported. They just need to connect to the DVR they're connected to and all traffic is sent through the connected DVR.

Using the native Tailscale integration that your OS has on your client will give you a better experience if it is available (the discovery situation you mentioned). Our integration on the client is purely there for the cases like tvOS where it is not yet possible (as you mentioned).

Considerings how good TCP BBR is do you think it is worth it to use HLS and have the longer remux wait time? I haven't scientifically measured the difference but it seems quicker to load.

You can search for my post on the M3U Export Documentation. Here is the text format I have...

#EXTM3U

#EXTINF:-1 channel-id="NAME" tvg-id="125" tvg-chno="125" tvg-logo="https://tmsimg.fancybits.co/assets/s91096_ll_h15_ae.png?w=360&h=270" tvc-guide-stationid="91096" tvg-name="NEWSNTN" group-title="HD",NEWS NATION HD
http://x.x.x.x/devices/ANY/channels/68/stream.mpg?format=ts

Honestly I think it's going to be the sort of thing where after a year of running it this way you'll have an idea of how many times you ran into issues with the stream stalling and never recovering or had interrupted recordings.

The way the direct MPEG-TS TCP stream works is a single uninterrupted TCP connection. With HLS, it's making new HTTP requests for each segment as well as retrying the connection, so if there were 2-5 seconds of packet loss, the HLS stream would recover from it much more quickly than the single TCP connection would.

As a reminder, there are no arguments required for the stream.mpg (that ?format=ts isn't needed and doesn't do anything).

In this scenario, how do the two servers operate? Is there a buffer on each server?