Getting Started

Prerequistes

The following are required before following this tutorial

  • You have a working Jitsi Installation.
  • You have configured Jibri to work with your Jitsi Installation.
  • Make sure you have the latest stable version of ffmpeg installed on Jibri.

Quick Start

Assuming our config.json looks like the one below

{
  "recording_directory": "/home/recordings",
  "finalize_recording_script_path": "/home/finalize_recording.sh",
  "xmpp_environments": [
    {
      "name": "prod environment",
      "xmpp_server_hosts": ["jitsimeet.easyjitsi.com"],
      "xmpp_domain": "jitsi.easyjitsi.com",
      "control_login": {
        "domain": "auth.jitsimeet.easyjitsi.com",
        "username": "jibri",
        "password": "jibriauthpass"
      },
      "control_muc": {
        "domain": "internal.auth.jitsimeet.easyjitsi.com",
        "room_name": "JibriBrewery",
        "nickname": "jibri-nickname-instance"
      },
      "call_login": {
        "domain": "recorder.easyjitsi.com",
        "username": "recorder",
        "password": "jibrirecorderpass"
      },
      "room_jid_domain_string_to_strip_from_start": "conference.",
      "usage_timeout": "0"
    }
  ]
}

Ssh into your Jibri Server

 

 

ssh root@192.168.100.1 "cd /home/"

Populate the finalize script file with the content below

#!/bin/sh

RECORDINGS_DIR=$1
RECORDINGS=`ls $RECORDINGS_DIR/*.mp4`
RECORDINGS=`basename $RECORDINGS`
FOLDER_NAME=$(echo $RECORDINGS | tr "_" "\n")
FILE_NAME=$(basename $(ls $RECORDINGS_DIR/*.mp4))

concat(){
echo "Concatenating..."

cat /home/recordings/concatenate > /tmp/concatenate

cp /home/recordings/intro.mp4 /tmp/intro.mp4

cp $RECORDINGS_DIR/*.mp4 /tmp

OUTPUT=$(tempfile)

sed -i s/video/"$FILE_NAME"/g /tmp/concatenate

ffmpeg -f  concat -safe 0 -i /tmp/concatenate  $OUTPUT.mp4 &&
rm $RECORDINGS_DIR/*.mp4 && cp -vf $OUTPUT.mp4 $RECORDINGS_DIR/$FILE_NAME

concat()
}

Copy your additional video file to your recordings directory

rsync -e ssh --info=progress2 intro.mp4 root@192.168.100.1:/home/recordings

Ssh into your Jibri Server

ssh root@192.168.100.1 "cd /home/recordings"

Make a file called concatenate in the same directory

This file describes the way you wish the videos to be concatenated and the positioning

touch concatenate

The arrangement of the mp4 files is exactly how the output of the concatenation would be.

echo -e "file intro.mp4\nfile video"$

The current configuration merges concatenates the intro files with the jitsi recording

Author

Write A Comment