Jibri Streaming to YouTube Poor Connection

Alright so I’m running a Xen Server with HVM for my Jibri VMs they’re all on a gigabit connection.

Before I was using 1 socket 10 cores / 10vcpus and 16gb running Ubuntu 16.04 Server for each jibri instance which i have 3 identical virtual machines.

Now I stupidly decided to update 1 of those virtual machines to Ubuntu 20.04 Server and update the Meet Server to 20.04 along with it.

Now the Meet Server seems to be running just fine, but where as the 16.04 Jibri Servers ran fine connecting to youtube (I would have bitrate errors every now and then.) But over all the connections were stable and I had no problems streaming to YouTube.

But with Jibri on Ubuntu Server 20.04 the Connection is Poor and Buffering all the time if even that.
The only thing I can think of looking at the logs (log.0.txt etc) is that ffmpeg is trying to stream the Meet Conferent in 1080p instead of 720p.

Any idea how to fix that?

I can see 720p not being a problem for my Virtual Servers, but I don’t have New Enough Processors/RAM to handle ffmpeg transcoding in a Virtual Machine on the fly to YouTube, it just seems to choke the connection between Jibri and YouTube.

Excerpt from log.4.txt

2021-06-27 18:05:28.487 INFO: [59] org.jitsi.jibri.util.JibriSubprocess.log() Starting ffmpeg with command ffmpeg -y -v info -f x11grab -draw_mouse 0 -r 30 -s 1920x1080 -thread_queue_size 4096 -i :0.0+0,0 -f alsa -thread_queue_size 4096 -i plug:bsnoop -acodec aac -strict -2 -ar 44100 -b:a 128k -af aresample=async=1 -c:v libx264 -preset veryfast -maxrate 2976k -bufsize 5952k -pix_fmt yuv420p -r 30 -crf 25 -g 60 -tune zerolatency -f flv rtmp://a.rtmp.youtube.com/live2/youtube-stream-key ([ffmpeg, -y, -v, info, -f, x11grab, -draw_mouse, 0, -r, 30, -s, 1920x1080, -thread_queue_size, 4096, -i, :0.0+0,0, -f, alsa, -thread_queue_size, 4096, -i, plug:bsnoop, -acodec, aac, -strict, -2, -ar, 44100, -b:a, 128k, -af, aresample=async=1, -c:v, libx264, -preset, veryfast, -maxrate, 2976k, -bufsize, 5952k, -pix_fmt, yuv420p, -r, 30, -crf, 25, -g, 60, -tune, zerolatency, -f, flv, rtmp://a.rtmp.youtube.com/live2/youtube-stream-key])

Change JIbri’s resolution to 720p in jibri.conf. Also change the resolution in your xorg-dummy to 720p. The latest Jibri defaults to 1080p resolution.

Alright I’ll try that.

Where is it in the jibri.conf?

That’s exactly what I used the jibri.conf

Now Point out to me where the option for resolution is?

jibri {
  // A unique identifier for this Jibri
  // TODO: eventually this will be required with no default
  id = ""
  // Whether or not Jibri should return to idle state after handling
  // (successfully or unsuccessfully) a request.  A value of 'true'
  // here means that a Jibri will NOT return back to the IDLE state
  // and will need to be restarted in order to be used again.
  single-use-mode = false
  api {
    http {
      external-api-port = 2222
      internal-api-port = 3333
    }
    xmpp {
      // See example_xmpp_envs.conf for an example of what is expected here
      environments = [
	      {
                name = "prod environment"
                xmpp-server-hosts = ["your.domain.com"]
                xmpp-domain = "your.domain.com"

                control-muc {
                    domain = "internal.auth.your.domain.com"
                    room-name = "JibriBrewery"
                    nickname = "jibri-nickname"
                }

                control-login {
                    domain = "auth.your.domain.com"
                    username = "jibri"
                    password = "JPwd"
                }

                call-login {
                    domain = "recorder.your.domain.com"
                    username = "recorder"
                    password = "RPwd"
                }

                strip-from-room-domain = "conference."
                usage-timeout = 0
                trust-all-xmpp-certs = true
            }]
    }
  }
  recording {
    recordings-directory = "/srv/recordings"
    # TODO: make this an optional param and remove the default
    finalize-script = "/path/to/finalize_recording.sh"
  }
  streaming {
    // A list of regex patterns for allowed RTMP URLs.  The RTMP URL used
    // when starting a stream must match at least one of the patterns in
    // this list.
    rtmp-allow-list = [
      // By default, all services are allowed
      ".*"
    ]
  }
  chrome {
    // The flags which will be passed to chromium when launching
    flags = [
      "--use-fake-ui-for-media-stream",
      "--start-maximized",
      "--kiosk",
      "--enabled",
      "--disable-infobars",
      "--autoplay-policy=no-user-gesture-required"
    ]
  }
  stats {
    enable-stats-d = true
  }
  webhook {
    // A list of subscribers interested in receiving webhook events
    subscribers = []
  }
  jwt-info {
    // The path to a .pem file which will be used to sign JWT tokens used in webhook
    // requests.  If not set, no JWT will be added to webhook requests.
    # signing-key-path = "/path/to/key.pem"

    // The kid to use as part of the JWT
    # kid = "key-id"

    // The issuer of the JWT
    # issuer = "issuer"

    // The audience of the JWT
    # audience = "audience"

    // The TTL of each generated JWT.  Can't be less than 10 minutes.
    # ttl = 1 hour
  }
  call-status-checks {
    // If all clients have their audio and video muted and if Jibri does not
    // detect any data stream (audio or video) comming in, it will stop
    // recording after NO_MEDIA_TIMEOUT expires.
    no-media-timeout = 30 seconds

    // If all clients have their audio and video muted, Jibri consideres this
    // as an empty call and stops the recording after ALL_MUTED_TIMEOUT expires.
    all-muted-timeout = 10 minutes

    // When detecting if a call is empty, Jibri takes into consideration for how
    // long the call has been empty already. If it has been empty for more than
    // DEFAULT_CALL_EMPTY_TIMEOUT, it will consider it empty and stop the recording.
    default-call-empty-timeout = 30 seconds
  }
}

Found it so have to double post, for reference don’t use the jibri.conf in @Freddie 's TUTORIAL - How to Install the NEW JIBRI it’s outdated.

Use this one:

jibri {
  // A unique identifier for this Jibri
  // TODO: eventually this will be required with no default
  id = ""
  // Whether or not Jibri should return to idle state after handling
  // (successfully or unsuccessfully) a request.  A value of 'true'
  // here means that a Jibri will NOT return back to the IDLE state
  // and will need to be restarted in order to be used again.
  single-use-mode = false
  api {
    http {
      external-api-port = 2222
      internal-api-port = 3333
    }
    xmpp {
      // See example_xmpp_envs.conf for an example of what is expected here
      environments = [
	      {
                name = "prod environment"
                xmpp-server-hosts = ["your.domain.com"]
                xmpp-domain = "your.domain.com"

                control-muc {
                    domain = "internal.auth.your.domain.com"
                    room-name = "JibriBrewery"
                    nickname = "jibri-nickname"
                }

                control-login {
                    domain = "auth.your.domain.com"
                    username = "jibri"
                    password = "JPwd"
                }

                call-login {
                    domain = "recorder.your.domain.com"
                    username = "recorder"
                    password = "RPwd"
                }

                strip-from-room-domain = "conference."
                usage-timeout = 0
                trust-all-xmpp-certs = true
            }]
    }
  }
  recording {
    recordings-directory = "/tmp/recordings"
    # TODO: make this an optional param and remove the default
    finalize-script = "/path/to/finalize"
  }
  streaming {
    // A list of regex patterns for allowed RTMP URLs.  The RTMP URL used
    // when starting a stream must match at least one of the patterns in
    // this list.
    rtmp-allow-list = [
      // By default, all services are allowed
      ".*"
    ]
  }
  sip {
    // The routing rule for the outbound scenario in VoxImplant is based on this prefix
    outbound-prefix = "out_"
  }
  ffmpeg {
    resolution = "1920x1080"
    // The audio source that will be used to capture audio on Linux
    audio-source = "alsa"
    // The audio device that will be used to capture audio on Linux
    audio-device = "plug:bsnoop"
  }
  chrome {
    // The flags which will be passed to chromium when launching
    flags = [
      "--use-fake-ui-for-media-stream",
      "--start-maximized",
      "--kiosk",
      "--enabled",
      "--disable-infobars",
      "--autoplay-policy=no-user-gesture-required"
    ]
  }
  stats {
    enable-stats-d = true
  }
  webhook {
    // A list of subscribers interested in receiving webhook events
    subscribers = []
  }
  jwt-info {
    // The path to a .pem file which will be used to sign JWT tokens used in webhook
    // requests.  If not set, no JWT will be added to webhook requests.
    # signing-key-path = "/path/to/key.pem"

    // The kid to use as part of the JWT
    # kid = "key-id"

    // The issuer of the JWT
    # issuer = "issuer"

    // The audience of the JWT
    # audience = "audience"

    // The TTL of each generated JWT.  Can't be less than 10 minutes.
    # ttl = 1 hour
  }
  call-status-checks {
    // If all clients have their audio and video muted and if Jibri does not
    // detect any data stream (audio or video) comming in, it will stop
    // recording after NO_MEDIA_TIMEOUT expires.
    no-media-timeout = 30 seconds

    // If all clients have their audio and video muted, Jibri consideres this
    // as an empty call and stops the recording after ALL_MUTED_TIMEOUT expires.
    all-muted-timeout = 10 minutes

    // When detecting if a call is empty, Jibri takes into consideration for how
    // long the call has been empty already. If it has been empty for more than
    // DEFAULT_CALL_EMPTY_TIMEOUT, it will consider it empty and stop the recording.
    default-call-empty-timeout = 30 seconds
  }
}

It literally states it right there.

Excellent explanation, and I appreciate your help in posting to improve jitsi.
But I have a doubt when doing a live with YouTube, I get alerts about the buffer, and it ends up letting say that YouTube does not receive data and ends up cutting the transmission.
There is any improvement or help that you can give me. Greetings

You should set the resolution to 720p so 1280x720 and it should work fine.
You’ll also have to set that in the xorg configuration file too.

Note: Make sure your server is capable of streaming at said speeds otherwise it won’t work.

If using the debian/ubuntu version which I recommend.
You want to look in /etc/jitsi/jibri
find and edit xorg-video-dummy.conf

In xorg-video-dummy.conf find at the bottom of file in Screen section:

Virtual 1920 1080

Comment out and Replace with underneath:

#Virtual 1920 1080
Virtual 1280 720
1 Like

Excellent help friend.
How can I solve it?
The current bit rate of the broadcast (1782.14 Kbps) is lower than the recommended minimum value. We recommend that you use a rate of 4500 Kbps.

You can’t solve that YouTube error, you’re going to have to live with it.
Jibri will work fine even with that error, I haven’t found a work around for it maybe @Freddie has an Idea.