Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Integrate third party webrtc scalable broadcaster or server

Open maxlinux2000 opened this issue 11 years ago • 39 comments

Imagine being a teacher who wants to teach his students through this chat. Ideally, the teacher can make a broadcast transmission WebRTC with audio, video, screen, files, and that students can record the video on their mobiles / computer.

The scenarios can be manifold : telepresence conferences , live events ...

here some examples: https://www.webrtc-experiment.com/

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

maxlinux2000 avatar Oct 15 '15 18:10 maxlinux2000

+1

在 2015年10月16日,上午2:00,maxlinux2000 [email protected] 写道:

Imagine being a teacher who wants to teach his students through this chat. Ideally, the teacher can make a broadcast transmission WebRTC with audio, video, screen, files, and that students can record the video on their mobiles / computer.

The scenarios can be manifold : telepresence conferences , live events ...

here some examples: https://www.webrtc-experiment.com/

— Reply to this email directly or view it on GitHub.

ghost avatar Oct 16 '15 00:10 ghost

The webrtc-experiment styled multi-users video chat service (or broadcast) is already in the current version of Rocket.Chat, and should be working. See #933. This style of mesh network conferencing is absolutely not scalable.

Scalable broadcast will require infrastructure support (someone has to pay for the server-side bandwidth and computing resources) and integration of third-party (proprietary/patented) server/gateway/cloud services. Modified title to reflect this.

Sing-Li avatar Oct 16 '15 11:10 Sing-Li

mmm.... and connect rocket.chat to http://www.kurento.org/ as third-party server? It's opensource and seem good.

maxlinux2000 avatar Oct 16 '15 12:10 maxlinux2000

The key question is, @maxlinux2000 - would you be willing to set up a server and offer the hosting and bandwidth for us to test during the development phase.

Even if you are willing, how many other users are willing and want to specifically run and manage a kurento server, pay for its resources and bandwidth, in order to use the features described.

Sing-Li avatar Oct 16 '15 12:10 Sing-Li

mmm... ok, I can setup a VPS in digitalocean with kurento and pass to you developper the access. The have only 20GB of space, but for testing is enought.

Obviously the server is only for testing porpouse, but I will write a simple script for auto setup, so everyone can have a private kurento media server for 5$ monthly in digitalocean or other similar company.

Please, still some days in order to setup a VPS for testing. (I need time to study kurento before)

regards MaX

maxlinux2000 avatar Oct 16 '15 13:10 maxlinux2000

Awesome! Please keep us updated.

Sing-Li avatar Oct 16 '15 13:10 Sing-Li

For this feature, I suggest to take a look at jitsi-meet(https://github.com/jitsi/jitsi-meet), which is a mature webrtc based conference platform. Based on my limited knowledge, it uses the SFU as the forwarding core, not the MCU, which needs a lot CPU resource.

xjtufjj avatar Nov 01 '15 12:11 xjtufjj

+1 for jisti-meet or a jitsi-videobridge solution. Janus gateway is another great option

telemakhos avatar Nov 05 '15 18:11 telemakhos

If this becomes an option, it would need to be configurable (i.e. allow rocketchat to use a in house broadcaster and/or render, especially in some situations where internet connectivity is limited or none.

compuguy avatar Nov 12 '15 21:11 compuguy

@Sing-Li If webrtc-experiment can be enabled, and pointed to a server, it needs to be documented somewhere.

compuguy avatar Dec 10 '15 17:12 compuguy

sorry for the delay but i'm stayed very busy for months. I tested kurento, but is very slow (20seconds of delay). May be with a more powerful machine.... So I abandoned kurento and reading above about jitsi-meet I test it.

jitsi-meet is amazing!! :+1:

work just fine in a VPS server with ubuntu 14.04 64bit, 512MB ram - 20GB HD.

here the script to install anc configure it automatly


#!/bin/bash

echo "LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
LC_TIME=en_US.UTF-8
LC_MONETARY=en_US.UTF-8
LC_ADDRESS=en_US.UTF-8,
LC_TELEPHONE=en_US.UTF-8
LC_NAME=en_US.UTF-8
LC_MEASUREMENT=en_US.UTF-8
LC_IDENTIFICATION=en_US.UTF-8
LC_NUMERIC=en_US.UTF-8
LC_PAPER=en_US.UTF-8
" > /etc/default/locale

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_TIME=en_US.UTF-8
export LC_MONETARY=en_US.UTF-8
export LC_ADDRESS=en_US.UTF-8,
export LC_TELEPHONE=en_US.UTF-8
export LC_NAME=en_US.UTF-8
export LC_MEASUREMENT=en_US.UTF-8
export LC_IDENTIFICATION=en_US.UTF-8
export LC_NUMERIC=en_US.UTF-8
export LC_PAPER=en_US.UTF-8

#! update
apt-get update
apt-get -y upgrade

#! add swapfile
 sudo dd if=/dev/zero of=/swapspace bs=1M count=1000
 fallocate -l 1G /swapfile
 chmod 600 /swapfile
 mkswap /swapfile
 swapon /swapfile
 echo "/swapfile   none    swap    sw    0   0" >> /etc/fstab
 sysctl vm.swappiness=10
 echo "vm.swappiness=10" >> /etc/sysctl.conf
 sysctl vm.vfs_cache_pressure=50
 echo "vm.vfs_cache_pressure = 50" >> /etc/sysctl.conf

#! end swapfile

apt-get install -y curl git screen mc

#! changing skin mc
cd /usr/share/mc/skins/
mv default.ini default.ini.stop
ln -s gotar.ini default.ini
cd ~ 
#! end mc


echo 'deb http://download.jitsi.org/nightly/deb unstable/' >> /etc/apt/sources.list
wget -qO - https://download.jitsi.org/nightly/deb/unstable/archive.key | apt-key add -

apt-get update
apt-get -y install jitsi-meet


@Sing-Li: if you want to try to use jitsi-meet with rocket.chat I can setup a server for you

maxlinux2000 avatar Jan 06 '16 22:01 maxlinux2000

@maxlinux2000 - awesome. What did you use as a client for your tests?

Sing-Li avatar Jan 07 '16 02:01 Sing-Li

i like that jitsi +1

IQ2022 avatar Jan 07 '16 05:01 IQ2022

chrome or firefox are perfects clients for jitsi-meet so it's possible to use the plugin crosswalk-webviewer in the android/ios app. No other software are necessary to install.

Another vantage with jitsi are that is possible to use devices that can't pass the webtrc test: https://test.webrtc.org/

The differents resolutions of the cameras are not a problem. I can use an old laptop from 2008 (vga camera 640x480) with a economic smartphone with 320x240 of resolution.

maxlinux2000 avatar Jan 07 '16 11:01 maxlinux2000

Thanks. Let's leave this open until the feature is implemented or veto'd.

Sing-Li avatar Jan 08 '16 11:01 Sing-Li

Depends on https://github.com/RocketChat/Rocket.Chat/issues/1392

engelgabriel avatar Jan 27 '16 15:01 engelgabriel

@maxlinux2000 @Sing-Li Based on your comments, jitsi-meet is a different product and/or solution. I was looking to add a webrtc backend for rocketchat, to remove the need for peer2peer connections, not another product.

compuguy avatar Feb 01 '16 20:02 compuguy

Jitsi-Meet is a WebClient UI, it's probably Jitsi-Videobridge that is needed here!

LorbusChris avatar Feb 18 '16 03:02 LorbusChris

@LorbusChris can you help with integration?

Sing-Li avatar Feb 18 '16 04:02 Sing-Li

@Sing-Li I'm not really an expert myself but I read up on it a bit last night. From what I understand Jitsi-Videobridge may not actually be the best starting point:

Jitsi-Videobridge is a Selective Forwarding Unit (i.e. enabling speedy multi user video conferencing) that plugs into an existing XMPP Server (like Prosody, eJabberd, etc.) adding the COLIBRI extension protocol to it. COLIBRI is supported by clients Jitsi and Jitsi-Meet. So there needs to be XMPP support in RocketChat first.

Also, I don't think it makes much sense to reinvent the wheel for XMPP & SIP as there already are mature options out there. Just to name a few:

XMPP Servers:

  • Prosody
  • ejabberd

SIP Proxies:

  • ReSIPprocate
  • Kamailio

The Debian and Fedora communities are currently testing out WebRTC services here: https://rtc.debian.org/ & https://fedrtc.org/ . Their setup consists of a TURN server, a SIP proxy and an XMPP server.

Now what I propose is to - as a community - pick one standard server for each protocol (TURN, SIP, XMPP: eg reSIProcate & Prosody ) and provide instructions/scripts to set them up and configure them with/for RocketChat (think 3rd party software bundle/meta package/docker?).

RocketChat then wouldnt be burdened with the server side of those things and would instead only have to provide the SIP/XMPP client side.

Later on, once SIP & XMPP are fully working, Jitsi-Videobridge could be added to the Server bundle, and COLIBRI support could be added to Rocket.Chat.

What do you think?

LorbusChris avatar Feb 18 '16 14:02 LorbusChris