Chocobozzz / PeerTube

ActivityPub-federated video streaming platform using P2P directly in your web browser
https://joinpeertube.org/
GNU Affero General Public License v3.0
12.78k stars 1.46k forks source link

"PeerTube Firefly" - p2p video hosting and streaming (optional feature) #2410

Closed ghost closed 3 years ago

ghost commented 4 years ago

cc0-photo png

A firefly becomes visible only during twilight, just like people will be able to watch videos through this feature only when other users "will become visible" a.k.a seed.

I think it's important to give this feature a name (it can be a different one) because some people due to lack of knowledge will probably misunderstand it and they'll want to blame "PeerTube", but if we give this feature a separate name, they'll know that this is just a small feature that doesn't represent the whole PeerTube software.

If it sounds so bad, why should we implement it? It may sound bad but there are ways to reduce its downsides (like displaying a warning) and well, it has its own big advantages (like no need for big server storage) and there are other big platforms which do only that (e.g. bitchute) and people really seem to need this.

So what is this about? This feature is about giving people the possibility to upload torrent files (which are a few kilobytes in size) and thus create "Firefly videos" which people can watch as normal videos (if at least 1 person is seeding it).

Other methods to reduce its downsides:

Similar issue https://github.com/Chocobozzz/PeerTube/issues/1524, but it was a question and rather incomplete. So I've decided to create this one.

rigelk commented 4 years ago

There are some technical difficulties with that kind of functionality:

There is a third point, but it can non-trivially be solved by forcing clients to use the instance WebTorrent tracker which would count peers :

Sorry if that sounds negative, but I prefer to start with the technical overview so that we are on the same page.


side note: I had already checked BitChute. Their model has been put into question for some time now: https://www.dailydot.com/layer8/bitchute-decentralization-claims/

tilllt commented 4 years ago

I had to read the post several times to understand the proposal. but i am not sure i did. Is the idea is to have a "storageless" (or minimal storage) server?

ghost commented 4 years ago

@tilllt

Is the idea is to have a "storageless" server?

Yes, people will only upload torrent files (which are a few kilobytes in size) instead of entire videos (an average 1 min 4k video has around 400MB). And when playing such a video (Firefly video), the PeerTube server will only act as a bridge between the viewer and other seeds and peers, connecting them all together.

@rigelk

Sorry if that sounds negative, but I prefer to start with the technical overview so that we are on the same page.

That's fine, I totally understand this. Thanks for showing interest for this suggestion :)

  • videos need to be transcoded at some point to ensure they are compatible with all devices (ensure they have the right format, codec, etc.) and have varied bitrates to fit the tubes. That means storing them in the end, too.
  • to provide thumbnails, previews, and other metadata like the length of the video, the file has to be downloaded by the server first for analysis.

What if we let the user first upload the original video, then the server will do all the transcoding, generate as many .torrent files as it needs (for each format, etc), analyze metadata, etc and then delete it?

Regarding the third point I have nothing to say (because I'm not that technically knowledgeable) except for: Let's accept the drawbacks and add this as a warning for the server admins that would like to enable PeerTube Firefly. At least until we find a better solution.

https://www.dailydot.com/layer8/bitchute-decentralization-claims/

Yes, Bitchute isn't decentralized, but can PeerTube's Firefly videos be federated?

tilllt commented 4 years ago

Wouldnt it be more logical if the local user fired up a peertube instance (i.e. in a docker or VM), federates with the server it wants the video to show, and just hosts a temporary instance?

ghost commented 4 years ago

Firefly videos aren't "disposable", they get hidden only when all seeds are offline, the moment at least 1 seed is online, the video becomes visible (available) to everyone, hence the name - firefly.

rigelk commented 4 years ago

The moment at least 1 seed is online, the video becomes visible (available) to everyone, hence the name - firefly.

Another problem, not inherent to you suggested feature but that impacts it, lies in the fact that most long-term seeding clients are legacy BitTorrent clients that don't support WebTorrent. That greatly reduces the capacity of a visitor to help seed the video without being very knowledgeable.

ghost commented 4 years ago

Good point. We can tho 'fix' this by recommending people to use a BitTorrent client that has support for WebTorrents, such as:

  • WebTorrent Desktop - Open source streaming torrent client. For Mac, Windows, and Linux.
  • Vuze - Powerful, full-featured torrent client
  • Playback - Open source JavaScript video player (super cool!)
  • webtorrent-hybrid - Node.js package (command line and API)
  • Instant.io - Simple WebTorrent client in a website
  • βTorrent - Fully-featured browser WebTorrent client (source code)
  • TorrentMedia - Desktop WebTorrent client

https://webtorrent.io/faq

And I suspect that in the near future this will not be an issue, because of the usual tendency for software to add more features. I've visited a few popular bittorrent clients and they all are tracking this issue :-)

ghost commented 3 years ago

Two youtubers have complained about PeerTube being too resource-hungry: https://videos.lukesmith.xyz/videos/watch/bd0ebff8-245c-4092-a1fa-b604086a460e and https://www.youtube.com/watch?v=0_AZ_jgzNog.

This suggestion (https://github.com/Chocobozzz/PeerTube/issues/2410) could really help encourage those who can't afford a powerful server, to host a peertube firefly. _

So what is this about? This feature is about giving people the possibility to upload torrent files (which are a few kilobytes in size) and thus create "Firefly videos" which people can watch as normal videos (if at least 1 person is seeding it).

An extra option, which could be more suitable in some other circumstances: Turn on peertube firefly and disable the original server seed when at least 1 (can be any number) or more seeds already exist! So if a single person is watching a video, then he watches it the normal way (from the server seed), but if another user starts watching that same video, then the original server seed stops seeding and the first user (and/or some other instance(s) which have enabled server redundancy) becomes a seeder instead. If/when the first viewer leaves, then the server seed starts seeding again. The idea here that there has to always be at least 1 seed, and the original server seed would like to not seed, unless it's really necessary (there is no one else willing to seed).

Another problem, not inherent to you suggested feature but that impacts it, lies in the fact that most long-term seeding clients are legacy BitTorrent clients that don't support WebTorrent. That greatly reduces the capacity of a visitor to help seed the video without being very knowledgeable.

@rigelk this is no longer an issue https://feross.org/libtorrent-webtorrent

rigelk commented 3 years ago

Another problem, not inherent to you suggested feature but that impacts it, lies in the fact that most long-term seeding clients are legacy BitTorrent clients that don't support WebTorrent. That greatly reduces the capacity of a visitor to help seed the video without being very knowledgeable.

@rigelk this is no longer an issue https://feross.org/libtorrent-webtorrent

It still is an issue, since the improvement mentioned by the article you cite is only a first step towards wider webtorrent support in desktop applications. It concerns libtorrent, but is not yet part of a libtorrent release nor RC for that matter. And then, rtorrent and libtransmission are not covered either. Nor are new releases of the clients that depend on these libraries immediately out there after the libraries' release - which is the real indicator.

Chocobozzz commented 3 years ago

Hello,

Closing this interesting discussion, that is out of the scope of PeerTube