Posted by memet_rush 5 days ago
Ask HN: Why is there no P2P streaming protocol like BitTorrent?
I was thinking most people nowaday have at least 30mbps upload and a 1080p stream only needs ~10mbps and 720p needs ~5ish. Also i think it wouldnt have to be live, people would definitely not mind some amount of lag. I was thinking the big O for packets propagating out in the network should be Log(N) since if a master is sharing the content then is connected to 10 slaves, then those connected to 10 other slaves and so on.
The other limitation I could think of is prioritizing who gets the packets first since there's a lot of people with 1gbs connections or >10mbps connections. Also deprioritizing leechers to keep it from degrading the stream.
Does anyone have knowledge on why it isn't a thing still though? it's super easy to find streams on websites but they're all 360p or barely load. I saw the original creator of bittorrent was creating something like this over 10 years ago and seems to be a dead project. Also this is ignoring the huge time commitment it would take to program something like this. I want to know if this is technically possible to have streams of lets say 100,000 people and why or why not.
Just some thoughts, thanks in advance!
Surprisingly the channels that are available work really well if you just use the mpegts stream.
In a past life I've added a few channels to a tvheadend instance on a VPS. It reliable crashed Kodi watching some channels and I've wondered if it's just broken streams or something more interesting is going on.
If you open the ports and watch popular channels it's easily saturating bandwidth - there is no limit.
I've since stopped using it it's the kind of thing that breaks not often enough to be not useless but often enough to be annoying.
It's IPv4 only and seems to use it's own tracker or at least calls to some URLs for initial peer discovery.
Building something similar as true open source would be great but I guess the usecase is mostly illegal streaming.
Be careful - it's attempting to use upnp to open ports on the router and even if just looking through the lists makes you upload fragments.
Still fascinating tool. It's getting to close to what op is looking for but I think it has scalability issues and everything about it is kind of shady and opaque.
I was hopeful about bittorrent-live when that was announced, but they didn't open source that for some reason either.
The real reason is centralised architecture gives them control and ability to extract rent.
What are you talking about?
YouTube has a lot more costs than bandwidth. And a lot of ads and Premium revenue goes to creators.
Or to get back to your original question: https://docs.joinpeertube.org/use/create-upload-video
edit: Your'e not limited to these addresses, for one there are other instances, for another you can selfhost your own, if your'e into that.
Technically that is one of many possible solutions, 'ready to roll' right now.
addit: Regarding sustainability, and who is behind it, maybe https://framasoft.org/en/ would be of interest?
Linked from there https://framablog.org/2024/12/17/peertube-v7-offer-a-complet...
and
I just meant like never caught on as in like it's not super popular, but looks like it's on the come up. would be nice to have a real youtube competitor lol
If that's your thing. And you have some sort of presence online elsewhere, then you can link to peertube, no matter which, or selfhosted, without problem.
That's why I pointed you to it. If you need/want the most massive audience, because of platform familarity/network effect, then probably not. At least not now. But someone has to start somehow :)
Orchestrating p2p realtime video distribution is going to have a lot of problems, and spend VC money until someone acquires you is just a lot easier.
Here's a small list of challenges you'd face:
You'll need to have a pretty good distribution network to handle users who just can't manage to p2p connect.
Figuring out the right amount of user's bandwidth you can use without people getting upset; there's a lot of internet accounts with bandwidth quotas, especially for mobile
Trying to arrange so that users connect to users with the least transmission delays would be needed to reduce overall latency. Between cross oceanic connections having unavoidable latency, the potential of buffer bloat, and having a reasonable jitter buffer, pretty soon you have wild delays and potential rebuffering.
Bandwidth constraints / layer switching is going to be a big challenge; it's one thing when your server can just push the best stream the client can manage, but if you're streaming from a peer and the stream is too big, the peer probably doesn't have a smaller stream to switch to and there's no good way to know if where the bandwidth constraint is ... maybe you should switch to the same stream from someone else or maybe you should switch to a smaller stream. Can you get even packets from one peer and odd packets from another ... should you?
They use bao hashing which is something that I discovered through them (IIRC) and its really nice.
Could create such a protocol though bittorrent/ipfs is fine
I once wanted to create a website which was just a static website.
and I used some ipfs gateway to push it with my browser and got a link of that static website, all anonymous.
Kind of great tbh.
There are other genuinely useful crypto projects (like Monero for privacy and I don't like the idea of smart contracts)
I really want to tell you the fact that most crypto is scam. These guys first went into crypto and now I am seeing so much crypto + AI.
As someone who genuinely is interested in crypto from a technology (decentralization perspective)
I see transactions as a byproduct not the end result & I see people wanting to earn a quick buck feel really weird.
Also crypto isn't safe. I just think like now its better to correlate as a tech stock though 99% of the time, its run by scams, so absolutely worse.
The technology is still fascinating. But just because the technology is fascinating doesn't mean its valuable. Many people are overselling their stuff.
That being said, I have actually managed to use crypto to create a permanent storage (something like ipfs but its forced to store it forever) , so I think this can be used where anonymity/decentralized is required. But still, this thing could be done without including money in the process as well & crypto is still not as decentralized as one might imagine.
Iroh contributor here. I don't know what you are referring to. Iroh is just a library to provide direct QUIC connections between devices, even if they are behind a NAT. We don't have any plans doing a blockchain or an ICO or anything like that.
I am not aware of any project called Iroh that is a scam, but if there is, please provide a link here. It's not us.
I know there have been some scammers trying to make a BLAKE3 coin or something, a year ago.
My only gripe with iroh currently is that its browser wasm feels too much for me/ I don't want to learn rust.
So I actually wanted to build something that required connectivity and I used nostr because nostr is great for website and not gonna lie ,its awesome as well (but nostr is also riddled with crypto bros :( )
I have nothing against crypto in principle, but I really don't want Iroh to be associated with crypto scams.
Iroh is just a library for p2p connections. You can use it for crypto, but I would say that the majority of our users are non-crypto(currency).
We will try to make the wasm version easier to use, but if nostr works well for you, go for it! Not the right place if you want to avoid crypto bros though :-)
For livestreams there's AceStream built on BitTorrent, but I think it's closed-source. They do have some SDK but I never looked into it. It's mostly used by IPTV pirates. I've used it a few times and it's hit-or-miss but when it works well I have been able to watch livestreams in HD/FullHD without cuts. Latency is always very bad though.
Then for video-on-demand there are some web-based ones like PeerTube (FOSS) and I think BitChute? Sadly webtorrent is very limited.
I think your other constraints (tree topology & connection prioritization) already describe how BitTorrent works.
I think there's one thing you'd need to change for /live/ streaming, where the file is actually being created /during/ broadcast-- I think the file verification hash systems require the seeder to have the entire file when initially seeding. I think magnet links and .torrent files are based on a hash of the entire file. Do maybe you need some kind of modification to DHT , .torrent , .magnet , to support verification by sequential chunks.
Such a shame that it failed, nothing after it ever came close.
It is a thing.
For live streaming there is WebRTC. It is also a thing.
All of it started with the webtorrent project though. One of the first demos was booting Ubuntu while streaming the incomplete live ISO image, quite impressive for the time.
This is great tech for media files. Currently better than any other. But making it would make those media files very easy to redistribute, and it is hard to change that without loosing the P2Pness goodies.
If Popcorn Time had a synchronized multi-resolution catalog, bandwidth-sensitive auto switch and some paid seed servers, it would be better than any other streaming service (technically speaking).