Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Peertube is something I've been meaning to use, so I'm interested but don't know much about it.

The post says they dropped webtorrent in favor of HLS. Does this mean Peertube is no longer peer-to-peer?

HLS is a codec or container format or something, whereas webtorrent sounds like a method to have peers stream video data to each other such that the server doesn't easily bog down under traffic spikes. That seemed like a fundamental advantage of Peertube over other platforms and I thought that's why the name was chosen. Am I misreading it or has this truly been dropped now?

The post says HLS is also a brick in peer-to-peer streaming but.. it's not? I've used it, it's a container format that encapsulates video data, something like MP4 or MKV, not something that sets up peering sessions. HLS data would rather be something that webtorrent could be gossiping, if webtorrent weren't removed.



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"


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?


PeerTube is distributed streaming, not distributed hosting. The master copy is hosted on some web site, yours or someone else's. If enough people are watching, a peer to peer streaming distribution system kicks in to provide more bandwidth. It's just a way to have many viewers without needing huge hosting bandwidth.

Almost nobody uses PeerTube. Here's the "Trending" list on Hardlimit.[1] 217 views of the top video. A video I posted two days ago to illustrate a bug report is in 9th position, with 14 views. This is pathetic.

Maybe if they got Wordpress integration, so Wordpress sites could serve videos via Peertube, it might take off. And get more sites to support auto-embedding of PeerTube videos, so that just providing a link produces a playable video.

[1] https://video.hardlimit.com/videos/trending


no need to be so dismissive. my instance of peertube doesn't even show up on that indexer you linked. lots of people who make different kinds of fediverse indexers end up excluding a ton of instances by accident or on purpose.


GP takes the time to upload his videos to PeerTube, which I'd say makes him less dismissive than pretty much everyone.


> We needed to settle a technical debt : v6 removes support for WebTorrent to focus on HLS. Both are technical bricks used to get peer-to-peer streaming in web browsers, but HLS is more fitted to what we are doing (and plan to do) with PeerTube


My read is there are trying to do a distributed CDN with peered(federated) instances. They already did that on past, the instances will stream from other peertube servers that had the same content.


This is very confusing to me too. WebTorrents are just torrents over WebRTC Data stream, I guess by "P2P HLS" they mean sending HLS over either WebRTC Data or Video stream?


But if you stream from the server, it still would still not be p2p. SO either they implemented their own custom p2p solution, where the peers stream HLS to other peers, or they abandoned p2p.

edit: the main FAQ on the website still clearly says, it is p2p. But now I am curious if they really implemented their own p2p solution, or if this is outdated.

https://joinpeertube.org/en_US#what-are-the-main-advantages-...


This is what they use https://github.com/chocobozzz/p2p-media-loader forked from novage a while back. Nice explanation with diagrams at the link.

It has worked surprisingly well in my testing during livestreams when you can count on multiple simultaneous viewers.


"WebTorrent is a wonderful library that allowed PeerTube to be created five years ago. But due to many limitations of the library we decided to implement and default to another P2P protocol used in coordination with HLS. This new HLS player works very well, and does not have all the limitations of the WebTorrent player. It also allowed us to implement live streaming in PeerTube."

https://github.com/Chocobozzz/PeerTube/issues/5465


Thanks, now I am really curious to try that out and see how it works under the hood. What I need, would also be the option to ask users first, if they want to upload as well. People on a mobile connection should be able to opt out. (Quick search did not reveal this).


You can find this option in "My Settings", in the left menu.

"Help share videos being played"


Oh, that was easy. Thx.


Their source code is on Github, though took a min to find.

I'm still going through it, but I suspect so far they are transcoding via HLS and then streaming it out over the p2p connection.

The p2p connetion itself is interesting again, I suspect a regular websocket that is sitting on their express server.. but will dig some more. Was always curious .

https://github.com/Chocobozzz/PeerTube/blob/develop/client/s...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: