How to know currently active (speaking) publisher in a videoroom?

1,114 views
Skip to first unread message

Anil Wadghule

unread,
Nov 27, 2017, 3:42:07 AM11/27/17
to meetecho-janus
Is there any Janus API to know currently active (speaking/voice is on) publisher?

In my video chat, I need to highlight currently active speaker and put in the middle like hangouts does.

thank you,
Anil

Mirko Brankovic

unread,
Nov 27, 2017, 4:58:55 AM11/27/17
to meetecho-janus
there is a 'talking' state which is based on the audio level of the rtp header, you should receive start and stop talking events on chosen transport. levels are configurable per room and you have an example in the sample config

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



--
Regards,
Mirko

Anil Wadghule

unread,
Nov 27, 2017, 1:48:30 PM11/27/17
to Mirko Brankovic, meetecho-janus
Hi Mirko,

Sorry, did not understand it.. does it come as an event?  Could you point me to documentation?

Thanks,
Anil
Best,
Anil

Mirko Brankovic

unread,
Nov 27, 2017, 3:12:43 PM11/27/17
to meetecho-janus
If you enable it in room config or in create room api call, you should see it on your transport type. So if you use websocket, you will get that event like user joined or left events.

Mirko Brankovic

unread,
Nov 27, 2017, 3:15:06 PM11/27/17
to meetecho-janus

Anil Wadghule

unread,
Nov 29, 2017, 1:18:52 PM11/29/17
to Mirko Brankovic, meetecho-janus
Hello Mirko / Lorenzo,

I create a Janus video room with the following request,

But I don't see

      Janus.Plugin.message(handle, %{
        request: "create",
        description: room_name,
        bitrate: 2_000_000,
        videocodec: "h264",
        publishers: 20,
        permanent: true,
        audiolevel_ext: true,
        audiolevel_event: true,
        audio_active_packets: 100,
        audio_level_average: 120
      })

But Janus room is getting created with following options only.


[4132959083230403]
description = old-shape-1580
bitrate = 2000000
publishers = 20
audiocodec = opus
videocodec = h264

Ami I missing something?

Thanks,
Anil

Mirko Brankovic

unread,
Nov 29, 2017, 1:27:33 PM11/29/17
to meetecho-janus
seems like you did it ok, but lets make some things clear:
I tested this with chrome cause they are putting audio level ext into rtp
Event is only firing towards listeners, there is no point in publisher to get one (you should see initial state in publisher joining now, ex. talking:true/false
Make sure you are making noise for 2sec (100 packets) so to trigger the event.

Hope it helps ;)

Mirko Brankovic

unread,
Nov 29, 2017, 1:28:43 PM11/29/17
to meetecho-janus
I tested this with static files, maybe I did something wrong with api call

Anil Wadghule

unread,
Nov 29, 2017, 1:33:00 PM11/29/17
to Mirko Brankovic, meetecho-janus
Mirko,

When I *manually* put following values in Janus created room in janus.plugin.videoroom.cfg

audiolevel_ext = yes
audiolevel_event = yes
audio_active_packets = 50
audio_level_average = 40

it works as expected..

But I want these values to show up in created room config when I created Janus room when I pass these options.

But noticed Janus doesn't respect that while room creation. I also notice, putting these values in [general] doesn't help.

I wonder, now how to make it work now. This is blocker.

Thanks,
Anil

Anil Wadghule

unread,
Nov 29, 2017, 2:31:38 PM11/29/17
to meetecho-janus, Lorenzo Miniero
Hi Lorenzo,

Need your answer here.

Looks like audio related params are ignored while creating new Janus room. And putting those in [general] doesn't work too. Only current way is to manually put those for each room.

Thanks,
Anil

--
Best,
Anil

Mirko Brankovic

unread,
Nov 29, 2017, 5:07:12 PM11/29/17
to meetecho-janus
I just tested it on dynamically created room and I got events, but I used average of  25.

{"request":"create","description":"test", "room":12345, "bitrate":512000,"publishers":5,"secret":"topsecret", "fir_freq":10, "audiocodec":"opus", "videocodec":"vp8", "record":false, "audiolevel_ext": true, "audiolevel_event": true, "audio_active_packets": 100, "audio_level_average": 25},"transaction":randomString(12),"session_id":session_id,"handle_id":handle_id}

So what I think is that your average of 120 is not crossing that limit and then there is no change in audio level.
127 is muted, so try to mute one side and probably you will get event.
you can observe audio_dbow_level on publishers handle together with talking property
--
Regards,
Mirko

Anil Wadghule

unread,
Nov 30, 2017, 5:33:21 AM11/30/17
to Mirko Brankovic, meetecho-janus
Thank Mirko, I noticed I get events too. But I noticed it doesn't write down those settings in a video room config file. 
I wonder how it finds that next time when I just join room as settings are not persisted there.

Lorenzo, any inputs?

Thanks,
Anil

Mirko Brankovic

unread,
Nov 30, 2017, 5:37:49 AM11/30/17
to meetecho-janus
Hmm that part im not sure

Lorenzo Miniero

unread,
Nov 30, 2017, 5:39:52 AM11/30/17
to meetecho-janus
Looks like a bug, where we don't store all properties when permanent is true. I'll work on a fix when I have some time.

L.

Anil Wadghule

unread,
Nov 30, 2017, 5:48:11 AM11/30/17
to Lorenzo Miniero, meetecho-janus
Thanks, Lorenzo! I assume, for now, I can send configure request each time to enable these settings for a video room.

Thanks,
Anil

Lorenzo Miniero

unread,
Nov 30, 2017, 5:49:57 AM11/30/17
to meetecho-janus
No, configure is just for users, not rooms.

L.

Lorenzo Miniero

unread,
Dec 2, 2017, 5:37:57 AM12/2/17
to meetecho-janus
The missing features when saving to config should be fixed here, let me know if that's not the case:

L.

Mirko Brankovic

unread,
Dec 2, 2017, 1:18:10 PM12/2/17
to meetecho-janus
You changed ice.c loop on purpose or by accident in this pr?

Lorenzo Miniero

unread,
Dec 2, 2017, 2:05:29 PM12/2/17
to Mirko Brankovic, meetecho-janus
On purpose, it's changes we made yesterday that I forgot to push.

L.

Mirko Brankovic

unread,
Dec 2, 2017, 2:06:51 PM12/2/17
to meetecho-janus
Oh oki thanks ;)
Reply all
Reply to author
Forward
0 new messages