You are on page 1of 12

11/3/22, 1:38 PM Setting up Jibri for Jitsi Meet meeting recording and streaming on Ubuntu 18, Ubuntu 20.

Ubuntu 20.04 for Nginx or Apache - Meetrix.IO

Setting up Jibri for Jitsi Meet meeting


recording and streaming on Ubuntu 18,
Ubuntu 20.04 for Nginx or Apache
This will guide you to setup Jibri recording for your jitsi meet setup -
recording helps your meetings be memorable.

What is Jibri
Jibri is the component that is used for recording, streaming and SIP video gateway.It works by
launching a Chrome instance rendered in a virtual framebuffer and capturing and encoding the
output with ffmpeg. It is intended to be run on a separate machine (or a VM), with no other
applications using the display or audio devices. Only one recording at a time is supported on a
single jibri.

Configuring Jitsi Meet to allow Jibri to


connect and 'participate' in any video
conference.
Prosody (Prosody is an xmpp server all components connect to it so they can communicate using
xmpp protocol, this includes web, jicofo, jvb and the rest of the components.)

Jicofo (This is another background service that cares about switching/relaying the processes
between all participants and the video bridge)

Jitsi Meet (Consider this to be the master service responsible for displaying all functionality in
your web browser.) Tell us how we can help you.
Meetrix is an industry leader in

Configure Prosody (https://w


WebRTC and Jitsi solutions.
a.me/c/94
70201908

nano /etc/prosody/prosody.cfg.lua
2)

https://meetrix.io/blog/webrtc/jitsi/setting-up-jibri-recording-on-ubuntu.html 1/12
11/3/22, 1:38 PM Setting up Jibri for Jitsi Meet meeting recording and streaming on Ubuntu 18, Ubuntu 20.04 for Nginx or Apache - Meetrix.IO

Uncomment the items in the "conference" section:

---Set up a MUC (multi-user chat) room server on conference.example.com:

Component "conference.jitsi.example.com" "muc"

--- Store MUC messages in an archive and allow users to access it

modules_enabled = { "muc_mam" }

Create internal MUC component entry. This is required so that Jicofo can find jibri clients on a
MUC that jitsi meet users cannot access externally. And create the recorder virtual host entry, to
hold the user account for the jibri chrome session.
Add the following by logging into the "jitsi"
server using

nano /etc/prosody/conf.avail/meet.meetrix.io.cfg.lua

At the end of this file,

-- internal muc component, meant to enable pools of jibri and jigasi clients

Component "internal.auth.meet.meetrix.io" "muc"

modules_enabled = {

"ping";

storage = "memory"

muc_room_cache_size = 1000

VirtualHost "recorder.meet.meetrix.io"

modules_enabled = {

"ping";

authentication = "internal_plain"

Reload prosody:

systemctl reload prosody

Tell us how we can help you.

Create two new accounts for Jibri to use (one for control purposes,Meetrix
one foris an industry leader in
recording purposes):
(https://w
WebRTC and Jitsi solutions.
a.me/c/94
prosodyctl register jibri auth.meet.meetrix.io JibrisPass
70201908
prosodyctl register recorder recorder.meet.meetrix.io RecordersPass

2)

https://meetrix.io/blog/webrtc/jitsi/setting-up-jibri-recording-on-ubuntu.html 2/12
11/3/22, 1:38 PM Setting up Jibri for Jitsi Meet meeting recording and streaming on Ubuntu 18, Ubuntu 20.04 for Nginx or Apache - Meetrix.IO

Configure Jicofo
set the appropriate MUC to look for the Jibri Controllers.

nano /etc/jitsi/jicofo/sip-communicator.properties

Add these two lines for the Jibri control room and timeout:

org.jitsi.jicofo.jibri.BREWERY=JibriBrewery@internal.auth.meet.meetrix.io

org.jitsi.jicofo.jibri.PENDING_TIMEOUT=90

Reload Jicofo:

systemctl reload Jicofo

Configure Jitsi Meet:


Make sure there is a button for recording and / or streaming in our config:

nano /etc/jitsi/meet/meet.meetrix.io-config.js

Bosh connection that uses IP instead of Domain name

Default Configuration for Domain Name

bosh: '//meet.meetrix.io/http-bind'

Tell us how we can help you.


Meetrix is an industry leader in
Changing the Domain to IP (https://w
WebRTC and Jitsi solutions.
a.me/c/94
70201908
2)
bosh: '//192.168.10.10/http-bind'

https://meetrix.io/blog/webrtc/jitsi/setting-up-jibri-recording-on-ubuntu.html 3/12
11/3/22, 1:38 PM Setting up Jibri for Jitsi Meet meeting recording and streaming on Ubuntu 18, Ubuntu 20.04 for Nginx or Apache - Meetrix.IO

Add/Set the following properties:

fileRecordingsEnabled: true, // If you want to enable file recording

liveStreamingEnabled: true, // If you want to enable live streaming

hiddenDomain: 'recorder.meet.meetrix.io',

Installing Jibri:
Pre-Requisites

ALSA and Loopback Device


First make sure the ALSA loopback module is available. The extra modules (including ALSA
loopback) can be installed on Ubuntu 20.04 using package name  linux-image-extra-virtual .

Perform the following tasks as the root user

Set up the module to be loaded on boot:  echo "snd-aloop" >> /etc/modules 

Load the module into the running kernel:  modprobe snd-aloop 

Check to see that the module is already loaded:  lsmod | grep snd_aloop 

If the output shows the snd-aloop module loaded, then the ALSA loopback configuration
step is complete.

Enable the ALSA loopback module to loaded


on boot, as well as load into the current
boot:
echo "snd_aloop" >> /etc/modules

modprobe snd_aloop'

Tell us how we can help you.


Meetrix is an industry leader in
FFmpeg with X11 capture support (https://w
WebRTC and Jitsi solutions.
a.me/c/94
Jibri requires a relatively modern ffmpeg install with x11 capture compiled in. This comes
70201908
by default in Ubuntu 16.04/18.04/20.04, by installing the ffmpeg package.
2)
If building Jibri for Ubuntu 14.04 (trusty), the mc3man repo provides packages. They can be
used by the following in Ubuntu 14.04:
https://meetrix.io/blog/webrtc/jitsi/setting-up-jibri-recording-on-ubuntu.html 4/12
11/3/22, 1:38 PM Setting up Jibri for Jitsi Meet meeting recording and streaming on Ubuntu 18, Ubuntu 20.04 for Nginx or Apache - Meetrix.IO

Add the FFmpeg PPA

 sudo add-apt-repository ppa:jonathonf/ffmpeg-4 

Installing FFmpeg on Ubuntu

To install it, enter the following command as root or user with sudo privileges
(https://linuxize.com/post/how-to-create-a-sudo-user-on-ubuntu/) :This will also install many packages for the
dependencies.

sudo apt-get update

sudo apt-get install ffmpeg

Check FFmpeg Version

To verify the installation, use the ffmpeg -version command, which prints the FFmpeg version:

ffmpeg -version

Miscellaneous Packages

sudo apt-get install wget gnupg software-properties-common default-jre-headless curl alsa-utils


icewm xdotool xserver-xorg-input-void xserver-xorg-video-dummy

Install Google Chrome:

curl -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add


echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >
/etc/apt/sources.list.d/google-chrome.list

apt update

Tell us how we can help you.


apt install google-chrome-stable

Meetrix is an industry leader in


(https://w
WebRTC and Jitsi solutions.
a.me/c/94
Install ChromeDriver:
70201908
2)
Chromedriver is also required and can be installed like so:

https://meetrix.io/blog/webrtc/jitsi/setting-up-jibri-recording-on-ubuntu.html 5/12
11/3/22, 1:38 PM Setting up Jibri for Jitsi Meet meeting recording and streaming on Ubuntu 18, Ubuntu 20.04 for Nginx or Apache - Meetrix.IO

CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`

wget -N http://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip -
P ~/

unzip ~/chromedriver_linux64.zip -d ~/

rm ~/chromedriver_linux64.zip

sudo mv -f ~/chromedriver /usr/local/bin/chromedriver

sudo chmod 0755 /usr/local/bin/chromedriver

Turn off warnings about scripted control in Chrome:

mkdir -p /etc/opt/chrome/policies/managed

echo '{ "CommandLineFlagSecurityWarningsEnabled": false }'


>>/etc/opt/chrome/policies/managed/managed_policies.json

Jitsi Debian Repository


The Jibri packages can be found in the stable repository on downloads.jitsi.org. First install the
Jitsi repository key onto your system:

wget -qO - https://download.jitsi.org/jitsi-key.gpg.key | sudo apt-key add -

Create a sources.list.d file with the


repository:
sudo sh -c "echo 'deb https://download.jitsi.org stable/' > /etc/apt/sources.list.d/jitsi-
stable.list"

Update your package list:


Tell us how we can help you.
Meetrix is an industry leader in
(https://w
WebRTC and Jitsi solutions.
a.me/c/94
70201908
sudo apt-get update

2)

https://meetrix.io/blog/webrtc/jitsi/setting-up-jibri-recording-on-ubuntu.html 6/12
11/3/22, 1:38 PM Setting up Jibri for Jitsi Meet meeting recording and streaming on Ubuntu 18, Ubuntu 20.04 for Nginx or Apache - Meetrix.IO

Install the latest jibri


Install Jibri

If installing on the same server as Jitsi:

sudo apt-get install jibri

Add Jibri to the necessary user groups:

sudo usermod -aG adm,audio,video,plugdev jibri

Configure Jibri:
Step 1: Install the required packages that are available from Debian 10's default repositories:

We need to configure the xmpp environments and the directory where we want to store our
recordings:

Open the config file

nano /etc/jitsi/jibri/config.json

Set the following options:

Tell us how we can help you.


Meetrix is an industry leader in
(https://w
WebRTC and Jitsi solutions.
a.me/c/94
70201908
2)

https://meetrix.io/blog/webrtc/jitsi/setting-up-jibri-recording-on-ubuntu.html 7/12
11/3/22, 1:38 PM Setting up Jibri for Jitsi Meet meeting recording and streaming on Ubuntu 18, Ubuntu 20.04 for Nginx or Apache - Meetrix.IO

"recording_directory":"/srv/recordings",

"finalize_recording_script_path": "/path/to/finalize_recording.sh",

"xmpp_environments": [

"name": "prod environment",

"xmpp_server_hosts": [

"meet.meetrix.io"

],

"xmpp_domain": "meet.meetrix.io",

"control_login": {

// The domain to use for logging in

"domain": "auth.meet.meetrix.io",

// The credentials for logging in

"username": "jibri",

"password": "JibrisPass"

},

"control_muc": {

"domain": "internal.auth.meet.meetrix.io",

"room_name": "JibriBrewery",

"nickname": "jibri-nickname"

},

"call_login": {

"domain": "recorder.meet.meetrix.io",

"username": "recorder",

"password": "RecordersPass"

},

"room_jid_domain_string_to_strip_from_start": "conference.",

"usage_timeout": "0"

Jibri Code

https://github.com/jitsi/jibri (https://github.com/jitsi/jibri)

Tell us how we can help you.

/src/main/kotlin/org/jitsi/jibri/selenium/JibriSelenium.kt
Meetrix is an industry leader in
(https://w
WebRTC and Jitsi solutions.
a.me/c/94
70201908
Changing the Code to accept the Self Signed /Insecure Certificate
2)

https://meetrix.io/blog/webrtc/jitsi/setting-up-jibri-recording-on-ubuntu.html 8/12
11/3/22, 1:38 PM Setting up Jibri for Jitsi Meet meeting recording and streaming on Ubuntu 18, Ubuntu 20.04 for Nginx or Apache - Meetrix.IO

chromeOptions.addArguments("--ignore-certificate-errors")

chromeOptions.setAcceptInsecureCerts(true)

Setting RTMP URL

src/main/kotlin/org/jitsi/jibri/service/impl/StreamingJibriService.kt

const val YOUTUBE_URL = "rtmp://zb01.lmt.glcx.cnpc:1935/myapp"

Then we compile the Jibri Code

mvn package -DskipTests

After it is compiled.Replace the New jar with the old one

sudo /opt/jibri/target/jibri-8.0-Snapshot-with-dependies.jar /opt/jitsi/jibri

Reload Jibri

systemctl reload jibri

Create directory to store recordings and assign jibri ownership of the directory

mkdir /recordings

chown jibri:jibri /recordings


Tell us how we can help you.
Meetrix is an industry leader in
(https://w
WebRTC and Jitsi solutions.
a.me/c/94

Java 8 - Install and configure as default for


70201908

Jibri
2)

https://meetrix.io/blog/webrtc/jitsi/setting-up-jibri-recording-on-ubuntu.html 9/12
11/3/22, 1:38 PM Setting up Jibri for Jitsi Meet meeting recording and streaming on Ubuntu 18, Ubuntu 20.04 for Nginx or Apache - Meetrix.IO

Install Java 8

wget -O - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -

add-apt-repository https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/

apt update

apt install adoptopenjdk-8-hotspot

Open "launch.sh"

nano /opt/jitsi/jibri/launch.sh

Set Java 8 as default for Jibri instead of the default Java version - replace the word "java" with the
full path to Java 8

/usr/lib/jvm/adoptopenjdk-8-hotspot-amd64/bin/java

Restart all services, enable and start jibri

systemctl restart prosody

systemctl restart jicofo

systemctl restart jitsi-videobridge2

systemctl enable --now jibri

How to record to S3
configured finalizerecording.sh script as below,

Tell us how we can help you.


Meetrix is an industry leader in
(https://w
WebRTC and Jitsi solutions.
a.me/c/94
70201908
2)

https://meetrix.io/blog/webrtc/jitsi/setting-up-jibri-recording-on-ubuntu.html 10/12
11/3/22, 1:38 PM Setting up Jibri for Jitsi Meet meeting recording and streaming on Ubuntu 18, Ubuntu 20.04 for Nginx or Apache - Meetrix.IO

#!/bin/bash

RECORDINGS_DIR=$1

aws s3 cp --recursive ${RECORDINGS_DIR} s3://

if [ -d "$RECORDINGS_DIR" ]; then

rm -r ${RECORDINGS_DIR}

fi

exit 0

Creating the Dropbox app for Dropbox


recording integration
1. You need a Dropbox account (If you don't already have one, you can sign up for a free
account here (https://www.dropbox.com/register).)
2. Create a new App as described in the Getting Started Guide
(https://www.dropbox.com/developers/reference/getting-started?
_tk=guides_lp&_ad=guides2&_camp=get_started#app%20console) in the App Console section.

3. Choose

'Dropbox API - For apps that need to access files in Dropbox.'


'App folder - Access to a single folder created specifically for your app.'

Fill in the name of your app

1. You need only, the newly created App key, goes in  nano /etc/jitsi/meet/[yourdeployment.com]-
config.js 

dropbox: {

appKey: '__dropbox_app_key__',

redirectURI: 'https://[yourdeployment.com]/static/oauth.html'

Tell us how we can help you.


2. Add your Dropbox Redirect URIs in the Dropbox form
Meetrix is an industry leader in
https://[yourdeployment.com]/static/oauth.html (https://w
WebRTC and Jitsi solutions.
a.me/c/94
3. Fill in Branding
70201908
2)
Updated: January 24, 2022

https://meetrix.io/blog/webrtc/jitsi/setting-up-jibri-recording-on-ubuntu.html 11/12
11/3/22, 1:38 PM Setting up Jibri for Jitsi Meet meeting recording and streaming on Ubuntu 18, Ubuntu 20.04 for Nginx or Apache - Meetrix.IO

LEAVE A COMMENT

Some cool WebRTC and Jitsi products from Meetrix.io


(https://meetrix.io/)

Configure 250 user Jitsi Configure 500 user Jitsi Configure 1000 user Debug - Audit existing
Enterprise Platform Enterprise Platform
Jitsi Enterprise Platform
setups

(with auto-scaling) (with auto-scaling) (1hr)

USD 450 USD 1500 USD 2250 USD 300

Contact Sales Contact Sales Contact Sales Contact Sales

Tell us how we can help you.


Meetrix is an industry leader in
(https://w
WebRTC and Jitsi solutions.
a.me/c/94
70201908
2)

https://meetrix.io/blog/webrtc/jitsi/setting-up-jibri-recording-on-ubuntu.html 12/12

You might also like