How to use use finalize.sh script inside jibri container with rclone

I’m trying to use rclone with jibri finalize.sh script. I followed this guide and successfully able to copy the files to google drive but I ran it outside docker container(manually running the rclone command to copy the recording). Since I’m running jibri docker container then Please guide me how can I use rclone in finalize.sh script.

first thing I know that I have to setup rclone in jibri container but I’m having a hard luck setting it up. if someone already tried it then please share the steps.

I tried to run finalize.sh script but I’m getting below error.


Cannot run program "/config/jibri/finalize.sh": error=2, No such file or directory with stack:
java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
org.jitsi.jibri.util.ProcessWrapper.start(ProcessWrapper.kt:87)
org.jitsi.jibri.service.impl.FileRecordingJibriService.finalize(FileRecordingJibriService.kt:207)
org.jitsi.jibri.service.impl.FileRecordingJibriService.stop(FileRecordingJibriService.kt:192)
org.jitsi.jibri.JibriManager.stopService(JibriManager.kt:257)
org.jitsi.jibri.api.xmpp.XmppApi.handleStopJibriIq(XmppApi.kt:256)
org.jitsi.jibri.api.xmpp.XmppApi.handleJibriIq(XmppApi.kt:162)
org.jitsi.jibri.api.xmpp.XmppApi.handleIq(XmppApi.kt:146)
org.jitsi.xmpp.mucclient.MucClient.handleIq(MucClient.java:547)
org.jitsi.xmpp.mucclient.MucClient.access$500(MucClient.java:50)
org.jitsi.xmpp.mucclient.MucClient$2.handleIQRequest(MucClient.java:511)
org.jivesoftware.smack.AbstractXMPPConnection$4.run(AbstractXMPPConnection.java:1188)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)

but when I check the file inside docker container, it is present

root@e18b455c2622:/# cat /config/jibri/finalize.sh
#! /usr/bin/bash

RECORDINGS_DIR=$1
echo "Recording dir is: $RECORDINGS_DIR"

Please help

Hello, did you solve this issue ?

yes. check below config

  1. env variable JIBRI_FINALIZE_RECORDING_SCRIPT_PATH: /config/jibri/finalize.sh
  2. map finalize.sh to /config/jibri/finalize.sh in docker volumes.
  3. if you are using non-docker setup then create a file in /config/jibri/finalize.sh location

I have been done to point 1 and 2, but still error “…error=2, No such file or directory…”

If my docker volume is : /root/jibri-docker

the I should map the finalize.sh in /root/jibri-docker/config/jibri/finalize.sh right ?

share your jibri.yml file please

version: ‘3’

services:
jibri1:
image: jitsi/jibri
restart: {RESTART_POLICY} volumes: - {CONFIG}/jibri1:/config:Z
- /dev/shm:/dev/shm
- /root/jibri-docker/config/.asoundrc1:/home/jibri/.asoundrc
- /root/jibri-docker/recordings:/config/recordings
cap_add:
- SYS_ADMIN
- NET_BIND_SERVICE
devices:
- /dev/snd:/dev/snd
extra_hosts:
- ‘my.example.com:172.16.1.50’
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

change it to

volumes:
            - ./config:/config:Z
            - ./config/rclone/rclone.conf:/home/jibri/.config/rclone/rclone.conf
            - ./config/jibri/finalize.sh:/config/jibri/finalize.sh
            - /dev/shm:/dev/shm

create a finalize.sh in ./config/jibri/ directory on your machine
and updat the value of JIBRI_FINALIZE_RECORDING_SCRIPT_PATH: /config/jibri/finalize.sh
now execute docker-compose -f jibri.yml up -d command

Thankyou, I will try it soon.

your working directory when finalize.sh is called is “/run/s6/services/30-jibri”
you can see that in docker logs

therefore your script should be using absolute path