Sending live video to janus through additional server

168 views
Skip to first unread message

Krzysztof Pacholski

unread,
May 3, 2020, 11:03:39 AM5/3/20
to meetecho-janus
Hi all,
I started playing around with Janus-Gateway and videoroom plugin. I have tried to connect android app and see result on the demo app from janus package and everything seems to work fine.
Now I would like to implement my own server in Laravel to handle user permissions. I am thinking of establishing broadcast connection with user and check whether has rights to join the channel or not, and ff yes, create connection to Janus.

1. Is that the correct approach?
2. What is the best way to send live video from the user to the janus through own/additional server? Do I need any addition tools, libraries to do that?
3. Is there any example of sending video to janus through additional server I could analize?

Javier S

unread,
May 3, 2020, 1:45:57 PM5/3/20
to meetecho-janus
I have no idea how Laravel works, but I am doing almost the same in PHP.

What I have made is a Signaling server using SocketIO. This is my Signaling videoroom server before starting to add Janus https://github.com/jsanahuja/php-peer-server (mesh). You can take a look but if you don't know about Signaling, you should do a little bit of research.

The frontend talks to the PHP SocketIO server and it talks to Janus VideoRoom plugin using the Admin API and Rest API through Websockets:

These docs give you a small overview but all the data of the methods you will need to use is here: (search "\c <method>")

Unfortunately not all requests can be done through the Admin API (https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!topic/meetecho-janus/n6KUf85GOHQ) and the Rest API implements sessions. If your Janus server is never going to talk to other than your PHP I recommend you to set session_timeout = 0 in your janus.jcfg and do your own session management (create/destroy).

--
Javier

Javier S

unread,
May 3, 2020, 2:10:24 PM5/3/20
to meetecho-janus
PS: Note that video will never (or I think it shouldn't) be sent through your PHP Server. Frontend should establish a peer connection with your Janus through your PHP server

Krzysztof Pacholski

unread,
May 3, 2020, 2:37:35 PM5/3/20
to meetecho-janus
Oh, that's what I was wandering. So only, authorization, room creation etc. should go through my server and video stream should go to the correct channel of Janus server directly from the end user right?

Javier S

unread,
May 3, 2020, 2:41:19 PM5/3/20
to meetecho-janus
Yes, through a PeerConnection https://developer.mozilla.org/es/docs/Web/API/RTCPeerConnection

Your server will manage the logic and tell Janus what to do but the streams will be sent directly to Janus.

Fr3di

unread,
May 3, 2020, 2:48:25 PM5/3/20
to meetecho-janus
Great, thank you for your help @Javier S. Will have to read a bit more about signalling and will try to write some code :)
Reply all
Reply to author
Forward
0 new messages