接到一個任務,想在公司內網搭建一個視訊會議系統,用於公司內部或與分公司交流,需要內網部署,最好是開源免費。
查詢瞭如下幾個專案:
最後決定嘗試 Jitsi Meet
這個開源免費的專案。github 中 Star 19k
(20221209)
Jitsi是一系列開源專案的集合,這些專案提供了最先進的視訊會議功能,這些功能安全、易於使用且易於自託管。
本手冊(https://jitsi.github.io/handbook/docs/intro
)旨在成為所有Jitsi檔案的一站式商店。
內容分為3個主要方面:
Jitsi由一系列專案組成:
啟動後,直接通過瀏覽器存取:
直接通過專案 https://github.com/jitsi/docker-jitsi-meet docker 方式安裝。
Tip: 筆者環境 ubuntu 20.04。
部分安裝過程:
下載 docker-jitsi-meet-master 到本地並進入此目錄:
root@pjl:/home/docker-jitsi-meet-master# docker-compose up -d
root@pjl:/home/docker-jitsi-meet-master# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f617d13cda50 jitsi/jvb:unstable "/init" 4 hours ago Up 4 hours 127.0.0.1:8080->8080/tcp, 0.0.0.0:10000->10000/udp, :::10000->10000/udp docker-jitsi-meet-master_jvb_1
5af4885c996a jitsi/jicofo:unstable "/init" 4 hours ago Up 4 hours docker-jitsi-meet-master_jicofo_1
35c4bd9da921 jitsi/prosody:unstable "/init" 4 hours ago Up 4 hours 5222/tcp, 5280/tcp, 5347/tcp docker-jitsi-meet-master_prosody_1
fe3d109c8be6 jitsi/web:unstable "/init" 4 hours ago Up 4 hours 0.0.0.0:8000->80/tcp, :::8000->80/tcp, 0.0.0.0:8443->443/tcp, :::8443->443/tcp docker-jitsi-meet-master_web_1
安裝過程參考:
報錯:WebSocket connection to 'wss://localhost:8443/xmpp-websocket?room=a' failed:
後來自己好了
全螢幕分享時,如果第三個人進來,螢幕分享就失敗了。解決過程非常曲折
,大致過程如下:
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw allow 10000/udp
sudo ufw allow 22/tcp
sudo ufw allow 3478/udp
sudo ufw allow 5349/tcp
sudo ufw enable
root@pjl:/home/docker-jitsi-meet-master# sudo ufw enable
Command may disrupt existing ssh connections. Proceed with operation (y|n)? y
Firewall is active and enabled on system startup
root@pjl:/home/docker-jitsi-meet-master# sudo ufw status verbose
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), deny (routed)
New profiles: skip
To Action From
-- ------ ----
5911 ALLOW IN Anywhere
10000/udp ALLOW IN Anywhere
80/tcp ALLOW IN Anywhere
443/tcp ALLOW IN Anywhere
22/tcp ALLOW IN Anywhere
3478/udp ALLOW IN Anywhere
5349/tcp ALLOW IN Anywhere
5911 (v6) ALLOW IN Anywhere (v6)
10000/udp (v6) ALLOW IN Anywhere (v6)
80/tcp (v6) ALLOW IN Anywhere (v6)
443/tcp (v6) ALLOW IN Anywhere (v6)
22/tcp (v6) ALLOW IN Anywhere (v6)
3478/udp (v6) ALLOW IN Anywhere (v6)
5349/tcp (v6) ALLOW IN Anywhere (v6)
失敗。嘗試另一方法:
docker cp f617d13cda50:/etc/jitsi/videobridge/sip-communicator.properties sip-communicator.properties
編輯 vim sip-communicator.properties,新增兩條:
org.ice4j.ice.harvest.NAT_HARVESTER_LOCAL_ADDRESS=192.168.1.223
org.ice4j.ice.harvest.NAT_HARVESTER_PUBLIC_ADDRESS=192.168.1.223
docker cp sip-communicator.properties f617d13cda50:/etc/jitsi/videobridge/sip-communicator.properties
systemctl restart docker
失敗。嘗試另一方法:
ENABLE_XMPP_WEBSOCKET=0
ENABLE_COLIBRI_WEBSOCKET=1
ENABLE_SCTP=1
JVB_PORT=10000
失敗。報錯如下:
Logger.js:154 2022-07-25T08:41:11.181Z [modules/RTC/BridgeChannel.js] <WebSocket.e.onclose>: Channel closed: 1006
[modules/statistics/RTPStatsCollector.js] <nn._processAndEmitReport>: No participant ID returned by LocalTrack[2,video]
[modules/statistics/AvgRTPStatsReporter.js] <Dd.addNext>: bandwidth_upload - invalid value for idx: 1 undefined
在網上一通搜尋和嘗試,未果。
中途也發現了一些奇怪的問題:chrome 94 有視訊分享的按鈕,chrome 103 沒有分享按鈕,超過三人桌面分享消失,退出一人則又有效
firefox 102:
[ "audio", "video" ] TypeError: navigator.mediaDevices is undefined
chrome 103
TypeError: Cannot read properties of undefined (reading 'getUserMedia')
參考 https://blog.csdn.net/yunzhonghefei/article/details/120290541 解決。
最後修改兩點:
TZ=Asia/Shanghai
jvb:
image: jitsi/jvb:${JITSI_IMAGE_VERSION:-unstable}
restart: ${RESTART_POLICY:-unless-stopped}
ports:
- '${JVB_PORT:-10000}:${JVB_PORT:-10000}/udp'
// 127.0.0.1 改成自己伺服器的ip
- '127.0.0.1:${JVB_COLIBRI_PORT:-8080}:8080'
一切都好了。
Tip:真正使用應該還要許多其他問題,首先肯定會對內網造成非常大的壓力。
Keep it Casual. For Free.
Jitsi is a collection of Open Source projects which provide state-of-the-art video conferencing
capabilities that are secure, easy to use and easy to self-host.
Jitsi comprises a collection of projects:
External Software used by Jitsi:
Browser | Support | Versions | Notes |
---|---|---|---|
Chrome | ✅ | >= 72 | Best results with >= 96 |
Firefox | ✅ | >= 68 | Best results with >= 101 |
Safari | ✅ | >= 14 | Best results with >= 15, output device selection unsupported |
Edge | ✅ | >= 79 | Edge Legacy is unsupported |
Internet Explorer | ❌ |
People can invite each other to Jitsi meetings by simply sending a link.
v
dropdown menu items.Join meeting
.Go
button.allow
or permit
. Sometimes you also have to click the camera button at the bottom of the screen first to activate the dialog for allowing camera access. Do the same with the microphone the first time you use Jitsi.Join meeting
button.Embedding the Jitsi Meet API into your site or app enables you to host and provide secure video meetings with your colleagues, teams, and stakeholders. The Meet API provides a full complement of comprehensive meeting features.
Your Jitsi meetings can be hosted and attended using any device while keeping your data and privacy protected. You can reach your meeting participants anywhere in the world eliminating the need for travel and the associated inconvenience.
The IFrame API enables you to embed Jitsi Meet functionality into your meeting application so you can experience the full functionality of the globally distributed and highly available deployment available with meet.jit.si.
You can also embed and integrate the globally distributed and highly available deployment on the meet.jit.si platform itself.
Welcome to the Self-Hosting guide!
note:
These guides help you to host your own Jitsi-Meet server.
If you want to have a video conference without setting up any infrastructure, use https://meet.jit.si instead.
The content is divided in 3 guides:
Debian/Ubuntu server guide: Describes the quick installation on Debian-based distributions.
Docker guide: Describes how to use the official Docker image of Jitsi-Meet.
Manual installation guide: Describes the manual installation of all components (adaptable for other distributions).
note: First, a bit of general advice
Jitsi Meet being based on WebRTC, an encrypted communication link (https) is necessary to get working multimedia, and the setup is not always trivial.
The best option is an Internet server with a certificate for a domain registered in the DNS.
While it's possible to setup a server on a private network and/or a self-signed certificate, it can be less straightforward and you can expect difficulties, first if you want access both from the private network and the public internet, and second when using phones as these clients often don't accept self-signed certificates.
In case of trouble with clients using phones, check your certificate.
note:
Jitsi Meet is a real-time system.
Requirements are very different from a web server and depend on many factors.
Miscalculations can very easily destroy basic functionality rather than cause slow performance.
Avoid adding other functions to your Jitsi Meet setup as it can harm performance and complicate optimizations.
Note that Jitsi Meet design priorizes scalability by adding servers on using a huge server. Check Jitsi-videobridge documentation on adding several bridges to a Jitsi Meet server, and OCTO to go even beyond that (federation of Jitsi Meet servers). If you feel that you are a network and server administration newbie, don't even think of going there.
These requirements concern the videobridge. If there are only external videobridges (as can be the case on high end Jitsi Meet servers), network performance matters much less.
RAM: it's usually suggested to get 8 GB.
For small meetings you can get away with 4 GB, for test servers or very small meetings you can try to use 2 GB.
For big meetings it's suggested to go the scalable way over getting huge amounts of memory.
CPU: very low processor performance can seriously harm a real time system, especially when using a shared server (where your CPU performance can be stolen by other customers of your hoster, check on 'dedicated CPU' if you are getting a VPS, rather than a physical server). However, a consideration is that a Jitsi Meet component, Prosody, can only use ONE (1) core. So getting a lot of cores, let's say more than 32, is not always useful. For a basic server, 4 dedicated cores can be enough.
Disk: unless you are doing heavy logging or have very specific needs, you can get away with 250 Gbytes of standard hard disk.
SSD are more a nice to have than a necessity.
If you want additional services, requirements can go up.
Jibri needs ONE system per recording.
One Jibri instance = one meeting. For 5 meetings recorded simultaneously, you need 5 Jibris.
There is no workaround to that.
If you are knowledgeable, you can setup Jibris in containers and use a big server to save a bit on resources but that's about it.
Jibri RAM and CPU needs are far higher than Jitsi Meet itself, as it does video encoding.
For 1080x720
you currently need at least 8 GB RAM, for 1280x1024
12 GB (this is for recording a single meeting).
If memory is not sufficient or CPU can't encode fast enough, recordings will fail.
While Jibri and Jitsi Meet can technically be hosted in a single server, it's not recommended because Jibri is a resource drain and it can harm Jitsi Meet performance, and can exhaust disk space and stop Jitsi Meet function altogether.
In order to quickly run Jitsi Meet on a machine running Docker and Docker Compose,
follow these steps:
Download and extract the [latest release]. DO NOT clone the git repository. See below if you are interested in running test images.
Create a .env
file by copying and adjusting env.example
:
cp env.example .env
Set strong passwords in the security section options of .env
file by running the following bash script
./gen-passwords.sh
Create required CONFIG
directories
mkdir -p ~/.jitsi-meet-cfg/{web,transcripts,prosody/config,prosody/prosody-plugins-custom,jicofo,jvb,jigasi,jibri}
echo web,transcripts,prosody/config,prosody/prosody-plugins-custom,jicofo,jvb,jigasi,jibri | % { mkdir "~/.jitsi-meet-cfg/$_" }
Run docker-compose up -d
Access the web UI at https://localhost:8443
(or a different port, in case you edited the .env
file).
note:
HTTP (not HTTPS) is also available (on port 8000, by default), but that's e.g. for a reverse proxy setup;
direct access via HTTP instead HTTPS leads to WebRTC errors such as
Failed to access your microphone/camera: Cannot use microphone/camera for an unknown reason. Cannot read property 'getUserMedia' of undefined
or navigator.mediaDevices is undefined.
If you want to use jigasi too, first configure your env file with SIP credentials
and then run Docker Compose as follows:
docker-compose -f docker-compose.yml -f jigasi.yml up
If you want to enable document sharing via [Etherpad],
configure it and run Docker Compose as follows:
docker-compose -f docker-compose.yml -f etherpad.yml up
If you want to use jibri too, first configure a host as described in JItsi BRoadcasting Infrastructure configuration section
and then run Docker Compose as follows:
docker-compose -f docker-compose.yml -f jibri.yml up -d
or to use jigasi too:
docker-compose -f docker-compose.yml -f jigasi.yml -f jibri.yml up -d
A Jitsi Meet installation can be broken down into the following components:
The diagram shows a typical deployment in a host running Docker. This project
separates each of the components above into interlinked containers. To this end,
several container images are provided.
External Ports
The following external ports must be opened on a firewall:
80/tcp
for Web UI HTTP (really just to redirect, after uncommenting ENABLE_HTTP_REDIRECT=1
in .env
)443/tcp
for Web UI HTTPS4443/tcp
for RTP media over TCP10000/udp
for RTP media over UDPAlso 20000-20050/udp
for jigasi, in case you choose to deploy that to facilitate SIP access.
E.g. on a CentOS/Fedora server this would be done like this (without SIP access):
sudo firewall-cmd --permanent --add-port=80/tcp
sudo firewall-cmd --permanent --add-port=443/tcp
sudo firewall-cmd --permanent --add-port=4443/tcp
sudo firewall-cmd --permanent --add-port=10000/udp
sudo firewall-cmd --reload
See the corresponding section in the manual setup guide.
Design considerations
Jitsi Meet uses XMPP for signaling, thus the need for the XMPP server.
The setup provided by these containers does not expose the XMPP server to the outside world.
Instead, it's kept completely sealed, and routing of XMPP traffic only happens on a user-defined network.
The XMPP server can be exposed to the outside world,
but that's out of the scope of this project.
出於某些因素的考慮,最終相關部門決定客製化採購。