Multiple Jibri Install on one server and record and streaming multiple conference

Hello Jitsi Team
Thank for help
Now i am happy to see my video conference working fine with help of jitsi team

My jitsi meet and jibri both are working fine. Streaming and Recording working properly. Now i want to record 100 + conference and according to many post i need to install jibri for each of conference recording or streaming. so i want to know how to install another jibri and how to change config.json file. can i install All Jibri on one server. If i install Jibri, can i see another jibri directory or it install on same directory, Can i seen another config.json or i have to change some thing on previous config.json file

I’m looking for a similar solution. As far as I know, you need one server for each jibri instance. There is a docker-jitsi-meet github (https://github.com/jitsi/docker-jitsi-meet) which includes some documentation on how to install multiple jibris (each with his own server but packaged in a docker container). Unfortunately, you still need to manually add one file in each new server which makes it not very practical - or user friendly - for easily scalable solutions as far as I can tell. Would be great if there would be some kind of automatic kubernetes set-up or indeed the possibilty to spin up multiple jibri instances on one server (automatically) depending on the load.

Thanks for reply
Which file i need to add manually in jibri so that i can record and stream many conference on same time

Check out the readme of Docker-Jitsi-Meet https://github.com/jitsi/docker-jitsi-meet/ and this github issue https://github.com/jitsi/docker-jitsi-meet/issues/416

Dear raazdev :

I do n’t know if I can share your construction experience. I have encountered many problems, first like DevToolsActivePort file doesn’t exist problem.
Later, I encountered a video recording failure. org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegProcessUpdate() Ffmpeg quit abruptly. Last output line: :0.0+0,0: Input/output error.
I wonder if you can provide your construction experience for my reference.
May I ask the following two questions:

  1. Whether it is built on a virtual machine
  2. The system which one you used
    ubuntu 16.0.4LTS
    ubuntu 18.0.4LTS
    Kind of?

Hai @elgigi, I am deploying multiple Jibri instances on docker using https://github.com/jitsi/docker-jitsi-meet and already follow the official guide properly but still faced an issue when recording in the second instance, for the first instance is working fine. I deployed docker Jibri in google cloud with a compute engine ubuntu server 16.04.
I will explain to you what I have done besides what is in the official guide. I updated jibri.yml to make it standalone. I just removed depends_on Jicofo and networks meet.jitsi. Here is my jibri.yml :

version: '3'

services:
    jibri:
        image: jitsi/jibri
        restart: ${RESTART_POLICY}
        volumes:
            - ${CONFIG}/jibri:/config
            - /dev/shm:/dev/shm
        cap_add:
            - SYS_ADMIN
            - NET_BIND_SERVICE
        devices:
            - /dev/snd:/dev/snd
        environment:
            - XMPP_AUTH_DOMAIN
            - XMPP_INTERNAL_MUC_DOMAIN
            - XMPP_RECORDER_DOMAIN
            - XMPP_SERVER
            - XMPP_DOMAIN
            - JIBRI_XMPP_USER
            - JIBRI_XMPP_PASSWORD
            - JIBRI_BREWERY_MUC
            - JIBRI_RECORDER_USER
            - JIBRI_RECORDER_PASSWORD
            - JIBRI_RECORDING_DIR
            - JIBRI_FINALIZE_RECORDING_SCRIPT_PATH
            - JIBRI_STRIP_DOMAIN_JID
            - JIBRI_LOGS_DIR
            - DISPLAY=:0
            - TZ

I run the first instance using this command :

docker-compose -f jibri.yml up -d

After the first instance goes up, I change /home/jibri/.asoundrc to setup the second instance :

...
slave.pcm "hw:Loopback_1,0,0"
...
slave.pcm "hw:Loopback_1,0,1"
...
slave.pcm "hw:Loopback_1,1,1"
...
slave.pcm "hw:Loopback_1,1,0"
...

And then run the second instance using this command :

docker-compose -f jibri.yml up -d --scale jibri=2

Like I stated before, the first instance is working fine. The video has shown in ~/.jitsi-meet-cfg/jibri/recordings . but as for the second instance got this error on log.0.txt.1 :

2020-04-27 06:11:18.607 INFO: [59] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegProcessUpdate() Ffmpeg quit abruptly. Last output line: plug:cloop: Input/output error
2020-04-27 06:11:18.609 INFO: [59] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegStateMachineStateChange() Ffmpeg capturer transitioning from state Starting up to Error: SESSION Ffmpeg failed to start
2020-04-27 06:11:18.611 INFO: [59] org.jitsi.jibri.service.impl.FileRecordingJibriService.onServiceStateChange() File recording service transitioning from state Starting up to Error: SESSION Ffmpeg failed to start
2020-04-27 06:11:18.612 INFO: [59] org.jitsi.jibri.api.xmpp.XmppApi.invoke() Current service had an error, sending error iq

and here is ffmpeg.0.txt.1 error log :

2020-04-27 06:11:13.769 INFO: [59] ffmpeg.call() Input #0, x11grab, from ‘:0.0+0,0’:
2020-04-27 06:11:13.769 INFO: [59] ffmpeg.call() Duration: N/A, start: 1587960673.724562, bitrate: N/A
2020-04-27 06:11:13.769 INFO: [59] ffmpeg.call() Stream #0:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 1280x720, 30 fps, 1000k tbr, 1000k tbn, 1000k tbc
2020-04-27 06:11:13.769 INFO: [59] ffmpeg.call() ALSA lib pcm_dsnoop.c:618:(snd_pcm_dsnoop_open) unable to open slave
2020-04-27 06:11:13.769 INFO: [59] ffmpeg.call() [alsa @ 0x55f311051e80] cannot open audio device plug:cloop (Device or resource busy)
2020-04-27 06:11:13.769 INFO: [59] ffmpeg.call() plug:cloop: Input/output error

I suspect the Jibri instance doesn’t read .asoundrc file. So all instances still use the same loopback therefore the second instance got the error. I have updated with the wrong one and renamed it to .bsoundrc to make an error. But the first instance is working fine.
Any suggestions to fix this issue?
Thanks in advance.

I’ve been using Ubuntu 18.0.4 LTS without problems on a VPS by DigitalOcean @iscsm12
I do need a server of at least 16 GB memory though.

Unfortunately, I haven’t deployed multiple Docker-Jibris on one server yet @Redmare so I don’t think I’ll be of great help here. Your findings seem to make sense. Have you posted in the Github issues of the Jitsi-Docker and/or Jibri regarding the reading of .asoundrc?

I hope someone else can shed some light on this as I’ll have the same issue later when deploying multiple instances.

Just change the Loopback in /home/jibri/.asoundrc to anyname you like
for example

sed -i ‘s/Loopback/Loopback-1/g’ /home/jibri/.asoundrc`

Make sure you also restart the instance after this
and it’s working good

Hello Brother @itsmaniche18

If I need to have 10 of dockerized jibri (scale up automatically), how the best method to change the loopback?

Super thanks :+1:

I am too working on this now.
I will post it when completed

For now you can use docker file of jibri

[root@containers docker-jitsi-meet]# cat jibri.yml
version: ‘3’

services:
jibri:
image: jitsi/jibri
volumes:
- ${CONFIG}/jibri:/config
- /dev/shm:/dev/shm
cap_add:
- SYS_ADMIN
- NET_BIND_SERVICE
devices:
- /dev/snd:/dev/snd
environment:
- XMPP_AUTH_DOMAIN
- XMPP_INTERNAL_MUC_DOMAIN
- XMPP_RECORDER_DOMAIN
- XMPP_SERVER
- XMPP_DOMAIN
- JIBRI_XMPP_USER
- JIBRI_XMPP_PASSWORD
- JIBRI_BREWERY_MUC
- JIBRI_RECORDER_USER
- JIBRI_RECORDER_PASSWORD
- JIBRI_RECORDING_DIR
- JIBRI_FINALIZE_RECORDING_SCRIPT_PATH
- JIBRI_STRIP_DOMAIN_JID
- JIBRI_LOGS_DIR
- DISPLAY=:0
- TZ

And .env Files

  environment:
      - XMPP_AUTH_DOMAIN =  auth.yourdomain.com
      - XMPP_INTERNAL_MUC_DOMAIN = internal.auth.yourdomain.com 
      - XMPP_RECORDER_DOMAIN = recorder.yourdomain.com
      - XMPP_SERVER = yourdomain.com
      - XMPP_DOMAIN = yourdomain.com
      - JIBRI_XMPP_USER = jibri
      - JIBRI_XMPP_PASSWORD = jibriauthpass
      - JIBRI_BREWERY_MUC   = JibriBrewery
      - JIBRI_RECORDER_USER =  recorder
      - JIBRI_RECORDER_PASSWORD  =  jibrirecorderpass
      - JIBRI_RECORDING_DIR   =  /config/recordings
      - JIBRI_FINALIZE_RECORDING_SCRIPT_PATH  =  /config/finalize.sh
      - JIBRI_STRIP_DOMAIN_JID = conference
      - JIBRI_LOGS_DIR  =  /config/logs
      - DISPLAY=:0
      - TZ  = Asia/Kathmandu

Thanks
Manish

Hello I have completed the project

use a1-statefulset.yaml and a2-statefulset.yaml files for pods deployment.

Use the link

@itsmaniche18 any guide on how to achieve the same for docker ?

[root@containers docker-jitsi-meet]# cat jibri.yml
version: ‘3’

services:
jibri:
image: jitsi/jibri
volumes:

  • ${CONFIG}/jibri:/config
  • /dev/shm:/dev/shm
    cap_add:
  • SYS_ADMIN
  • NET_BIND_SERVICE
    devices:
  • /dev/snd:/dev/snd
    environment:
  • XMPP_AUTH_DOMAIN
  • XMPP_INTERNAL_MUC_DOMAIN
  • XMPP_RECORDER_DOMAIN
  • XMPP_SERVER
  • XMPP_DOMAIN
  • JIBRI_XMPP_USER
  • JIBRI_XMPP_PASSWORD
  • JIBRI_BREWERY_MUC
  • JIBRI_RECORDER_USER
  • JIBRI_RECORDER_PASSWORD
  • JIBRI_RECORDING_DIR
  • JIBRI_FINALIZE_RECORDING_SCRIPT_PATH
  • JIBRI_STRIP_DOMAIN_JID
  • JIBRI_LOGS_DIR
  • DISPLAY=:0
  • TZ

And .env Files

  environment:
      - XMPP_AUTH_DOMAIN =  auth.yourdomain.com
      - XMPP_INTERNAL_MUC_DOMAIN = internal.auth.yourdomain.com 
      - XMPP_RECORDER_DOMAIN = recorder.yourdomain.com
      - XMPP_SERVER = yourdomain.com
      - XMPP_DOMAIN = yourdomain.com
      - JIBRI_XMPP_USER = jibri
      - JIBRI_XMPP_PASSWORD = jibriauthpass
      - JIBRI_BREWERY_MUC   = JibriBrewery
      - JIBRI_RECORDER_USER =  recorder
      - JIBRI_RECORDER_PASSWORD  =  jibrirecorderpass
      - JIBRI_RECORDING_DIR   =  /config/recordings
      - JIBRI_FINALIZE_RECORDING_SCRIPT_PATH  =  /config/finalize.sh
      - JIBRI_STRIP_DOMAIN_JID = conference
      - JIBRI_LOGS_DIR  =  /config/logs
      - DISPLAY=:0
      - TZ  = Asia/Kathmandu

Thanks
Manish

@itsmaniche18, Any documentation on how to achieve scaling multiple instances of Jibri on same servers?

I used python to scale up the containers as n+2 numbers when the session is n.

Thanks Manish. do we need to spin off separate servers for each recording session. can we have multiple instances of Jibri on a single server with larger capacity?

We can have multiple instance of jibri in a single server
See below link

1 Like

Hi @itsmaniche18 in this .yaml file I found I need to give below items. My query is here IP and host name will be the IP sand hostname of Jitsi serve? Please correct me if I am wrong. I need to install almost 40 jibri instances, so this one is the best solution you have shared.

hostAliases:
- ip: ‘1.1.1.1’
hostnames:
- example.com

You don’t have to include this

Thanks @itsmaniche18 for your response.