Live data from Hacker News

Ask HN: Why is there no P2P streaming protocol like BitTorrent?

news.ycombinator.com

121–130 of 231 posts

Re: Ask HN: Why is there no P2P streaming protocol like BitTorrent?

#121
I built a proof of concept doing exactly that a few years ago[0]. The codebase is unmaintained and the demo website has been down for a wee while too, but it's basically this idea. Only issue is that the overhead to establish WebRTC connection is heavy, so it's not exactly lightweight...

0: https://github.com/pldubouilh/live-torrent

Re: Ask HN: Why is there no P2P streaming protocol like BitTorrent?

#122

Earlier quoted context omitted.

If I remember correctly, PopcornTime was able to stream via BT. Your claims are mostly correct, but I think some compromises can be made to make BT clients streaming proof. For example: 1. locally-randomizing segments download order 2. Create a larger buffer 3. Prioritize parts coming from slower connections

This is still just streaming a static file though. Adjusting which segment to get will work, buffering will work, and people don't mind their movie starting a few seconds after they press play. If I'm streaming live, I need the frame immediately, and it doesn't help much to get later frames after the frame I'm missing.

Live streaming is, by nature, a "one-to-many" distribution model, where content flows from a single source to many viewers in real time.

BT, on the other hand, is fundamentally designed for "many-to-many" distribution, where peers share pieces of content with each other over time. This isn't just a question of tweaking the protocol—it's a fundamentally different problem. Unless you're willing to compromise on the immediacy of the stream, using BT for true live streaming isn't really a good fit.

Re: Ask HN: Why is there no P2P streaming protocol like BitTorrent?

#123
post #87

Earlier quoted context omitted.

If we are talking about a live stream (and not a stream of a static file), having the start be more seeded is useless.

mpeg stream / TS filetype / DVB-T/C/S broadcast IS static file, all 3 is same format, this format deals with every point you made... download specs and educate yourself. same with streaming audio, chunk IS static file, so every phone call you made last 30 years is static file.

and there is no reason for bittorrent to not being able to send/download 3000 TS chunks / static files for 3 hour movie in sequential order.

and no reason for your MPV/VLC/PotPlayer to not render that in sequential order.

even when you have only first 2 pieces.

Re: Ask HN: Why is there no P2P streaming protocol like BitTorrent?

#126

Earlier quoted context omitted.

If everybody starts at the start then it will be very poorly seeded when everybody wants it, before the being well seeded right when nobody needs it.

"well seeded" means what exactly? if i can send 2 copies of piece to 2 people immediately as i got it, then if my download takes 20 ms and sending it another 20 ms is it "well seeded" for those 3 people after 50 ms? or after how much time it is "well seeded" ?

A precise answer to that question entails more math than I'm willing to do right here in the middle of my Easter holiday. You should understand my argument more as a sketch of proof.

That being said I have a small correction. If you want to stream to two peers (that is you have a network with 3 fully connected nodes, one being the originator of the stream) and the link latency for all links is 20ms, then your lowest latency path to each node is exactly 20ms, as the originating node could simply send the content to each client.

The unfortunate realization is that 20ms is then also the optimal stream delay, assuming you care about the shortest possible latency for your live streaming service. The clients will therefore end up with the content exactly when they were supposed to show it, and therefore they would have no time to forward it to anyone else, lest that downstream would get the content AFTER they were supposed to show it.

Re: Ask HN: Why is there no P2P streaming protocol like BitTorrent?

#127
post #2

People have tried to build BitTorrent clients to do this. As far as I know they never took off. The primary problem is you oftentimes don't get people who want to share back or who have firewalls or other connections that don't allow them to share back. So you end up with a few people who end up seeding everything out. The second problem is in order to watch a streaming protocol things need to arrive in order. It is…

Popcorn Time did this and it worked great. Starting a torrent wasn't instant, but once a buffer was built up, it streamed just fine. Popcorn Time got taken down pretty hard because they became too popular too fast. A commercial solution could have a seed server optimized for streaming the initial segments of video files to kickstart the stream, and let basic torrents deal with the rest of the stream.

Popcorn Time still works and used by everyone who cares. It's just not as hyped anymore.

Re: Ask HN: Why is there no P2P streaming protocol like BitTorrent?

#128
The real reason is that bandwidth is dirt cheap, if you know what are you are doing at scale.

For 'hobbyists' there is a lot of complexity with setting up your own streaming infrastructure compared to just using YouTube or Twitch.

Then for media companies who want to own it, they can just buy their own infra and networking which is outrageously cheap. HE.net advertises 40gbit/sec of transit for $2200/month. I'm oversimplifying this somewhat, you do have issues with cheap transit and probably need backups especially for certain regions. But there isn't much of a middleground between hobbyists and big media cos.

For piracy (live sports streams), I've read about https://en.wikipedia.org/wiki/Ace_Stream being used for this exact purposes FWIW. This was a while back but I know it had a lot of traction at one point.

Re: Ask HN: Why is there no P2P streaming protocol like BitTorrent?

#129

you can install Qbittorrent client, after loading torrent file/magnet link, right click on that torrent and click on Download in sequential order. torrent PROTOCOL does not require to download random pieces, in random order. ONLY bittorrent, inc. COMPANY which releases "Utorrent" and "Bittorent" NAMED APPLICATIONS/PROGRAMS does not want legal trouble from media/music companies. Because STREAMING is other legal catego…

I believe there is actually a reason why you want to transfer random blobs instead of from the start: it is waste of resources when a node needs to upload the same block multiple times to the network, if it could be uploading different blocks.

> if you need instant nanosecond delayed stream

I believe nobody was suggesting that.

Re: Ask HN: Why is there no P2P streaming protocol like BitTorrent?

#130
The degree of difficulty for building this is the premise of the 2001 movie Antitrust from back in the old days when Microsoft was evil. Notable as one of the first movies to use Linux desktops and reasonably correct shell script and code in all of their screen shots.
Post reply on HN