[jitsi-users] How to make jibri actually work with jitsi?


#1

Hello!

I needed to enable recording for jitsi conferences, and jibri seemed
to be the only viable option. I followed the installation instructions
[1] step by step on a fresh headless Debian 9.3 virtual machine. The
machine is currently on the same local subnetwork as the jitsi server
and I have /etc/hosts configured accordingly.

I set snd-aloop to load on boot, installed ffmpeg, chrome and
chromedrive, and I also have alsa-utils, icewm, jq, python-pip,
python3, python3-pip, xdotool, xserver-xorg-input-void, and
xserver-xorg-video-dummy installed.

I also created user jibri, and then ran "usermod -a -G
adm,audio,video,plugdev" for that user. For some reason, there was no
home folder I had to create it manually.

Then, I cloned the jibri directory and copied
/home/jibri/jibri/scripts and /home/jibri/jibri/jibri-xmpp-client to
/home/jibri, as per the instructions. I copied the other files as
instructed as well.

In the end, I got to the point where I can start the jibri-xmpp
service. But the only effect I got is the fact that the syslog on the
VM is okayish.

Feb 22 15:00:21 debianvirtual app.py[688]: 2018-02-22 15:00:21,806
INFO Creating a client for hostname: jitsi.MYSERVER.ME with
options: {'mucserver_prefix': 'conference.', 'selenium_xmpp_password':
'recorderpass', 'room': 'TheBrewery@conference.jitsi.MYSERVER.ME',
'url': 'https://jitsi.MYSERVER.ME/%SUBDOMAIN%%ROOM%',
'jidserver_prefix': 'auth.', 'recording_directory': './recordings',
'boshdomain_prefix': 'recorder.', 'jid_username': 'jibri', 'jid':
'jibri@auth.jitsi.MYSERVER.ME', 'brewery_prefix': 'conference.',
'selenium_xmpp_login': 'recorder@recorder.jitsi.MYSERVER.ME',
'selenium_xmpp_username': 'recorder', 'boshdomain':
'recorder.jitsi.MYSERVER.ME', 'roompass': '', 'roomname':
'TheBrewery', 'xmpp_domain': 'jitsi.MYSERVER.ME', 'usage_timeout': 0,
'selenium_xmpp_prefix': 'recorder.', 'nick': 'jibri-5645734736381338',
'password': 'jibripass'}
Feb 22 15:00:21 debianvirtual app.py[688]: 2018-02-22 15:00:21,816
INFO jibri_watcher starting up...
Feb 22 15:00:21 debianvirtual app.py[688]: 2018-02-22 15:00:21,854
INFO * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
Feb 22 15:00:21 debianvirtual app.py[688]: 2018-02-22 15:00:21,909
WARNING jid property deprecated. Use boundjid.bare
Feb 22 15:00:22 debianvirtual app.py[688]: 2018-02-22 15:00:22,935
INFO JID set to:
jibri@auth.jitsi.MYSERVER.ME/bbbc8888-2898-4a51-8493-cc5134104378
Feb 22 15:00:22 debianvirtual app.py[688]: 2018-02-22 15:00:22,943
WARNING TLS or SSL was enabled, but no certificate was found.
Feb 22 15:00:22 debianvirtual app.py[688]: 2018-02-22 15:00:22,945
INFO Starting up client <jibrixmppclient.JibriXMPPClient object at
0x7fd0020de7f0>, connecting to room
TheBrewery@conference.jitsi.MYSERVER.ME as jibri-5645734736381338
Feb 22 15:00:22 debianvirtual app.py[688]: 2018-02-22 15:00:22,951
INFO sending presence: <presence
to="TheBrewery@conference.jitsi.MYSERVER.ME"
xml:lang="en"><jibri-status xmlns="http://jitsi.org/protocol/jibri"
status="idle" /></presence>
Feb 22 15:00:22 debianvirtual app.py[688]: 2018-02-22 15:00:22,954
INFO Started up client <jibrixmppclient.JibriXMPPClient object at
0x7fd0020de7f0>
jibri@debianvirtual:/var/log$

The browser now has the Stop/Start Livestream button, but it doesn't
work. All I get is a message that says "Live Streaming unavailable".

Here's my current /home/jibri/config.json on the VM:

{
    "jidserver_prefix":"auth.",
    "mucserver_prefix":"conference.",
    "boshdomain_prefix":"recorder.",
    "password":"jibripass",
    "recording_directory":"./recordings",
    "jid_username":"jibri",
    "roomname":"TheBrewery",
    "xmpp_domain":"jitsi.MYSERVER.ME",
    "selenium_xmpp_prefix":"recorder.",
    "selenium_xmpp_username":"recorder",
    "selenium_xmpp_password":"recorderpass",
    "servers":["jitsi.MYSERVER.ME"],
    "environments":{
    }
}

Now, xmpp_domain used to be focus.jitsi.MYSERVER.ME, but I didn't have
domains like "conference.focus.jitsi.myserver.me" preconfigured, so I
think this one works better.

The manual test works, to an extent. Selenium is visible online, but
it disconnects in 60 seconds if my prosody configuration is limited to
what is recommended in [1].

Here are my recording settings from my
/etc/jitsi/meet/jitsi.MYSERVER.ME-config.js on the physical machine
with jitsi:

    enableRecording: true,
    recordingType: 'jibri',
    hiddenDomain: 'recorder.jitsi.MYSERVER.ME',

Here is my /etc/prosody/conf.d/MYSERVER.ME.cfg.lua on the physical
machine with jitsi:

VirtualHost "jitsi.MYSERVER.ME"
        authentication = "anonymous" -- anonymous
        ssl = {
                key = "/etc/prosody/certs/jitsi.MYSERVER.ME.key";
                certificate = "/etc/prosody/certs/jitsi.MYSERVER.ME.crt";
        }
        modules_enabled = {
            "bosh";
            "pubsub";
            "ping"; -- Enable mod_ping
        }

        c2s_require_encryption = false

Component "conference.jitsi.MYSERVER.ME" "muc"
    storage = "null"
admins = { "focus@auth.jitsi.MYSERVER.ME" }

Component "jitsi-videobridge.jitsi.MYSERVER.ME"
    component_secret = "SECRET_1"

VirtualHost "auth.jitsi.MYSERVER.ME"
    ssl = {
        key = "/etc/prosody/certs/auth.jitsi.MYSERVER.ME.key";
        certificate = "/etc/prosody/certs/auth.jitsi.MYSERVER.ME.crt";
    }
    authentication = "internal_plain"

Component "focus.jitsi.MYSERVER.ME"
    component_secret = "SECRET_2"

VirtualHost "recorder.jitsi.MYSERVER.ME"
  ssl = {
      key = "/etc/letsencrypt/live/recorder.jitsi.MYSERVER.ME/privkey.pem";
      certificate =
"/etc/letsencrypt/live/recorder.jitsi.MYSERVER.ME/fullchain.pem";
  }
  modules_enabled = {
    "ping";
  }
  authentication = "internal_plain"

If I add "bosh" to the list of enabled modules for
recorder.jitsi.myserver.me, selenium remains online, and the bitrate
is around 800 then. But it's only a manual test.

If I begin testing jibri/scripts/start-ffmpeg.sh without exiting
selenium, selenium shuts down or crashes soon after. The best I get is
a one second long flv file (and that's if I stop recording in time,
otherwise the file is not playable). If I test start-ffmpeg.sh without
launching anything else, I get nothing, with the exception of a
picture of a bunch of penguins holding wings :slight_smile:

Completely on accident, I've just found out the ffmpeg problem might
have something to do with memory size:

jibri@debianvirtual:~/scripts$ ls -lahtr
bash: fork: Cannot allocate memory

How much memory does jibri even need? It doesn't seem to be consuming
more than 400M, not even 350M, so 1G should have been enough.

Anyway, the manual tests show that jibri sort of works... But the
manual tests is all that works, and even then I can't capture even a
minute long video.

I think I am not the only one who has or is yet to experience this problem.

Thanks in advance

[1] - https://github.com/jitsi/jibri