Jibri recording resolution - to record a full window at 720p without cropping

Hello,
to help offset the amount of encoding power needed for a video recording, I would like to lower the resolution of the file Jibri/ffmpeg is recording to be 720p or even 360p.

I have been able to lower the resolution of the output file using the following:
/etc/jitsi/jibri/jibri.conf

  ffmpeg {
    resolution = "1280x720"
  }

This will be passed to ffmpeg when encoding the file and works great - except that the output is a clipped version of the browser window, screenshot to try and show it:


What’s happening is the top left corner, through to 1280x720 is being captured - the rest is being cropped off from the full 1080p sized window.

What it seems I would need to do is lower the resolution that selenium is opening a window.

I’ve tried this, and it does not seem to change anything:
/etc/jitsi/jibri/jibri.conf

  chrome {
    // The flags which will be passed to chromium when launching
    // We used to use start-maximized
    flags = [
      "--use-fake-ui-for-media-stream",
      "--window-size=1280,720",
      "--kiosk",
      "--enabled",
      "--disable-infobars",
      "--autoplay-policy=no-user-gesture-required"
    ]
  }

With the key part being “–window-size=1280,720” , that does not appear to change it.

The other thing I have tried, is based on this tutorial the monitor resolution is being set in xorg-video-dummy.conf. jibri/xorg-video-dummy.conf at 6be453d205fc41eaa773fdfc08c968b26377715b · jitsi/jibri · GitHub

Section "Screen"
  Identifier "dummy_screen"
  Device "dummy_videocard"
  Monitor "dummy_monitor"
  DefaultDepth 24
  SubSection "Display"
    Viewport 0 0
    Depth 24
    #Modes "32768x32768" "32768x16384" "16384x8192" "8192x4096" "5120x3200" "3840x2880" "3840x2560" "3840x2048" "2048x2048" "2560x1600" "1920x1440" "1920x1200" "1920x1080" "1600x1200" "1680x1050" "1600x900" "1400x1050" "1440x900" "1280x1024" "1366x768" "1280x800" "1024x768" "1024x600" "800x600" "320x200"
    Modes "5120x3200" "3840x2880" "3840x2560" "3840x2048" "2048x2048" "2560x1600" "1920x1440" "1920x1200" "1920x1080" "1600x1200" "1680x1050" "1600x900" "1400x1050" "1440x900" "1280x1024" "1366x768" "1280x800" "1024x768" "1024x600" "800x600" "320x200"
    #I have Changed the below option to 1280 720, which was 1920 1080 in stock settings.
    Virtual 1280 720
    #Virtual 1920 1080
  EndSubSection
EndSection

Restarting jibri after this change also did not seem to change the cropping problem either.

Is there a way to lower the jibri recording resolution, without having the output be clipped?

Have you also restarted the x server?

Thank you - I couldn’t find a way to reboot X, but a box reboot did exactly that and worked fantatic.

systemctl stop jibri-icewm.service
systemctl start jibri.service
1 Like

Hi,
With the latest stable, 2.0.6293-1, I have this cropping problem. If I downgrade to jitsi-meet=2.0.6173-1 the recording is OK.

Is this a bug or there’s something else that needs to be configured/changed?

How have you set your resolution?

I’ve found since that if you want to record lower than 720p, I’m not sure that’s actually possible - the window is cropped, as I think the selenium window is not scaling the clients video feeds I don’t think.

If it is 720p or above, remember to change your xorg.conf settings and check with where i’ve changed it above.

I have this working since the recording became 1080 by default changing jibri.conf and xorg-video-dummy.conf. Only if I upgrade to the latest jitsi-meet stable (jibri version makes no difference) I have this cropping problem.
My current solution is keeping jitsi-meet at version 2.0.6173-1

I tested again with the current stable but I have no cropping issue even with “1280x720” and “640x360”.

This is my jibri.conf template.

I only changed the resolution in jibri.conf and xorg-video-dummy.conf

Confirming that if you start your chrome/selenium instance maximised (which is the default), then cropping isn’t a problem.

To be clear, I tried this, which did have cropping:

  chrome {
    // The flags which will be passed to chromium when launching
    // We used to use start-maximized
    flags = [
      "--use-fake-ui-for-media-stream",
      "--window-size=1280,720",
      "--kiosk",
      "--enabled",
      "--disable-infobars",
      "--autoplay-policy=no-user-gesture-required"
    ]
  }

See the window-size option above. It doesn’t seem to work below 1280x720 (it will ignore it and not scale below it).

It’s more effective to just leave it at the start-maximised flag, which works.

  chrome {
    // The flags which will be passed to chromium when launching
    // We used to use start-maximized
    // Started with 1280,720, then 1024, 576
    // "--start-maximized",
    //  "--window-size=720, 576",
    flags = [
      "--use-fake-ui-for-media-stream",
      "--start-maximized",
      "--kiosk",
      "--enabled",
      "--disable-infobars",
      "--autoplay-policy=no-user-gesture-required"
    ]
  }

Once you have the above, the two places are where @emrah has mentioned: in the jibri.conf for the ffmpeg resolution to encode at (lower than native resolution = crop), and the xorg.conf resolution which sets the resolution of your “screen” to record from.