Peer-2-peer realtime content streaming #5638
-
Hello. I wonder if it is possible to revive it anyhow. I mean, I need a software for video conference (we planned to have an offline one (speakers show slides, then get questions and respond to them), but COVID has hit and the offline one has been prohibited) not relying on servers. I mean I don't want to use Zoom because it is proprietary and a web service. ACE Stream is also proprietary, and has bad fame of collecting telemetry. So a very naïve design is following. Let we have a local udp server. Just emits datagrams to loopback and just listens for datagrams on loopback. Each datagram gets a sequence number and a timestamp, then content is encrypted, then everything is authenticated (or maybe AEAD) and sent to peers. Peers then verify packets authentications, if they are is correct, they redistribute the datagrams to each other. Counter mode is used for encryption, the counter is the udp packet sequence number on source side (so it is sent unencrypted). On receiving side the server just recreates udp packets with own headers and sends them to loopback. Maybe both server and client sides have some filters (i.e. by port) to avoid unneeded datagrams to be relayed. Also all peers get expiration time, after which they stop relaying the datagram. Having all the peers being able to read and even record the stream is OK. But they should not be able to fake it. Is this design suitable for real time distributed low-latency real-time video conference with offloading bandwidth to peers? Also, can Tribbler be utilized for that, I mean I have no time to design a P2P library? Also found this: https://github.com/mafintosh/torrent-stream , but it is too tied to node.js. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
Hi and thanks for your suggestions! Note that we support video streaming of libtorrent content, and we have a special streaming endpoint in the Tribler core for this purpose. We recently removed the built-in VLC video player in the GUI since it was not working very well. Now, peer-to-peer live streaming is harder. In the past, we have experimented with mutable torrents to partially support peer-to-peer live streaming, but this did not yield good results. Therefore, peer-to-peer live streaming is something that we would like to have in Tribler for the long term. The short term goals are stability and minor improvements. Maybe @egbertbouman can further comment on your proposed design? 👍 |
Beta Was this translation helpful? Give feedback.
-
Since UDP makes no guarantees on delivery, you'll probably want some protocol on top of UDP. Many years ago, we used libswift for this. However, we removed it from Tribler because of maintenance issues. It did work pretty well from what I remember, although I wouldn't recommend trying to revive it. Currently, if you use Tribler for video streaming it's using either TCP or uTP (the protocol BitTorrent uses for UDP transfer). Note that uTP uses LEDBAT for congestion control, meaning that it will yield to TCP traffic. So, if you want to use UDP for live streaming, you're probably better using something like WebRTC. There are Python libraries for this (e.g. see aiortc for a I'm not a streaming expert though, so I may be giving bad advice. |
Beta Was this translation helpful? Give feedback.
-
Does it (or the IETF standard) have any fundamental issues?
Can it (or other implementations of the protocol) provide the reasonable quality for 720p (internet says it is about 4 MB/s of bitrate for h.264, h.265 can also be tried, h.266 I guess cannot because I see no free open-source codecs) for ~100 peers? |
Beta Was this translation helpful? Give feedback.
-
Unfortunately, no one currently in the team (including myself) has any knowledge of the inner workings of the protocol. So, I can't really comment on its performance or any possible issues the protocol may have. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the info anyway. |
Beta Was this translation helpful? Give feedback.
Since UDP makes no guarantees on delivery, you'll probably want some protocol on top of UDP. Many years ago, we used libswift for this. However, we removed it from Tribler because of maintenance issues. It did work pretty well from what I remember, although I wouldn't recommend trying to revive it.
Currently, if you use Tribler for video streaming it's using either TCP or uTP (the protocol BitTorrent uses for UDP transfer). Note that uTP uses LEDBAT for congestion control, meaning that it will yield to TCP traffic. So, if you want to use UDP for live streaming, you're probably better using something like WebRTC. There are Python libraries for this (e.g. see aiortc for a
asyncio
library).I…