Multistreaming a Jitsi Meet video conference to platforms like YouTube, Facebook, and LinkedIn using Jibri and an Nginx RTMP server

Below is a step-by-step guide to achieve this architecture: Jitsi Meet → Jibri → Nginx RTMP → YouTube, Facebook, LinkedIn. Note that LinkedIn may have specific requirements, and Jitsi's default streaming capabilities are somewhat limited for generic RTMP endpoints, so additional configuration or tools may be needed.

Overview of the Architecture

  • Jitsi Meet: The video conferencing platform where the meeting occurs.

  • Jibri: A Jitsi component that captures and streams the conference video.

  • Nginx RTMP: A server with the Nginx RTMP module to receive the stream from Jibri and relay it to multiple platforms (YouTube, Facebook, LinkedIn).

  • Streaming Platforms: YouTube, Facebook Live, and LinkedIn Live, each requiring specific RTMP URLs and stream keys.

Prerequisites

  1. A Jitsi Meet Server: installed and running (e.g., on Ubuntu 20.04 or later).

  2. Jibri Instance: Installed on the same or a separate server, configured to work with Jitsi Meet.

  3. Nginx with RTMP Module: Installed on a server (can be the same as Jitsi or separate).

  4. RTMP URLs and Stream Keys: Obtain these from YouTube, Facebook, and LinkedIn.

  5. Firewall Access: Ensure ports (e.g., 1935 for RTMP, 80/443 for HTTP) are open.

  6. Hardware Requirements:

    • Jibri requires significant resources (e.g., 4GB RAM, multi-core CPU).

    • Nginx RTMP server needs adequate bandwidth for multistreaming.

Step-by-Step Setup

Set Up Jitsi Meet and Jibri

  • Install Jitsi Meet: Follow the official Jitsi Meet installation guide for Ubuntu (available at https://jitsi.github.io/handbook/docs/devops-guide/devops-guide-quickstart).

  • Install Jibri: Jibri is used to capture and stream the Jitsi conference. Install it on the same or a separate Ubuntu server:

    • Follow the guide at https://github.com/jitsi/jibri#installation or use an automated script like the one by @Ark74 (referenced in).

    • Ensure Jibri is configured to connect to your Jitsi Meet instance:

      • Update /etc/jitsi/jibri/jibri.conf with your Jitsi server details.

      • Configure Jibri for streaming mode (not just recording).

    • Test Jibri by starting a Jitsi meeting and enabling the "Start live streaming" option (requires a YouTube stream key by default).

  • Verify Jibri Works: Ensure Jibri can stream to YouTube by entering the YouTube RTMP URL (rtmp://a.rtmp.youtube.com/live2/your-stream-key) in the Jitsi interface. This confirms Jibri is functional.

Install and Configure Nginx with RTMP Module

  • Install Nginx and RTMP Module:

    • On an Ubuntu server, install Nginx and the RTMP module:
sudo apt update
sudo apt install nginx libnginx-mod-rtmp ffmpeg

Configure Nginx for RTMP:

  • Edit the Nginx configuration file (/etc/nginx/nginx.conf) and add an RTMP block at the end:
nano /etc/nginx/nginx.conf
rtmp {
    server {
        listen 1935;
        chunk_size 4096;

        application live {
            live on;
            record all;
            # The directory in which the recordings will be stored.
            record_path /var/www/html/recordings;
            record_unique on;
                  record_suffix -%d-%b-%y-%T.flv;

            # Push to YouTube
            push rtmp://a.rtmp.youtube.com/live2/<your-youtube-stream-key>;

#           push rtmp://a.rtmp.youtube.com/live2/cmwt-hmax-5fd8-cs87-ekqh;

            # Push to Facebook
            push rtmp://127.0.0.1:1936/rtmp/<your-facebook-stream-key>;
        }
    }
}
  • Replace <your-youtube-stream-key>, <your-facebook-stream-key>, and <your-linkedin-stream-key> with the actual stream keys from each platform.

  • Note: Facebook requires RTMPS (secure RTMP). You’ll need to set up stunnel to handle RTMPS (see Step 3).

  • LinkedIn Live may not support standard RTMP; you may need to use a third-party service like Restream.io or check LinkedIn’s documentation for their RTMP endpoint.

Do as below:

mkdir -p /var/www/html/recordings
chown -R www-data:www-data /var/www/html/recordings/
systemctl enable nginx.service
systemctl restart nginx.service

Restart Nginx:

sudo nginx -t  # Test configuration
sudo systemctl restart nginx

Facebook uses rtmps and hence you need stunnel to send rtmps to facebook as NGINX RTMP proxy does only rtmp

apt-get install stunnel4 -y

Add below on “stunnel4”

nano /etc/default/stunnel4
# /etc/default/stunnel
# Julien LEMOINE <speedblue@debian.org>
# September 2003

FILES="/etc/stunnel/*.conf"
OPTIONS=""

# Change to one to enable ppp restart scripts
PPP_RESTART=0
ENABLE=1

# Change to enable the setting of limits on the stunnel instances
# For example, to set a large limit on file descriptors (to enable
# more simultaneous client connections), set RLIMITS="-n 4096"
# More than one resource limit may be modified at the same time,
# e.g. RLIMITS="-n 4096 -d unlimited"
RLIMITS=""

Also add below on “stunnel.conf”

nano /etc/stunnel/stunnel.conf
pid = /var/run/stunnel4/stunnel.pid
output = /var/log/stunnel4/stunnel.log

setuid = stunnel4
setgid = stunnel4

# https://www.stunnel.org/faq.html
socket = r:TCP_NODELAY=1
socket = l:TCP_NODELAY=1

debug = 4

[fb-live]
client = yes
accept = 127.0.0.1:1936
#accept = 1936
connect = live-api-s.facebook.com:443
verifyChain = no

[ig-live]
client = yes
accept = 1937
connect = live-upload.instagram.com:443
verifyChain = no
systemctl daemon-reload
systemctl enable stunnel4.service
systemctl restart stunnel4.service

###########################################
THIS HAS TO BE DONE ON THE JIBRI SERVER

###########################################

Backup original ffmepg file for rollback if exist,

mv /usr/local/bin/ffmpeg /usr/local/bin/ffmpeg-ori

Then create a new ffmeg

nano /usr/local/bin/ffmpeg
#!/bin/bash

ARGS=$@

if [[ -n "$(echo $ARGS | grep ' rtmp://')" ]]; then
    DST=$(echo $ARGS | rev | awk '{print $1}' | rev)
    STREAM=$(echo $DST | rev | cut -d '/' -f1 | rev)

    ARGS=$(echo $ARGS | sed "s~rtmp://.*~~")
    ARGS="$ARGS rtmp://your-rtmp-nginx-proxy-server-ip/live/$STREAM"
fi

echo $ARGS >> /tmp/ffmpeg.log
exec /usr/bin/ffmpeg $ARGS

Give permission for ffmpeg and reload daemon

chmod +x /usr/local/bin/ffmpeg
systemctl daemon-reload

Start the Stream

  • In a Jitsi Meet conference:

    • Click the three-dot menu and select “Start live streaming.”

    • Enter the RTMP URL of your Nginx server (rtmp://<nginx-server-ip>:1935/live/stream).

    • If Jibri is configured correctly, it will capture the conference and send the stream to the Nginx RTMP server.

  • Nginx will relay the stream to YouTube, Facebook (via stunnel), and LinkedIn (if supported).

  • Monitor the Nginx logs (/var/log/nginx/access.log) and stunnel logs (/var/log/stunnel4/stunnel.log) for any errors.

Test the Streams

  • Open YouTube, Facebook, and LinkedIn Live in separate browser tabs to verify the streams are live.

  • Use a tool like VLC to test the RTMP stream directly from Nginx:

vlc rtmp://<nginx-server-ip>:1935/live/stream

Troubleshooting

  • Jibri Fails to Stream: Check Jibri logs (/var/log/jitsi/jibri/) and ensure the RTMP URL is correct. Verify Jibri’s Chrome and FFmpeg dependencies are installed.

  • Nginx RTMP Issues: Ensure port 1935 is open (sudo ufw allow 1935) and check Nginx logs for errors.

  • Facebook RTMPS Fails: Verify stunnel is running and the Facebook RTMP URL is correct.

  • LinkedIn Issues: If direct RTMP isn’t supported, use a third-party service like Restream.io.

References

  • DigitalOcean Nginx RTMP Setup:

  • Jitsi Jibri Generic RTMP Pull Request:

  • Jitsi Community Guide for Multistreaming:,,

  • Nginx RTMP with stunnel for Facebook:

  • Dockerized Nginx RTMP Solutions:,

0
Subscribe to my newsletter

Read articles from S. M. Arefin Rumi directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

S. M. Arefin Rumi
S. M. Arefin Rumi