Improve jibri recording resolution

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.

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

1 Like

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:

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

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!

1 Like

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!

1 Like

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:

2 Likes

@Ark74 was the improvement in the video after recording very significant, I am on this same path.

Well yeah, you want to get that sweet balance spot where you have just enough quality that will not exceed the common upload speed from you users.
Other wise you’ll get connection issues messages almost by default.

OK, how did you compile the deb package, and how did you install it on your server. First timer. Thanks

As he said.

OK got it. Thanks

After building the source with eclipse this is what I get, there is a jar built to target called jibri-8.0-SNAPSHOT.jar is this what I am looking for? And where on the server am i replacing this .jar file. Can i get the path please ?

maven-install-plugin:2.4:install (default-install) @ jibri 
[INFO] Installing C:\Users\FrankOdoom\Desktop\Open-Source Projects\Samples\jibri\target\jibri-8.0-SNAPSHOT.jar to C:\Users\FrankOdoom\.m2\repository\org\jitsi\jibri\8.0-SNAPSHOT\jibri-8.0-SNAPSHOT.jar
[INFO] Installing C:\Users\FrankOdoom\Desktop\Open-Source Projects\Samples\jibri\pom.xml to C:\Users\FrankOdoom\.m2\repository\org\jitsi\jibri\8.0-SNAPSHOT\jibri-8.0-SNAPSHOT.pom
[INFO] Installing C:\Users\FrankOdoom\Desktop\Open-Source Projects\Samples\jibri\target\jibri-8.0-SNAPSHOT-jar-with-dependencies.jar to C:\Users\FrankOdoom\.m2\repository\org\jitsi\jibri\8.0-SNAPSHOT\jibri-8.0-SNAPSHOT-jar-with-dependencies.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  04:58 min
[INFO] Finished at: 2020-04-19T08:56:08Z

Try /opt/jitsi/jibri/jibri.jar

1 Like

Thanks, seen. Made the modifications i will let you know if my video quality improves.

After recompiling and swapping jibri.jar I get this, it looks like FFmpeg exits. I used the same values as yours.

My Settings:

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

Error

2020-04-19 11:48:13.746 FINE: [48] org.jitsi.jibri.util.ProcessStatePublisher.ffmpeg.invoke() Process ffmpeg hasn't wri$2020-04-19 11:48:13.747 INFO: [51] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegProcessUpdate() Ffmpeg quit ab$2020-04-19 11:48:15.746 FINE: [48] org.jitsi.jibri.util.ProcessStatePublisher.ffmpeg.invoke() Process ffmpeg hasn't wri$2020-04-19 11:48:15.747 INFO: [51] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegProcessUpdate() Ffmpeg quit ab$2020-04-19 11:48:17.746 FINE: [48] org.jitsi.jibri.util.ProcessStatePublisher.ffmpeg.invoke() Process ffmpeg hasn't wri$2020-04-19 11:48:17.747 INFO: [51] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegProcessUpdate() Ffmpeg quit ab$2020-04-19 11:48:19.746 FINE: [48] org.jitsi.jibri.util.ProcessStatePublisher.ffmpeg.invoke() Process ffmpeg hasn't wri$2020-04-19 11:48:19.747 INFO: [51] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegProcessUpdate() Ffmpeg quit ab$2020-04-19 11:48:21.746 FINE: [48] org.jitsi.jibri.util.ProcessStatePublisher.ffmpeg.invoke() Process ffmpeg hasn't wri$2020-04-19 11:48:21.747 INFO: [51] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegProcessUpdate() Ffmpeg quit ab$2020-04-19 11:48:23.746 FINE: [48] org.jitsi.jibri.util.ProcessStatePublisher.ffmpeg.invoke() Process ffmpeg hasn't wri$2020-04-19 11:48:23.747 INFO: [51] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegProcessUpdate() Ffmpeg quit ab$2020-04-19 11:48:25.746 FINE: [48] org.jitsi.jibri.util.ProcessStatePublisher.ffmpeg.invoke() Process ffmpeg hasn't wri$2020-04-19 11:48:25.747 INFO: [51] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegProcessUpdate() Ffmpeg quit ab$2020-04-19 11:48:26.648 INFO: [48] org.jitsi.jibri.selenium.JibriSelenium.run() Jibri client receive bitrates: {audio={$2020-04-19 11:48:27.746 FINE: [48] org.jitsi.jibri.util.ProcessStatePublisher.ffmpeg.invoke() Process ffmpeg hasn't wri$2020-04-19 11:48:27.747 INFO: [51] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegProcessUpdate() Ffmpeg quit ab$2020-04-19 11:48:29.746 FINE: [48] org.jitsi.jibri.util.ProcessStatePublisher.ffmpeg.invoke() Process ffmpeg hasn't wri$2020-04-19 11:48:29.747 INFO: [51] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegProcessUpdate() Ffmpeg quit ab$2020-04-19 11:48:31.746 FINE: [48] org.jitsi.jibri.util.ProcessStatePublisher.ffmpeg.invoke() Process ffmpeg hasn't wri$2020-04-19 11:48:31.747 INFO: [51] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegProcessUpdate() Ffmpeg quit ab$2020-04-19 11:48:33.746 FINE: [48] org.jitsi.jibri.util.ProcessStatePublisher.ffmpeg.invoke() Process ffmpeg hasn't wri$2020-04-19 11:48:33.746 INFO: [51] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegProcessUpdate() Ffmpeg quit ab$2020-04-19 11:48:35.746 FINE: [48] org.jitsi.jibri.util.ProcessStatePublisher.ffmpeg.invoke() Process ffmpeg hasn't wri$2020-04-19 11:48:35.747 INFO: [51] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegProcessUpdate() Ffmpeg quit ab$ 2020-04-19 11:48:13.746 FINE: [48] org.jitsi.jibri.util.ProcessStatePublisher.ffmpeg.invoke() Process ffmpeg hasn't wri$2020-04-19 11:48:13.747 INFO: [51] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegProcessUpdate() Ffmpeg quit ab$2020-04-19 11:48:15.746 FINE: [48] org.jitsi.jibri.util.ProcessStatePublisher.ffmpeg.invoke() Process ffmpeg hasn't wri$2020-04-19 11:48:15.747 INFO: [51] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegProcessUpdate() Ffmpeg quit ab$2020-04-19 11:48:17.746 FINE: [48] org.jitsi.jibri.util.ProcessStatePublisher.ffmpeg.invoke() Process ffmpeg hasn't wri$2020-04-19 11:48:17.747 INFO: [51] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegProcessUpdate() Ffmpeg quit ab$2020-04-19 11:48:19.746 FINE: [48] org.jitsi.jibri.util.ProcessStatePublisher.ffmpeg.invoke() Process ffmpeg hasn't wri$2020-04-19 11:48:19.747 INFO: [51] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegProcessUpdate() Ffmpeg quit ab$2020-04-19 11:48:21.746 FINE: [48] org.jitsi.jibri.util.ProcessStatePublisher.ffmpeg.invoke() Process ffmpeg hasn't wri$2020-04-19 11:48:21.747 INFO: [51] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegProcessUpdate() Ffmpeg quit ab$2020-04-19 11:48:23.746 FINE: [48] org.jitsi.jibri.util.ProcessStatePublisher.ffmpeg.invoke() Process ffmpeg hasn't wri$2020-04-19 11:48:23.747 INFO: [51] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegProcessUpdate() Ffmpeg quit ab$2020-04-19 11:48:25.746 FINE: [48] org.jitsi.jibri.util.ProcessStatePublisher.ffmpeg.invoke() Process ffmpeg hasn't wri$2020-04-19 11:48:25.747 INFO: [51] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegProcessUpdate() Ffmpeg quit ab$2020-04-19 11:48:26.648 INFO: [48] org.jitsi.jibri.selenium.JibriSelenium.run() Jibri client receive bitrates: {audio={$2020-04-19 11:48:27.746 FINE: [48] org.jitsi.jibri.util.ProcessStatePublisher.ffmpeg.invoke() Process ffmpeg hasn't wri$2020-04-19 11:48:27.747 INFO: [51] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegProcessUpdate() Ffmpeg quit ab$2020-04-19 11:48:29.746 FINE: [48] org.jitsi.jibri.util.ProcessStatePublisher.ffmpeg.invoke() Process ffmpeg hasn't wri$2020-04-19 11:48:29.747 INFO: [51] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegProcessUpdate() Ffmpeg quit ab$2020-04-19 11:48:31.746 FINE: [48] org.jitsi.jibri.util.ProcessStatePublisher.ffmpeg.invoke() Process ffmpeg hasn't wri$2020-04-19 11:48:31.747 INFO: [51] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegProcessUpdate() Ffmpeg quit ab$2020-04-19 11:48:33.746 FINE: [48] org.jitsi.jibri.util.ProcessStatePublisher.ffmpeg.invoke() Process ffmpeg hasn't wri$2020-04-19 11:48:33.746 INFO: [51] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegProcessUpdate() Ffmpeg quit ab$2020-04-19 11:48:35.746 FINE: [48] org.jitsi.jibri.util.ProcessStatePublisher.ffmpeg.invoke() Process ffmpeg hasn't wri$2020-04-19 11:48:35.747 INFO: [51] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegProcessUpdate() Ffmpeg quit ab$ 2020-04-19 11:48:43.746 FINE: [48] org.jitsi.jibri.util.ProcessStatePublisher.ffmpeg.invoke() Process ffmpeg hasn't wri$2020-04-19 11:48:43.748 INFO: [51] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegProcessUpdate() Ffmpeg quit ab$2020-04-19 11:48:45.746 FINE: [48] org.jitsi.jibri.util.ProcessStatePublisher.ffmpeg.invoke() Process ffmpeg hasn't wri$2020-04-19 11:48:45.746 INFO: [51] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegProcessUpdate() Ffmpeg quit ab$2020-04-19 11:48:47.746 FINE: [48] org.jitsi.jibri.util.ProcessStatePublisher.ffmpeg.invoke() Process ffmpeg hasn't wri$2020-04-19 11:48:47.746 INFO: [51] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegProcessUpdate() Ffmpeg quit ab$2020-04-19 11:48:48.393 INFO: [55] org.jitsi.jibri.api.xmpp.XmppApi.handleJibriIq() Received JibriIq <iq to='jibri@auth$2020-04-19 11:48:48.395 FINE: [55] org.jitsi.jibri.statsd.JibriStatsDClient.incrementCounter() Incrementing statsd coun$2020-04-19 11:48:48.398 INFO: [55] org.jitsi.jibri.JibriManager.stopService() Stopping the current service 2020-04-19 11:48:48.398 INFO: [55] org.jitsi.jibri.service.impl.FileRecordingJibriService.stop() Stopping capturer 2020-04-19 11:48:48.398 INFO: [55] org.jitsi.jibri.util.JibriSubprocess.ffmpeg.stop() Stopping ffmpeg process 2020-04-19 11:48:48.402 INFO: [55] org.jitsi.jibri.util.JibriSubprocess.ffmpeg.stop() ffmpeg exited with value 1

Did you build on the same OS / stack you are running your server with?

If you use another OS, or version the components won’t match.

Oh interesting, I used a Windows 10 PC running Eclipse and used Maven Install to build the Jar Should i use mvn command line to build the source code on the same server i have jibri hosted?, in my case i am using Ubuntu 16.04 LTS?

Not necessary on the same server, but at least on another ubuntu 16.04.

1 Like

Ok i will try that now. Thanks a lot