GStreamer + streaming plugin: stereo audio issue in demo JS code

180 views
Skip to first unread message

Fabian Müller

unread,
Jan 8, 2022, 1:34:59 PM1/8/22
to meetecho-janus
Hi all,

I am using the demo JS code for the streaming plugin, together with GStreamer. A stereo audio signal is published from GStreamer to Janus WebRTC Server.  
Using the demo JS code under html/streamingtest.js only mono sound was played at a client, however.

I found out that I can force stereo by altering the html/streamingtest.js file in the function "onmessage: function(msg, jsep)" in line 154: :
152 if(jsep) {
153 Janus.debug("Handling SDP as well...", jsep);
154 var stereo = true; // var stereo = (jsep.sdp.indexOf("stereo=1") !== -1);
155 // Offer from the plugin, let's answer
156 streaming.createAnswer(
While it works, it seems to be quite a hack. It seems like the SDP offered from the plugin should contain a line like: "a=fmtp... stereo=1 ...", but doesn't. However, I could not find out if I misconfigured the GStreamer pipeline, or the streaming plugin config, or if there is an issue in the streaming plugin, or in the demo JS code.

Has someone experienced something similar, or knows how to configure the setup correctly without adding this "hack" in the streaming demo JS code?

I used the following (slightly modified) GStreamer pipeline:


gst-launch-1.0 -v \
osxaudiosrc device=60 ! \
audioresample quality=10 ! audio/x-raw, channels=2, rate=48000 ! \
opusenc audio-type=restricted-lowdelay bandwidth=fullband frame-size=60 bitrate=128000 ! \
rtpopuspay ! udpsink host=127.0.0.1 port=5002 \ Thanks in advance!

Amnon Israely

unread,
Jan 8, 2022, 1:45:52 PM1/8/22
to meetecho-janus
For me it's work with sdp modification:
 ;stereo=1;sprop-stereo=1

суббота, 8 января 2022 г. в 20:34:59 UTC+2, fabian.mu...@gmail.com:

Lorenzo Miniero

unread,
Jan 9, 2022, 3:56:36 AM1/9/22
to meetecho-janus
You also need to add a "stereo=1" audiofmtp attribute when creating the mountpoint, or the Streaming plugin won't offer it in the SDP.

L.

Fabian Müller

unread,
Jan 9, 2022, 4:53:55 AM1/9/22
to meetecho-janus
Thanks Lorenzo, adding audiofmtp = "stereo=1"  to the mountpoint in the streaming plugin config file was it, then no code changes are needed! 
Reply all
Reply to author
Forward
0 new messages