Skip to main content

how to install jibri recording server within a hour in ubuntu 16.04 (Xenial)



To configuring the jibri recording server from below easy steps 
Note: Please put the more focus on highlighted line and words  :

       Pre-requisite for jibri recording server  :
        OS-VM:  Ubuntu 16.04 VMs on your cloud server (Azure,GC,AWS,Vultr, digitalOcean).
        CPU: 2.0
        RAM: 4 GB
        SSD or HDD :20 GB
Update the Ubuntu package  
  1. sudo -s
  2. apt update

Allow to require ports 
  • ufw status
  • => “Active or inactive does not matter”
  • ufw allow ssh
  • ufw allow 80/tcp
  • ufw allow 443/tcp
  • ufw allow 10000:60000/tcp
  • ufw allow 10000:60000/udp
  • ufw allow 5222
  • ufw allow 5347
  • netstat -tunlp // list out the all open ports 
Installing kernel modules
  1. apt -y install linux-image-extra-virtual
  2. uname -a 
Note : After uname -a command  there are two possibilities A and B . 
            A.  if you get below output, it mean kernal module has configured as generic .
Linux <username> 4.4.0-157-generic#  185-Ubuntu SMP Tue Jul 23 09:17:01 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
           B. if you get below output it means  Kernal has not configured as  generic  , so  need check modprobe  command 
Linux <username> 4.4.0-157-Azure or Linux <username> 4.4.0-157-AWS  

modprobe  command
  • modprobe snd-aloop 
Note : After above command if you get below errors, it means version is miss match then need follow  Kernal version configuration  steps . 
modprobe: FATAL: Module snd-aloop not found in directory /lib/modules/4.4.0-1052-aws or azure 

Kernal version configuration 
  1. open the  grub file from  below command
  2.   vim /etc/default/grub     // open the grub file and edit the below line save it . 
    edit the line number 6  (change from GRUB_DEFAULT=0 to GRUB_DEFAULT="1>2")
  1. update-grub    // this is a upgrade command which update the grub file 
  2. reboot            // reboot command is a mandatory because often does not update the system file without reboot .  

After reboot the jibri VMs need to check that VM has been change as generic kernal  or not 

  1. uname -a                           // it will show as generic ( Linux rtc-v1-jibri 4.4.0-157-generic) instead of azure or aws 
  2. modprobe snd-aloop        //(now,  there is no error )
  3. lsmod | grep snd_aloop      // Search that snd_aloop if it is configured then it shows some output as bellow is depicted 

snd_aloop              24576  0
snd_pcm               106496  1 snd_aloop
snd                    86016  3 snd_aloop,snd_timer,snd_pcm

    4. echo "snd-aloop" >> /etc/modules    //  move snd_aloop  into  /etc/modules  

Note : Now kernel module has been configured so now install the jibri from steps  
   
Install the required  dependencies from below commands 
  1. curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add
  2. echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list
  3. apt-get -y update
  4. apt-get -y install google-chrome-stable

Install the  Chromedriver  from below commands 

  1. CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`
  2. wget -N http://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip -P ~/
  3. unzip ~/chromedriver_linux64.zip -d ~/
  4. rm ~/chromedriver_linux64.zip
  5. sudo mv -f ~/chromedriver /usr/local/bin/chromedriver
  6. sudo chown root:root /usr/local/bin/chromedriver
  7. sudo chmod 0755 /usr/local/bin/chromedriver
    
Install the  required dependencies  from below command 
  1. install default-jre-headless ffmpeg curl alsa-utils icewm xdotool xserver-xorg-input-void xserver-xorg-video-dummy

Install Jibri debain Repo from below commands 

  1. wget -qO - https://download.jitsi.org/jitsi-key.gpg.key | sudo apt-key add - 
  2. sudo sh -c "echo 'deb https://download.jitsi.org stable/' > /etc/apt/sources.list.d/jitsi-stable.list"
  3. sudo apt-get update 
  4. sudo apt-get install jibri    
Jibri config file 
  1. mkdir /srv/recordings.                    // create a recordings directory where you want to save all recorded files  (i usually keep  /home/raj/recordings)
  2. chown jibri:jitsi /srv/recordings.    // change the owner and group of directory  
  3. sudo vi /etc/jitsi/jibri/config.json   // open config file  and change the below line 
Note : Please make changes very carefully otherwise it will throw  errors . 
// Where recording files should be temporarily stored
    "recording_directory":"/srv/recordings",
….
// The hosts of the XMPP servers to connect to as part of
            //  this environment
            "xmpp_server_hosts": [
                “jitsi-conf.abc.com"
            ],
            // The xmpp domain we'll connect to on the XMPP server
            "xmpp_domain": "jitsi-conf.abc.com",
// Jibri will login to the xmpp server as a privileged user 
            "control_login": {
                // The domain to use for logging in
                "domain": "auth.jitsi-conf.abc.com",
                // The credentials for logging in
                "username": "jibri",
                "password": "jibriauthpass"
            },
            // Using the control_login information above, Jibri will join 
            //  a control muc as a means of announcing its availability
//  to provide services for a given environment
            "control_muc": {
                "domain": "internal.auth.jitsi-conf.abc.com",
                "room_name": "JibriBrewery",
                "nickname": "jibri-raj"
            },
            // All participants in a call join a muc so they can exchange
            //  information.  Jibri can be instructed to join a special muc
            //  with credentials to give it special abilities (e.g. not being
            //  displayed to other users like a normal participant)
            "call_login": {
                "domain": "recorder.jitsi-conf.abc.com",
                "username": "recorder",
                "password": "jibrirecorderpass"
            },

Once done the all above configurations need to restart jibri server 
  1. systemctl restart jibri   
  2. systemctl status jibri 

Go to on main server configuration  : (Where jitsi-meet , jicofo and JVB component are running )

    Prosody server configurations 
  1. vi  /etc/prosody/conf.d/jitsi-conf.abc.com.cfg.lua  //  open prosody config file 
--Jibri configurations ------- 
Component "internal.auth.jitsi-conf.abc.com" "muc"
    modules_enabled = {
      "ping";
    }
    storage = "null"
    muc_room_cache_size = 1000

VirtualHost "recorder.jitsi-conf.abc.com"
  modules_enabled = {
    "ping";
  }
  authentication = "internal_plain"
Setup the two accounts jibri fro below commands .

     1.   prosodyctl register jibri auth.jitsi-conf.abc.com jibriauthpass
     2.  prosodyctl register recorder recorder.jitsi-conf.abc.com jibrirecorderpass

Jicofo server configurations  
  1. vi /etc/jitsi/jicofo/sip-communicator.properties. // open file and add below line 
  org.jitsi.jicofo.jibri.BREWERY=JibriBrewery@internal.auth.jitsi-conf.abc.com
org.jitsi.jicofo.jibri.PENDING_TIMEOUT=90

Jitsi-meet server configurations 
  1. vi /etc/jitsi/meet/jitsi-conf.abc.com-config.js.  // Need to edit below line 
fileRecordingsEnabled: true, // If you want to enable file recording
liveStreamingEnabled: true, // If you want to enable live streaming

 hiddenDomain: 'recorder.jitsi-conf.abc.com',

Check require  buttons enable or not in "TOOLBAR"
  1. sudo vi /usr/share/jitsi-meet/interface_config.js   // Need to check toolbar button enable or not  ('recording' , 'livestreaming',)
TOOLBAR_BUTTONS: [
        'microphone', 'camera', 'closedcaptions', 'desktop', 'fullscreen',
        'fodeviceselection', 'hangup', 'profile', 'info', 'chat', 'recording',
        'livestreaming', 'etherpad', 'sharedvideo', 'settings', 'raisehand',
        'videoquality', 'filmstrip', 'invite', 'feedback', 'stats', 'shortcuts',
        'tileview'
    ],

Open Jibri server VM 

13 . Use username 'jibri' and group name 'jibri', should be allow
  1. sudo usermod -aG adm,audio,video,plugdev jibri  //There are two possible errors A and B  If you get below message after  run the above command 
A.  If there is no any output after the above command then it seems good .
B. If there are some output seems like the below then need to remove unscd  package
  
 sent invalidate(passwd) request, exiting
  sent invalidate(group) request, exiting
  1. sudo apt remove unscd   //  remove unscd  package (if there are errors ,  please follow  How to remove unscd in below of this page)
Note : after removing  the package need to check  snd_aloop is avaible or not by below command .
  1. smod | grep snd_aloop  //if there are any output then neetd follow  Ffmeg  test command  steps
Ffmeg  test command 

  1. sudo arecord -L      // After this command there are two possible output A and B   
A. If you get long listing from above command it means .it means working fine & need to restart jibri  
B. If you get null   Discard all samples (playback) or generate zero samples (capture)

  1. if discard errors come then need to do below steps 
  2. systemctl stop jibri
  3. echo "snd-aloop" >> /etc/modules
  4. modprobe snd-aloop
How to remove unscd  (You can get more info from this reference like )
Uninstall unscd
To remove just unscd package itself from Ubuntu 16.04 (Xenial Xerus) execute on terminal:
  1. sudo apt-get remove unscd
Uninstall unscd and it's dependent packages
To remove the unscd package and any other dependant package which are no longer needed from Ubuntu Xenial.
  1. sudo apt-get remove --auto-remove unscd
Purging unscd
If you also want to delete configuration and/or data files of unscd from Ubuntu Xenial then this will work:
  1. sudo apt-get purge unscd
To delete configuration and/or data files of unscd and it's dependencies from Ubuntu Xenial then execute:
  1. sudo apt-get purge --auto-remove unscd
Note: Before start the conference call and recording need restart all server from below commands 
  • restart again (systemctl restart nginx.service )
  • systemctl restart jitsi-videobridge2.service
  • systemctl restart jicofo.service
  • systemctl restart prosody.service
  • systemctl restart jibri.service




Comments

  1. for me aws kernal related settings not worked, mabe becuase of another/latest version of aws, maybe this will help someone which i get:
    aws ubuntu 16
    ###################################
    apt install linux-generic

    vi /etc/default/grub >> add below lines in place of GRUB_DEFAULT=0

    # Make the latest generic kernel the default
    release=$(linux-version list | grep -e '-generic$' | sort -V | tail -n1)
    GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux $release"

    update-grub
    reboot
    uname -a
    ###################################

    ReplyDelete
  2. Tanks for data and procedures.

    I need Help: installed JISTI meet on server_vps_A.com and JIBRI on server_vps_B.com,
    Jisti meet works well with 2 or more than 20 users on server_vps_A.com:
    JIBRi was installed following the steps of https://github.com/jitsi/jibri#manually-testing-jibri, but the question is whether Configuring a Jitsi Meet environment for Jibri was done correctly:

    When trying to transmit on YouTube or record the videoconference, an orange sign appears on the right that says:
    RECORDING NOT AVAILABLE
    Oops! The recording Service is currently unavaliable. We’re working on solving the issue. Please tray again later.

    Perhaps some parameter has been misconfigured:
    Changes are made on server_vps_A.com are: (changes are made on JISTI server?)

    Prosody :
    /etc/prosody/prosody.cfg.lua

    internal muc component, meant to enable pools of jibri and jigasi clients
    Component “internal.auth.servidor_vps_B.com” “muc”
    modules_enabled = {
    “ping”;
    }
    storage = “null”
    muc_room_cache_size = 1000
    VirtualHost “recorder.servidor_vps_B.com”
    modules_enabled = {
    “ping”;
    }
    authentication = “internal_plain”

    the configuration of the 2 accounts so that you can use them JIBRI run on the server_vps_A.com pointing to the domain server_vps_B.com?

    prosodyctl register jibri auth.servidor_vps_B.com jibriauthpass
    prosodyctl register recorder recorder.servidor_vps_B.com jibrirecorderpass

    Jicofo :

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

    emphasized text org.jitsi.jicofo.jibri.BREWERY=JibriBrewery@internal.auth. vps_B.com_server
    org.jitsi.jicofo.jibri.PENDING_TIMEOUT = 90

    Jisti Meet:
    /etc/jitsi/meet/yourdomain-config.js
    fileRecordingsEnabled: true, // If you want to enable file recording
    liveStreamingEnabled: true, // If you want to enable live streaming
    hiddenDomain: 'recorder. vps_B_server ',

    Interface Config:
    /usr/share/jitsi-meet/interface_config.js
    Active on TOOLBAR_BUTTONS array recordingvalue button and button livestreamingvalue

    Thank you

    ReplyDelete
  3. Are you able to do recording in normal mode("srv/recordings" directory) ?

    ReplyDelete
  4. Thanks a lot bro... its really helpful...

    ReplyDelete
  5. install default-jre-headless ffmpeg curl alsa-utils icewm xdotool xserver-xorg-input-void xserver-xorg-video-dummy

    install: target 'xserver-xorg-video-dummy' is not a directory

    ReplyDelete
  6. Please check your command properly might be typo

    ReplyDelete
  7. Hi Raj,
    can u help me ? i've tried so many times install jibri on ubuntu 16.04 and always failed.
    last time i follow your tutorial here, the jibri is running like below :

    root@jibri:~# systemctl status jibri
    ● jibri.service - Jibri Process
    Loaded: loaded (/etc/systemd/system/jibri.service; disabled; vendor preset: enabled)
    Active: active (running) since Sen 2020-07-27 16:34:43 WIB; 5s ago
    Process: 2139 ExecStop=/opt/jitsi/jibri/graceful_shutdown.sh (code=exited, status=7)
    Main PID: 2146 (java)
    CGroup: /system.slice/jibri.service
    └─2146 java -Djava.util.logging.config.file=/etc/jitsi/jibri/logging.properties -jar /opt/jitsi/jibri/jibri.jar --config /etc/jitsi/jibri/config.json

    Jul 27 16:34:43 jibri systemd[1]: Started Jibri Process.
    Jul 27 16:34:44 jibri launch.sh[2146]: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
    Jul 27 16:34:44 jibri launch.sh[2146]: SLF4J: Defaulting to no-operation (NOP) logger implementation
    Jul 27 16:34:44 jibri launch.sh[2146]: SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
    root@jibri:~#

    but when i try to start recording, it's failed , then the log below :

    root@jibri:~# grep -i "error\|warning\|severe" /var/log/jitsi/jibri/log.0.txt
    2020-07-27 16:34:44.757 WARNING: [1] org.glassfish.jersey.internal.inject.Providers.checkProviderRuntime() A provider org.jitsi.jibri.api.http.internal.InternalHttpApi registered in SERVER runtime does not implement any provider interfaces applicable in the SERVER runtime. Due to constraint configuration problems the provider org.jitsi.jibri.api.http.internal.InternalHttpApi will be ignored.
    2020-07-27 16:34:44.997 WARNING: [20] org.jitsi.xmpp.mucclient.MucClient.log() Disabling certificate verification!
    2020-07-27 16:34:45.041 WARNING: [1] org.glassfish.jersey.internal.inject.Providers.checkProviderRuntime() A provider org.jitsi.jibri.api.http.HttpApi registered in SERVER runtime does not implement any provider interfaces applicable in the SERVER runtime. Due to constraint configuration problems the provider org.jitsi.jibri.api.http.HttpApi will be ignored.
    root@jibri:~#

    ReplyDelete
  8. what is output of the "modprobe snd-aloop" command

    ReplyDelete
  9. please wait Raj, i try to reinstalling again from your tutorial ,
    i'll post the result ,
    o ya, for the beggining this is my situation :
    1. installed ubuntu 16.04 with kernel 4.1.5 ( did i have to boot using kernel 4.4 ? ) i never succeed to change kernel boot to 4.4
    2. did jibri have to install using public IP ? or it can installing using ip LAN behind router ?
    3. if have to use public ip, i have one , it will be 1 subnet with my jitsi server
    jitsi : 115.84.32.aa
    jibri : 115.84.32.bb ( if have to install using public ip )

    please advice.

    ReplyDelete
  10. I think, you should have to install with public in same subnet

    ReplyDelete
  11. hi Raj,

    I've just finished installing with your tutorial, i see there's different between yours and
    https://github.com/jitsi/jibri

    here :
    i've no seen here :

    Add chrome managed policies file and set CommandLineFlagSecurityWarningsEnabled to false. It will hide warnings in Chrome. You can set it like so:

    mkdir -p /etc/opt/chrome/policies/managed
    echo '{ "CommandLineFlagSecurityWarningsEnabled": false }'

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





    ReplyDelete
  12. my linux ubuntu kernel is :

    root@jibri:~# hostnamectl

    Static hostname: jibri

    Icon name: computer-server

    Chassis: server

    Machine ID: 567ac96b1e664393b9fa3fdb6878a00a

    Boot ID: 1536d605331342229e43da1577ca8d49


    Operating System: Ubuntu 16.04.6 LTS

    Kernel: Linux 4.15.0-45-generic

    Architecture: x86-64


    root@jibri:~#

    and i add that command , here the result

    root@jibri:~# nano /etc/hosts

    root@jibri:~# service jibri status

    ● jibri.service - Jibri Process

    Loaded: loaded (/etc/systemd/system/jibri.service; disabled; vendor preset: enabled)

    Active: active (running) since Rab 2020-07-29 17:07:44 WIB; 1min 6s ago

    Process: 1711 ExecStop=/opt/jitsi/jibri/graceful_shutdown.sh (code=exited, status=7)

    Main PID: 1717 (java)

    CGroup: /system.slice/jibri.service

    ├─1717 java -Djava.util.logging.config.file=/etc/jitsi/jibri/logging.properties -jar /opt/jitsi/jibri/jibri.jar --config /etc/jitsi/jibri/config.json

    └─1759 /usr/local/bin/chromedriver --port=29828 --log-path=/tmp/chromedriver.log


    Jul 29 17:07:44 jibri systemd[1]: Started Jibri Process.

    Jul 29 17:07:45 jibri launch.sh[1717]: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".

    Jul 29 17:07:45 jibri launch.sh[1717]: SLF4J: Defaulting to no-operation (NOP) logger implementation

    Jul 29 17:07:45 jibri launch.sh[1717]: SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

    Jul 29 17:08:10 jibri launch.sh[1717]: Starting ChromeDriver 84.0.4147.30 (48b3e868b4cc0aa7e8149519690b6f6949e110a8-refs/branch-heads/4147@{#310}) on port 29828

    Jul 29 17:08:10 jibri launch.sh[1717]: Only local connections are allowed.

    Jul 29 17:08:10 jibri launch.sh[1717]: Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.

    Jul 29 17:08:10 jibri launch.sh[1717]: ChromeDriver was started successfully.

    ReplyDelete
  13. root@jibri:~#

    but the recording is failed

    here's another log :

    root@jibri:~# grep -i "error\|warning\|severe" /var/log/jitsi/jibri/log.0.txt

    2020-07-29 17:07:45.979 WARNING: [1] org.glassfish.jersey.internal.inject.Providers.checkProviderRuntime() A provider org.jitsi.jibri.api.http.internal.InternalHttpApi registered in SERVER runtime does not implement any provider interfaces applicable in the SERVER runtime. Due to constraint configuration problems the provider org.jitsi.jibri.api.http.internal.InternalHttpApi will be ignored.

    2020-07-29 17:07:46.220 WARNING: [20] org.jitsi.xmpp.mucclient.MucClient.log() Disabling certificate verification!

    2020-07-29 17:07:46.269 WARNING: [1] org.glassfish.jersey.internal.inject.Providers.checkProviderRuntime() A provider org.jitsi.jibri.api.http.HttpApi registered in SERVER runtime does not implement any provider interfaces applicable in the SERVER runtime. Due to constraint configuration problems the provider org.jitsi.jibri.api.http.HttpApi will be ignored.

    2020-07-29 17:08:14.222 SEVERE: [35] org.jitsi.jibri.api.xmpp.XmppApi.handleStartJibriIq() Error starting Jibri service : org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally.

    (unknown error: DevToolsActivePort file doesn't exist)

    (Driver info: chromedriver=84.0.4147.30 (48b3e868b4cc0aa7e8149519690b6f6949e110a8-refs/branch-heads/4147@{#310}),platform=Linux 4.15.0-45-generic x86_64) (WARNING: The server did not provide any stacktrace information)

    org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)

    org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)

    2020-07-29 17:11:52.148 SEVERE: [51] org.jitsi.jibri.api.xmpp.XmppApi.handleStartJibriIq() Error starting Jibri service : org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally.

    (unknown error: DevToolsActivePort file doesn't exist)

    (Driver info: chromedriver=84.0.4147.30 (48b3e868b4cc0aa7e8149519690b6f6949e110a8-refs/branch-heads/4147@{#310}),platform=Linux 4.15.0-45-generic x86_64) (WARNING: The server did not provide any stacktrace information)

    org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)

    org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)

    root@jibri:~#

    please advice

    ReplyDelete
  14. How to configure multiple jibri server recording and streaming, can you pls share the configuration here

    ReplyDelete
  15. Hello

    I followed the instructions but the
    /etc/jitsi/jibri/config.json file is missing

    Can you please help?

    ReplyDelete
    Replies
    1. me too
      same problem here
      did you manage to solve it ??

      Delete
  16. Hi.

    I have a jitsi installed in a own server (Ubuntu 18.04 LTS).

    I followed this tutorial but the problem is that the record is empty. Generates mp4 file, but duration is 00:00:00 (no image or sound). So, the problem is that when you do a sudo arecord -L for test, always appears "null discard all samples (playback) or generate zero samples (capture)"

    Any ideas?

    ReplyDelete

Post a Comment

Popular posts from this blog

Scale multiple Jibri recoding instance with Docker on Single VM

Scale multiple  Jibri  instance with Docker (2020 steps ) 1. Requirements   Any linux distrobution with Alsa/Pulseaudio support. Proper Internet access. Docker installed. Required kernel module for playback interfaces Valid SSL certificate  for jitsi-web instance. 1.1 Install required module for the kernel Keep in mind, after installation maybe required to  reboot . # install the module apt update && apt install linux-image-extra-virtual # configure 5 capture/playback interfaces echo "options snd-aloop enable=1,1,1,1,1 index=0,1,2,3,4" > /etc/modprobe.d/alsa-loopback. conf # setup autoload the module echo "snd-aloop" >> /etc/modules # check that the module is loaded lsmod | grep snd_aloop 2. Deploy jitsi-meet stack.  Prerequisite to  deploy whole jitsi meet based on official documentation, You should have working version of jitsi-meet stack with ability to record at least one session. 3. Scale  Jibri  instances you can scale container of  Jibri  wit