Hacker News new | past | comments | ask | show | jobs | submit login
PeerTube – Federated video streaming platform using P2P directly in the browser (github.com)
173 points by rayalez on Jan 24, 2018 | hide | past | web | favorite | 50 comments

This is really cool ! Framasoft is doing a great job with their project to «ungoogle the internet»[1].

I really wish Mozilla tried doing the same thing, with their much bigger manpower and communication impact.

[1]: https://degooglisons-internet.org/liste?l=en

Un Google the internet? I hope so but almost every remotely commercial site out there uses Google services.

People use Google's services (and other privately owned, and «you are the product», ones) because it's the most convenient way they know about. Sometimes it's because it's the most convenient way (lack of credible competition, self-hosting isn't an option for many companies), and sometimes it's because the alternatives are less known (commercial products based on OpenStreetMap are way better than what google maps offer, but few people know about them).

An organization like Mozilla could make open-source-based and privacy-aware services for many Google products with ease if they wanted to. (I mean, Framasoft is doing it already and it's a really tiny French non-profit organization !)

At least you can block connections to google stuff

Google icon fonts are the bane of my existence.

I think for this to be successful you need to encourage users to server the videos. There are a couple things that might help this:

- Popularity could be based not only on views, but how many total minutes of the video were shared by other people.

- When someone watches a video, they have to keep hosting it until they share as much as they've watched it (so if they watched 10 minutes, they have to share it until they've distributed 10 minutes worth of the video to other people.

In my current model for a distributed video service, peers gain "premium" bandwidth rights in exchange for storing videos, modulated by view count.

Plenty of users would store popular videos to chase after premiums, but it will be similarly profitable for a handful or so of people to host the less popular videos because there will be less competition for views (which are in turn modulated by the amount of data for a video you contributed to a given P2P stream).

This solves the problem of obscure but useful content being phased out.

Make them share for ~10% longer than they consumed for a more robust network.

Most people have terrible upload speeds compared to download speeds. In my neighborhood most people (by choice because they aren't tech savy and don't care) have AT&T DSL with 40Mbps download but 2Mbps upload. This means that for a good quality 10 minute video at 720p with a bitrate of 3mbps they would have to seed for significantly longer than viewing just to get a ratio of 1 without degrading downstream performance.

Just to add a datapoint to this, my home service is gigabit down... 10 megabit up.

That's 1000 / 10.

This makes me want to go test me upload on my gigabit down connection...

Good point. Equal is probably fine.

An idea of been playing with in my head is a youtube-in-a-box" type device, a machine you would buy that would sit on your home network, essentially a NAS that could publish to video sites or services like peertube. With that sort of device any unused space and bandwidth could be allocated for sharing the videos of others.

LBRY and dtube (and maybe a few others) use a blockchain model, which allows creators to easily get paid by viewer donations as well as by pay-per-view. A good incentive to seed would be to payout some whatevercoin for every view/hour/megabit of video seeded, but I don't think they do that.

It would have been cooler for this to use IPFS instead of its own P2P content distribution.

Still cool though.

It uses WebTorrent, which isn't some in-house PeerTube tech.

IPFS does not work in the browser yet.

It surely does, take a look at js-ipfs for full in-browser node (https://github.com/ipfs/js-ipfs) and also js-ipfs-api for communicating with existing go-ipfs/js-ipfs nodes (https://github.com/ipfs/js-ipfs-api)

Disclaimer: I work at Protocol Labs on IPFS

Does this mean you can actually connect to the real ipfs network from a browser without connecting to a gateway like ipfs.io?

IPFS can work in the browser via sharing over WebRTC but not UDP/TCP.

So it is not great, but does work. WebTorrent is also WebRTC fyi.

The tech isn't quite there yet, but eventually yes everyone's machine could be a CDN of sorts.

that, you cannot

Yes, you can. Please try to make sure the information you write is correct. Quick look at the repository I linked above would have made this clear.

What part of the repository says this? I'm having trouble imaginging how it would work, unless the mainstream IPFS network now supports WebRTC?

Looking at the readme, I noticed our examples our not as featured as I thought so sorry for the harshness. But following the link to the examples, leads to a example called "Tutorial - Transfer files between the browser and other IPFS nodes" which explains how you can connect a js-ipfs node with other nodes, like go-ipfs that runs on desktop. Link: https://github.com/ipfs/js-ipfs/tree/master/examples/exchang...

go-ipfs, which I guess you refer to with the mainstream network, has support for websockets which the browser nodes has support for as well, so they can interop.

Do you now for certain?

Because both the parent post and the repo seems to indicate otherwise and the only reason I ask is because that sounds a little to amazing.

No, the person does not know it for certain. You're correct that it does connect to "the real ipfs network". And you're right that it is amazing!

Thanks for clarifying!

And thanks for working on this project!

D.tube works just fine:


D.tube makes the browser download from a gateway (ipfs.io) using HTTP.

That's true! But nothing is stopping them from putting in js-ipfs into dtube and leveraging everyone who is watching the videos to help host them as well.

You can set it to connect to your own gateway.

Doesn't change the fact that your browser doesn't connect to the ipfs network

also, i believe d.tube uses cryptocurrencies to incentivize participation.

Perhaps also needs onion routing to protect users from liabilities.

It would be nice if one of the ICE options in WebRTC was Tor. Note also that Tor is not the fastest wrt to streaming data.

it says it works in browser so you just run it from tor browser

AFAIK Tor browser deactivates WebRTC to avoid leaking real IPs, so at least the P2P aspect wouldn't work. Not sure if seeding from the server works without it.

I'm not sure how webRTC works in Tor though.

awesome, except it doesn't look like there are any incentives to running a server. unless i missed something?

Like Mastodon et al, this doesn't need to be built on traditional incentives. The incentives are that you want to share cool videos with people. Any one server that gets overloaded with users encourages others to host another server and build a community on it, and the load (and the cost) naturally balances and is distributed across the whole network.

Definitely an interesting digital ecosystem experiment. Hopefully it can sustain itself. Will be interesting to see how it plays out and evolves.

hosting your own content isn't enough of an incentive?

Problem is being able to monetize.

Monetise what? For whom? The thing is distributed, it's not like the host has to shoulder most of the bandwidth costs.

If one wants to live off their videos, that's another problem, but most videos don't mean to be monetised at all —no ads, no Patreon, no nothing.

They can just use Patreon in exactly the same way they do for YouTube.

There is no monetization concern here, the project is sponsored by Framasoft, a French non-profit organization who wants to provide free-software alternatives to services owned by big corporations.

Free is a loaded term.

While it does follow the cryptocurrency craze, this is one of the goals of LivePeer (https://livepeer.org/). They are using the crypto-currency as an incentive to provide streaming services and trying to build an incentive around it.

Most don't get their money from Youtube today. They use patreon, sell stuff and make direct endorsement deals.

That's probably the most critical aspect of any YouTube replacement.

People idealize about a free-as-in-beer video platform but at the end of the day, those don't pay for quality content to be produced. The YouTube of today can only exist with proper income generation.

I have worked through some interesting models for a P2P video platform and a few ideas on how to actually go about implementing advertisements, but I have yet to come up with a solid way of convincing advertisers to play ball on videos whose content they don't like.

Currently experimenting with the idea of having two tiers of advertising, a cheap and "premium" tier, and only the premium tier allows you to be selective about which videos your ads run on. The cheap tier videos would have a chance of playing on "premium" (high-engagement) content, but would generally play on "regular" content.

The problem is this system still wouldn't likely wouldn't result in a worthwhile payout for more "controversial" producers even if it protects semi-popular non-leftist producers, so an integrated "Patreon"-style donation-subscription service might be something worth exploring.

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