Chocobozzz / PeerTube

ActivityPub-federated video streaming platform using P2P directly in your web browser
https://joinpeertube.org/
GNU Affero General Public License v3.0
12.89k stars 1.48k forks source link

Support redundancy for live streaming #3551

Open chrisko88 opened 3 years ago

chrisko88 commented 3 years ago

Describe the problem to be solved I am planning to create a group of instances that should serve videos to >10k viewers an hd stream with mostly static content to >2500 viewers (-> multiple GBit/s) which will happen once or twice a week. Unfortunately, bandwith on many normal servers is expensive, especially when looking at speeds above 1 GBit/s.

There are other ways of getting a high bandwith for less money. My idea was to use multiple high speed seedboxes or other similar non-root servers, for example from feralhosting. The problem is, that such options do not offer root access.

But

Describe the solution you would like:

I would like to know if there is any way of creating a php or js script which I can put in my webserver directory. This should not be a real instance, but a "relay" I can add to my instance(s). It should spread the stream or video via torrent/p2p.

This would be really useful for anyone wanting to upgrade their max possible peak bandwith for live streams or videos with unusual many viewers. PeerTube is growing rapidly and I guess that more people will have that issue in the future.

Describe alternatives you have considered

I looked for dedicated uplinks with 10 GBit/s, but they are pretty expensive. Using servers as described above, I could realize it with less than 50€ per month. (Average of 2 GBit/s per server (measured it) * 4 servers = 8 GBit/s ; I can get one for 10€ per month)

test2a commented 3 years ago

If you are using Peertube, p2p should help you reduce your bandwidth already. As more people join, your load should reduce onbthe original server. Have you done any tests yet, a dry run maybe

Chocobozzz commented 3 years ago

Hello,

You could create multiple peertube instance and use redundancy if you plan to serve VOD content. See https://docs.joinpeertube.org/admin-following-instances?id=instances-redundancy for more information

Chocobozzz commented 3 years ago

Sorry I see you talk about live streaming. Redundancy for live streams is not supported yet.

test2a commented 3 years ago

I have had the idea of using a seedbox which has webtorrebt support. Theoretically that should work.

rigelk commented 3 years ago

@test2a that doesn't work for the latest HLS over WebTorrent.

chrisko88 commented 3 years ago

I think redundancy for live streams would be really important, since they will cause the biggest traffic spikes.

For videos, I surely could set up an other instance. But as I described, high bandwith can be bought way cheaper when using seedboxes etc. (they would probably also be donated by some users, since they can usually be bought without directly revealing your identity). The problem is, that they do not offer root access, which makes me unable to set up an instance.

This is why I suggested some kind of minimal script, which only seeds videos/live streams and which also can be installed without root. @Chocobozzz

Webtorrent is not an option, since it does not support HLS. @test2a

P.S. P2P between clients is not really what I want, since this would make their IPs public.

chrisko88 commented 3 years ago

@Chocobozzz Do you think you will implement this feature? And how would decentralized streaming affect the delay?

I have to decide between an expensive 10 Gbps and a cheap 1 Gbps server for the main instance soon.

scarab714 commented 2 years ago

Hello all

Redundancy especially for live streaming is also something we need more than anything else.

What is the status of this feature?