gstreamer two ways

1,098 views
Skip to first unread message

João

unread,
Jul 19, 2018, 5:53:36 PM7/19/18
to meetecho-janus
Hello. It's possible to send audio from microphone with gstreamer to a room (conference) and also get the audio back ? For example i want talk in a browser in my smartphone and listen the audio in the terminal in my computer, and send also the audio from the computer, without any browser open.

Mirko Brankovic

unread,
Jul 20, 2018, 1:51:54 AM7/20/18
to meetecho-janus
You can defenatlly get a stream from microphone woth gstreamer, bit then to send it to some udp ip:port, but then check janus plugins if there is one that can accept that

On Thu, Jul 19, 2018, 23:53 João <joaog...@gmail.com> wrote:
Hello. It's possible to send audio from microphone with gstreamer to a room (conference) and also get the audio back ? For example i want talk in a browser in my smartphone and listen the audio in the terminal in my computer, and send also the audio from the computer, without any browser open.

--
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.
For more options, visit https://groups.google.com/d/optout.

Mirko Brankovic

unread,
Jul 20, 2018, 1:54:06 AM7/20/18
to meetecho-janus
But note when ever there is webrtc endpoint you can't use it from terminal.
So videoroom, audiobridge can't work like that, but maybe streaming plugin... Or a modification of it

Lorenzo Miniero

unread,
Jul 20, 2018, 9:28:22 AM7/20/18
to meetecho-janus
At the moment, interacting with gstreamer happens two different ways. If you want to send WebRTC media to a gstreamer pipeline, you'll need one of the plugins that supports RTP forwarding (VideoRoom or AudioBridge). If you want gstreamer to WebRTC, you'll need the Streaming plugin instead. So two different PeerConnections if you want in/out. I think someone was working on a new plugin that integrated gstream support directly, and that would allow you to do in/out on the same PC.

L.

Tyler Miller

unread,
Jul 20, 2018, 2:43:22 PM7/20/18
to meetecho-janus
Hi,

I'm working on something very similar. It basically works exactly as Lorenzo described. You can tell the AudioBridge to forward the audio from the conference room to your machine using a json message like this:
{"request": "rtp_forward",
 
"room": roomNum,
 
"host": destinationMachine,
 
"port": 5000}


Note that Janus forwards the stream with UDP. On the destination computer, you can use gstreamer to create a UDP source for the stream and route it out to your speakers:

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 ! alsasink device=plughw:1,0

Where 'plughw:1,0' is the name of your output audio device. 

To stream the computer's audio up to Janus you would need to use the Streaming plugin as described in the documentation. Currently I have my computer (in my case a raspberry pi) talk to Janus over curl and make a stream mountpoint. Gstreamer then uses a udpsink to send the stream to Janus. Something like this: 

gst-launch-1.0 alsasrc device=plughw:1,0 ! audioconvert ! audioresample ! opusenc ! rtpopuspay ! udpsink host="${JANUS_IP}" port=8005

This command likely wont work, but gives you the general idea. Normally I'm streaming both video and audio, so I tried to modify my current command.

Good luck!!
Reply all
Reply to author
Forward
0 new messages