GStreamer isn't playing RTP audio stream from Janus

1,235 views
Skip to first unread message

Nik Ivanov

unread,
May 11, 2019, 8:14:00 PM5/11/19
to meetecho-janus
I'm trying to set up Janus gateway to forward audio from the browser to GStreamer using Videoroom plugin and RTP Forward functionality. I can see bytes appear on the UDP socket, but I hear no audio. Here's my GStreamer pipeline:

gst-launch-1.0 rtpbin name=rtpbin latency=100 udpsrc port=60000 caps="application/x-rtp, media=audio, encoding-name=OPUS, clock-rate=48000" ! rtpbin.recv_rtp_sink_0 udpsrc port=60001 caps="application/x-rtcp" ! rtpbin.recv_rtcp_sink_0 rtpbin. ! rtpopusdepay ! queue ! opusdec ! alsasink

To try to debug the issue, I added a filesink instead of rtpopusdepay to take a snapshot of raw bytes. You can find it here. Any idea what could be going wrong? Any help is appreciated!

Nik Ivanov

unread,
May 12, 2019, 11:21:35 AM5/12/19
to meetecho-janus
Here's how I start the RTP forward:

var request = {
"request": "rtp_forward",
"room": 1337,
"publisher_id": publisherId,
"host": "127.0.0.1",
"audio_port" : 60000,
"audio_pt": 111,
"audio_rtcp_port" : 60001,
"video_port" : 60002,
"video_rtcp_port" : 60003,
"data_port" : 60004,
};
videoroomPluginHandle.send({"message": request});

Mirko Brankovic

unread,
May 13, 2019, 4:45:39 AM5/13/19
to meetecho-janus
this one worked for me:
gst-launch-1.0 -m udpsrc port=5000 ! "application/x-rtp, media=(string)audio, encoding-name=(string)OPUS, payload=(int)100, rate=16000, channels=(int)1" ! rtpopusdepay ! opusdec !  audioconvert ! audiorate ! audioresample

--
You received this message because you are subscribed to the Google Groups "meetecho-janus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/meetecho-janus/87a1f597-4bf0-4353-a0ad-afbfe997cfd3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Regards,
Mirko

Nik Ivanov

unread,
May 13, 2019, 10:04:46 PM5/13/19
to meetecho-janus
Doesn't work, unfortunately. Thing is, I had it working on Raspberry Pi Zero W. Now that I switched to Rpi 3a+, I can't get the sound to output with the same setup. I tried using https://github.com/michaelfranzl/janus-rtpforward-plugin as I did with RPi Zero, and then tried switching to Videoroom for RTP forwarding. Both yield bytes on the UDP port, and neither produce any sound. I'm not sure if Janus isn't providing the format it's supposed to, or GStreamer isn't reading the format properly. Looking at gstreamer verbose output, I don't see anything wrong. Any advice on how to proceed with debugging?

I've never used FFMPEG before - maybe I should give that a try. Would you mind providing a command to run with ffmpeg to do this?

Thanks!


On Saturday, May 11, 2019 at 8:14:00 PM UTC-4, Nik Ivanov wrote:

Nik Ivanov

unread,
May 13, 2019, 10:14:43 PM5/13/19
to meetecho-janus
In case you're wondering: I created a test pipeline in gstreamer that decodes an ogg file using opusdec and outputs it to alsasink and it worked perfectly. So Gstreamer by itself seems to work ok.


On Saturday, May 11, 2019 at 8:14:00 PM UTC-4, Nik Ivanov wrote:

Mirko Brankovic

unread,
May 14, 2019, 2:15:54 AM5/14/19
to meetecho-janus
I had my example working, but from audio room and piping to Deepspeech and not alsamixer.
Anyway try to specify payload=111 which i think is a must for gst and maybe changing rate to 16k

Nik Ivanov

unread,
May 15, 2019, 8:42:27 AM5/15/19
to meetecho-janus
That's exactly my problem - I already had this working on Rpi Zero. When I recompiled everything on 3a+ browser->Pi sound didn't work. I'm going to give ffmpeg a shot.

Nik Ivanov

unread,
May 15, 2019, 12:39:33 PM5/15/19
to meetecho-janus
If I use audiobridge, would the incoming Opus stream be decode and then re-encoded before being forwarded to a UDP socket? It would be a good test, though it would burn unnecessary CPU cycles.


On Tuesday, May 14, 2019 at 2:15:54 AM UTC-4, Mirko Brankovic wrote:

Mirko Brankovic

unread,
May 16, 2019, 3:30:51 PM5/16/19
to meetecho-janus
indeed I think it would be re-sampled

--
You received this message because you are subscribed to a topic in the Google Groups "meetecho-janus" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/meetecho-janus/lTtJYvebu-4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to meetecho-janu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/meetecho-janus/e015c0df-0991-43f8-95cf-78dca426feb9%40googlegroups.com.


--
Regards,
Mirko

Nik Ivanov

unread,
May 20, 2019, 8:51:21 AM5/20/19
to meetecho-janus
I finally figured out what was going wrong with my setup. It had nothing to do with Janus or GStreamer. For some reason, the default device changed on my system, and by default the offer was being created with the wrong recording device. I did Janus.listDevices(...), found my recording device (the webcam with a microphone), added it as the device ID in the offer and it all works!


On Saturday, May 11, 2019 at 8:14:00 PM UTC-4, Nik Ivanov wrote:
Reply all
Reply to author
Forward
0 new messages