New Lua plugin

355 views
Skip to first unread message

Lorenzo Miniero

unread,
Oct 13, 2017, 9:25:28 AM10/13/17
to meetecho-janus
Hi all,

this post introduces a new effort we've been working on recently, that is a new Janus plugin that should allow you to write all your application logic in Lua, instead of having to write a C plugin. You can find all the relevant details in the PR text, so without further ado, here it is:


Feedback welcome!
Lorenzo

Lorenzo Miniero

unread,
Oct 17, 2017, 6:20:35 AM10/17/17
to meetecho-janus
For people interested in this effort, I wrote a small tutorial on how to develop in Lua for Janus on our blog:

Chad Furman

unread,
Oct 18, 2017, 3:17:43 AM10/18/17
to meetecho-janus
For anyone who wants to play around with this, here's a docker container.  It's configured to load the echotest.lua plugin if you simply run `docker-compose up`.  You can modify lua.cfg to run the videoroom.lua or the myscript.lua files as you please.

https://github.com/chadfurman/docker-janus

Lorenzo Miniero

unread,
Oct 18, 2017, 5:08:26 AM10/18/17
to meetecho-janus
Thanks for working on that!

L.

Marshall Quander

unread,
Oct 18, 2017, 5:27:29 AM10/18/17
to meetecho-janus
Interesting work! I've been writing a Rust library to do the same thing, since writing anything substantial like this in C is a big ask. You can see the plugin I'm building with it here: https://github.com/mquander/janus-plugin-sfu

High performance server-side audio spatialization and mixing may be on the roadmap for mine, so I'm not sure that Lua is the best fit for my use case, but I look forward to seeing where this one goes.

Lorenzo Miniero

unread,
Oct 18, 2017, 5:35:45 AM10/18/17
to meetecho-janus
Il giorno mercoledì 18 ottobre 2017 11:27:29 UTC+2, Marshall Quander ha scritto:
Interesting work! I've been writing a Rust library to do the same thing, since writing anything substantial like this in C is a big ask. You can see the plugin I'm building with it here: https://github.com/mquander/janus-plugin-sfu



Interesting! As soon as you believe it's in a usable state and you'd like it to share with other people, don't hesitate to add it in the list of plugins on our resources page:


 
High performance server-side audio spatialization and mixing may be on the roadmap for mine, so I'm not sure that Lua is the best fit for my use case, but I look forward to seeing where this one goes.


Well actually no media manipulation is done in Lua: everything that relates to media is in the C code, and you only use Lua to decide what to do and how to interact with users. Typically you'd create C methods and then expose them as Lua functions so that your Lua script can poke it. We do have some C methods available already for basic/common features, but a janus_lua_extra.c piece of code is available to add your own functions instead, and the plugin will load them (but that will need C development too, of course).

Really interested to see what you'll be able to accomplish with Rust and Janus! If you'll ever write a blog post or present this somewhere, please let me know and I'll gladly educate myself :-)

Lorenzo
Reply all
Reply to author
Forward
0 new messages