Janus Gateway on Ubuntu 20.04

Hi,

I am looking for help in solving issue with ubuntu 20.04

At present my server where janus-gateway is installed in Ubuntu18.04(Ip: 192.168.1.101) and I installed janus-gateway using “sudo snap install janus-gateway”. janus.plugin.streming.jcfg is as below

rtp-frontleft: {
type = “rtp”
id = 1
description = “front_left”
audio = false
video = true
videoport = 5006
videopt = 126
videortpmap = “H264/90000”
videofmtp = “profile-level-id=42e01f;packetization-mode=1”
secret = “adminpwd”
}

and gstreamer pipeline is as below. gst pipeline is running from another server and sink to udpsink
gst-launch-1.0 -v videotestsrc pattern=snow ! videoconvert ! clockoverlay ! nvvidconv ! nvv4l2h264enc ! h264parse ! rtph264pay ! udpsink host=192.168.1.101 port=5006

Above solution is working with out any issue.

Now I am going to upgrade my server to ubuntu 20.04. And I installed janus-gateway using same snap command. Configuration and gst pipelines are same as above. But I am not getting streams. But I cud see bits are coming to peer(browser) but not streams.

Could you please help me whether any action to be taken care for ubuntu 20.04 to be worked.

Br,
Jaswanth

Hi,

Can any one help in this.

Br,
Jaswanth

Sorry, I can’t provide help on Snap packages, they’re not made by us.

Could you please suggest me the best(recommended) way of installation of janus-gateway on ubuntu 20.04.

The README on the repo provides a detailed list of the installation steps. You’ll probably want to install libsrtp2 manually and not from repo on Ubuntu, though.

I installed as per README and configured janus.plugin.streaming.jcfg
I am getting below error
[ERR] [dtls.c:janus_dtls_srtp_incoming_msg:939] [6177329859464232] Oops, error creating inbound SRTP session for component 1 in stream 1??
[ERR] [dtls.c:janus_dtls_srtp_incoming_msg:940] [6177329859464232] – 1 (srtp_err_status_fail)
[janus.plugin.streaming-0x7f036c001730] No WebRTC media anymore

Could you please help me in this

Install libsrtp2 manually, not from repo.

Ya Installed
Version 2.3.0
OS Version Ubuntu 20.04

That’s not the only thing I wrote. I also said it needs to be installed manually, and not as a package from the OS repository.

Thanks
I am working on it.
Actually If I install using apt-get then I am getting 2.3.0 version which doesn’t work.

Good chances are that if you install the same version manually, using the instructions in the README, it will work. My Fedora ships 2.3.0 too and it works just fine there.

There should be no difference in snap usage between Ubuntu 18 and 20… Did you try to use pipeline without NVidia specific elements?

Note: I’m maintainer of Janus snap package.

Hi @rsatom
After installing sudo snap install janus-gateway, I updated janus-gateway.janus-gateway.service
with this:
rtp-front: {
type = “rtp”
id = 2
description = “front”
audio = false
video = true
videoport = 5006
videopt = 126
videortpmap = “H264/90000”
videofmtp = “profile-level-id=42e01f;packetization-mode=1”
secret = “adminpwd”
}

And running this gstreamer pipeline :
gst-launch-1.0 videotestsrc ! videoconvert ! x264enc tune=zerolatency ! h264parse ! rtph264pay ! udpsink host=192.168.1.109 port=5006

For Ubuntu 18.04 it working fine but for Ubuntu 20.04 it just showing kbits/sec but not showing stream in stream UI.
Can you please suggest me what need to do additional thing for Ubuntu 20.04?

I updated janus-gateway.janus-gateway.service

why janus-gateway.janus-gateway.service ?

For me it doesn’t work with your command, but works with following command:

gst-launch-1.0 videotestsrc ! videoconvert ! x264enc tune=zerolatency ! video/x-h264, profile=baseline ! h264parse ! rtph264pay ! udpsink host=localhost port=5006

(i.e. with baseline profile stream)

and following piece in janus.plugin.streaming.jcfg:

rtp-front: {
  type = "rtp"
  id = 20
  description = "front"
  audio = false
  video = true
  videoport = 5006
  videopt = 126
  videortpmap = "H264/90000"
  videofmtp = "profile-level-id=42e01f;packetization-mode=1"
  secret = "adminpwd"
}

(i.e. the same as yours)

It’s important to remember WebRTC in browser supports only baseline profile h264 streams!

Hi @rsatom
Thanks for your reply.
Yes, this pipeline is working fine and consistence now.
gst-launch-1.0 videotestsrc ! videoconvert ! x264enc tune=zerolatency ! video/x-h264, profile=baseline ! h264parse ! rtph264pay ! udpsink host=localhost port=5006

But when I am using below gstreamer pipeline for nvidia. Somehow I am getting the stream very first time, and It is not consistence, If I stop watching stream and if again start watching the stream It is not coming only kbit/sec is showing.

gst-launch-1.0 videotestsrc ! video/x-raw, profile=baseline ! nvvidconv ! nvv4l2h264enc ! h264parse ! rtph264pay ! udpsink host=192.168.1.101 port=5006

Can you please suggest me what need to change in gstreamer pipeline for nvidia or any other changes required to get consistence stream.

Thanks

videotestsrc ! video/x-raw, profile=baseline is useless, since videotestsrc produces raw frames and knows nothing about h264 profiles.

So:

  1. you need to find a way to encode to baseline h264 profile with nvv4l2h264enc (maybe it produces it by default - I don’t know)
  2. you need configure your pipeline to send stream metadata not only at the beginning of stream, but also time to time. I don’t know if there is better solution with nvidia specific elements, but as initial solution you can try to add config-interval property to h264parse

so in your case it can be something like

gst-launch-1.0 videotestsrc ! nvvidconv ! nvv4l2h264enc ! h264parse config-interval=-1 ! rtph264pay ! udpsink host=192.168.1.101 port=5006

Hi @rsatom
Thank you
Now it working better than previous gstreamer pipeline for nvidia.
Sure I will check, way to encode to baseline h264 for nvidia .

Regards
PSahoo

Notice that we now support a property when creating mountpoints where you can manually provide the SPS/PPS and the plugin will insert stream metadata for you in the RTP at every keyframe even when it’s missing:

Of course, providing the correct SPS/PPS is up to you.