Hacker News new | ask | show | jobs
by booteille 934 days ago
Hi!

There is a page on official documentation (docs.joinpeertube.org) (which needs to be updated to reflect the removal of WebTorrent but is still relevant on hls parts).

Here is the one concerning us:

" - If using the HLS player (depending on the admin transcoding configuration):

    - The player loads the HLS playlist using hls.js from the origin server
    
    - PeerTube provides a custom loader to hls.js that downloads segments from HTTP but also from P2P via WebRTC
    
    - Segments are loaded by HTTP from the origin server + servers that mirrored the video and by WebRTC from other web browsers that are watching the video. They are used by hls.js to stream them into the <video> HTML element"
3 comments

Am I right in my understanding that sharing the load only happens for people viewing the same video?

Could there be a benefit to P2P distribution of bandwidth that isn't just at the video level, but perhaps at the instance level, where they choose to federate with other instances that also agree to share the P2P load? Or rather, to share the P2P wealth?

That's the p2n layer that already exists in PeerTube through the redundancy feature in federation.

Federated instances that enable redundancy copy all resolutions of a video that meet chosen criteria of popularity. When a user views the video on PeerTube, their browser grabs the sections of the video from any of the PeerTube instances that have a copy, creating an ad-hoc distributed CDN. This covers the mid-level of popularity and keeps the hosting instance from getting slammed on bandwidth.

If something goes viral, or during livestreams which are by nature simultaneous, then the p2p in the browser between viewers kicks in and reduces load on the peering servers even more.

That's great! And along the lines of what I was hoping might be true. A question though: It sounds like you are saying various instances can help each other on a per-video basis, for videos above a popularity threshold.

But what about the prospects of distributing the load that isn't localized to a particular video? As in, users do some peer to peer load distribution of any and all videos above the threshold, regardless of whether it's the one they are watching?

WebRTC isn't great for non-realtime streams where quality is much more important than latency. I hope p2p WebTransport gets standardised soon.
I assume they are using data channels for the transfer, not the webrtc a/v streams.
> also from P2P via WebRTC

Does this mean the list of IP addresses of people currently watching a video is necessarily public?