Improve jibri recording resolution


#1

Hello guys!

I’m looking if is it possible to improve (?) the bitrate of the Jibri recorded file, I’ve tested and recorded a video file, where while the details of the resolution is 1280x720 seems like the bitrate is low and the resulting image not really clear.

Some more details on the video;

ExifTool Version Number         : 10.10
File Name                       : asd321_2018-08-16-10-21-02.mp4
Directory                       : .
File Size                       : 3.3 MB
File Modification Date/Time     : 2018:08:16 15:03:09-05:00
File Access Date/Time           : 2018:08:16 15:03:12-05:00
File Inode Change Date/Time     : 2018:08:16 15:03:09-05:00
File Permissions                : rw-rw-r--
File Type                       : MP4
File Type Extension             : mp4
MIME Type                       : video/mp4
Major Brand                     : MP4  Base Media v1 [IS0 14496-12:2003]
Minor Version                   : 0.2.0
Compatible Brands               : isom, iso2, avc1, mp41
Movie Data Size                 : 3357833
Movie Data Offset               : 48
Movie Header Version            : 0
Create Date                     : 0000:00:00 00:00:00
Modify Date                     : 0000:00:00 00:00:00
Time Scale                      : 1000
Duration                        : 0:00:49
Preferred Rate                  : 1
Preferred Volume                : 100.00%
Preview Time                    : 0 s
Preview Duration                : 0 s
Poster Time                     : 0 s
Selection Time                  : 0 s
Selection Duration              : 0 s
Current Time                    : 0 s
Next Track ID                   : 3
Track Header Version            : 0
Track Create Date               : 0000:00:00 00:00:00
Track Modify Date               : 0000:00:00 00:00:00
Track ID                        : 1
Track Duration                  : 0:00:49
Track Layer                     : 0
Track Volume                    : 0.00%
Image Width                     : 1280
Image Height                    : 720
Graphics Mode                   : srcCopy
Op Color                        : 0 0 0
Compressor ID                   : avc1
Source Image Width              : 1280
Source Image Height             : 720
X Resolution                    : 72
Y Resolution                    : 72
Bit Depth                       : 24
Video Frame Rate                : 30
Matrix Structure                : 1 0 0 0 1 0 0 0 1
Media Header Version            : 0
Media Create Date               : 0000:00:00 00:00:00
Media Modify Date               : 0000:00:00 00:00:00
Media Time Scale                : 44100
Media Duration                  : 0:00:49
Media Language Code             : und
Handler Description             : SoundHandler
Balance                         : 0
Audio Format                    : mp4a
Audio Channels                  : 2
Audio Bits Per Sample           : 16
Audio Sample Rate               : 44100
Handler Type                    : Metadata
Handler Vendor ID               : Apple
Encoder                         : Lavf56.40.101
Avg Bitrate                     : 545 kbps
Image Size                      : 1280x720
Megapixels                      : 0.922
Rotation                        : 0

Is this possible to adjust this from /etc/jitsi/jibri/xorg-video-dummy.conf ?

Thanks in advance.


#2

The settings we pass to ffmpeg when capturing are here so you could look at changing some of those.


#3

Hi, thanks for pointing that out.

I compiled jibri (deb package) with:

val videoEncodePreset: String = "medium",
val h264ConstantRateFactor: Int = 17,

But now I’m facing the same issue than last time where “Guests can’t start recording”.

I’m clueless :confused:


#4

I’m not sure why re-installing the Jibri deb would cause that problem, but, if you get a working Jibri install you can just build the jar from source (with your h264 changes) and swap out the jar instead of re-installing the .deb. The jar can be built with mvn package and it gets put in /opt/jitsi/jibri/jibri.jar


#5

Well not sure either.
But seems like if you install one version one day and another the next day with the same configuration you won’t get the same behavior like this case.
Please don’t get me wrong, I know it is the unstable branch but it would be nice to know what changes the behavior.

Regardless, thanks for the workaround, that jar move would be quite useful for testing this changes (whenever I get jibri back) :sweat_smile:

Cheers!


#6

As I mentioned before, once Jibri is back I would test.
And now that it is working again, tested I did.

With the changes I posted before it looks much better.

I get this bitrate,

Avg Bitrate                     : 899 kbps

Default (val h264ConstantRateFactor: Int = 25,) bit rate is,

Avg Bitrate                     : 545 kbps

Looking through files I’ve seen that standard,

  • 720p goes around ~900 kbps
  • 1080p something around ~ 2.2 Mbps

So h264ConstantRateFactor: Int = 17 could be consider the closest to 720p resolution which match the image size (1280 x 720).

Cheers!


#7

Update:

Google / YouTube disagrees with the values I just posted, from: https://support.google.com/youtube/answer/2853702?hl=en

1080p

Resolution: 1920x1080
Video Bitrate Range: 3,000 - 6,000 Kbps

720p

Resolution: 1280x720
Video Bitrate Range: 1,500 - 4,000 Kbps

So my files were highly optimized :rofl: