Screen recording using lib-jitsi-meet & Jibri

hello everyone I hope all of you are well,

I need to implement screen recording functionality into my react web app using
lib-jitsi-meet API (low level)

in the conference object, I can see startRecording() prototype and I used it, but is not working
it returns an error like this

<error type="cancel">
          <item-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"></item-not-found></error>

so my question is how I can implement this functionality using Jibri with lib-jitsi-meet and how I can install Jibri into my self-hosted lib-jitsi-meet server

if I am asking the wrong question then sorry I am new with jitsi things

Thanks in Advance

What parameters are you calling startRecording with?

@saghul thanks for the quick reply

here is the parameter I passed

const confOptions = {
openBridgeChannel: true,
mode: ‘file’,
appData: null,
};

THis does nothing on that API call.

Do you have Jibri deployed on your server already?

in my self-hosted lib-jitsi-meet server?

Yes.

sorry but I think Jibri is not deployed in my self-hosted lib-jitsi-meet server
can you please tell me how I can do this.

If you haven’t deployed Jibri then the error is normal, since there is no recording capability available.

Check the README for installation instructions: GitHub - jitsi/jibri: Jitsi BRoadcasting Infrastructure

ok, thanks @saghul you are the best!!!

@saghul recently I configured Jibri with my lib-jitsi-meet self-hosted server
but now if I start my recording using room.startRecording(confOptions) it’s started recording but after a few minutes my self-host link stops working I can not understand why this type of stuff happens
can you please give me some suggestions or doc related to start recording or stopRecording

Check the jibri logs, they should contain at least a hint.

@saghul
I went through the logs also the screenshot is attached here. The logs file seems to look good

can you give me some suggestions on how I can start recording or stop recording

There’s no logs or detail in your post so I can’t guess what your problem is, but one thing to consider is that Jibri looks for certain values in the JS global context in order to understand that it has successfully connected to the call. jitsi-meet provides those values. If your app doesn’t, then Jibri will join the call and then after a short time it will time out saying that it failed to join, since it doesn’t find the values it’s looking for.

The easiest way to make it work with a custom lib-jitsi-meet app is to “pretend to be jitsi-meet” by providing the same values:

var APP = {
  conference: {
    _room: {
      isJoined: function() {
        return true;
      }
    }
  }
};

Once you have it working, you can replace return true with something that actually checks whether your app is successfully joined to the call or not.

1 Like

@jbg
sorry for providing less information about my issue
but can you please tell me how I could start my recording with Jitsi Meet global object
and which type of parameter is needed in this method
in my global Jitsi Object, I can see one method room.startRecording but I don’t have any idea which exact data they need to start recording or stop recording.

startRecording() is here: lib-jitsi-meet/JitsiConference.js at master · jitsi/lib-jitsi-meet · GitHub

it calls RecordingManager.startRecording() which is here: lib-jitsi-meet/RecordingManager.js at master · jitsi/lib-jitsi-meet · GitHub

The latter link has the documentation for the options parameter.

The only required option is mode which should be file for a recording or stream for a live stream. If you pass mode: "stream" then you need to pass the YouTube stream key (or RTMP URL) in the streamId option. For more info look at the above links, and if you have a problem using it, include the logs from jibri and the browser when asking for help.

thanks for the quick reply
as per your reply, I have already followed this format
but the confusion is how I can pass app Data in the options object and what the format of AppData

I need to pass the participant’s email or participant’s id in AppData
so how i can pass it

appData is a freeform object, put whatever you want in there (as long as it can be serialised to JSON). It ends up in the recording metadata JSON that Jibri saves.

@jbg thank you so much let me try with this.

@jbg if I pass the information in AppData then
Jibri return the error bellow

===> all Jibri services are busy

after removing AppData the error is gone

const confOptions = {
openBridgeChannel: true,
mode: ‘file’,
appData: { participants: participantsArray }
};

participnatArray is my all participant’s information

room?.startRecording(confOptions)

here is the Jibri log

any solution for this stuck

appData is an object

if you want to pass an array, put it inside an object, like appData: {participants: participantsArray}