Live data from Hacker News

Janus WebRTC Server

janus.conf.meetecho.com

41–50 of 65 posts

Re: Janus WebRTC Server

#41
post #24
post #4

We use Janus as a WebRTC SFU for projects in the education/gaming sector. Its general purpose approach to WebRTC has been a good foundation to help us build custom solutions.

Did you write your own plugin or are you using VideoRoom or something? The thing that turned me off of Janus is that VideoRoom seemed way too high level and made tons of schema assumptions, but all of the important SFU functionality seemed intertwined into the codebase of that plugin, so if I were to actually want to build a "custom solution" it looked like I would have to maintain an annoying-to-merge fork of that t…

We write our own services to coordinate janus rooms over multiple instances. That service takes care of translating from our own domain specific entities to janus room. It's also responsible for sharding rooms to healthy and available Janus instances. Instead of treating janus rooms as thick/permanent, we prefer to treat them like "just-in-time", rooms get destroyed when not used and get provisioned when requesetd, making it very flexible.

We have made some modifications to the Janus video room plugin but only to fix bugs or provide specific functionality we needed for certain gaming use-cases. Out of the box, the plugin is already very featureful. The key is to always stay up to date with master, the project is fairly active and so keeping up to date is very important.

We have debated writing our own plugin and that's certainly a possibility in the future. (There is a Duktape JS layer available) To be completely transparent, if we were to reach that need, I would re-evaluate the solution with more recent alternatives, like pion.ly.

Re: Janus WebRTC Server

#42
Newbie here,

Can someone explain why webrtc needs a server and how Janus fulfills this role?

As far as I understand webrtc is meant to be peer to peer with minimal server signaling, so what role does a WebRTC server play?

Re: Janus WebRTC Server

#43

Newbie here, Can someone explain why webrtc needs a server and how Janus fulfills this role? As far as I understand webrtc is meant to be peer to peer with minimal server signaling, so what role does a WebRTC server play?

These are the big points I see for servers, I am sure there are more though!

* Less resource usage for users

If you do mesh signaling every user connect with each other via P2P. This means if you have a 4 person conference call everyone needs to upload their video 3 times. If you have a media server each user uploads only once, and then the server distributes the video. This means a lot less CPU and network usage for each user.

* P2P Connections reveal details about the user

If users are connecting directly to each other they are able to figure out details like their public IP. If you route everything through a server you can anonymize more things.

* Protocol Bridging

People want to view RTSP/RTMP/$X via WebRTC. A media server is the only way to make it happen.

* Less variability to deal with

When doing P2P connections you will deal with a lot more variables. It will be harder to figure out which user's internet is causing issue, or debug encode/decode issues. A few times running a SFU has come really in handy because I was able to debug something that would have been impossible when just doing P2P.

Re: Janus WebRTC Server

#44
post #4

We use Janus as a WebRTC SFU for projects in the education/gaming sector. Its general purpose approach to WebRTC has been a good foundation to help us build custom solutions.

What turn servers do you use?

https://www.resiprocate.org/ReTurn_Overview

Re: Janus WebRTC Server

#45

Having to look into this professionally for local/remote streaming solutions and came across this paper in the last couple of weeks which has been a huge help to understanding my use case: http://lup.lub.lu.se/luur/download?func=downloadFile&recordO... One of the most useful/interesting use cases to me is the ability to have a PTP encrypted stream without having to go through weird IoT PKI hoops. Ninja edit: If anyon…

I do WebRTC on Edge/IoT devices (mostly MIPS/ARM devices running Linux). Customers are mostly teleoperations (robotics) and security cameras. Most customers run an MCU/SFU on a server, but then just a WebRTC client on the device. We do simulcast on the device to an SFU, and then distribute from there. Happy to answer questions here or directly. I don't want to be disrespectful and sell other stuff on this thread thou…

Are there resources you might recommend on using WebRTC for the teleoperations use case?

Re: Janus WebRTC Server

#46
post #40

Earlier quoted context omitted.

It sounds like you have a use-case that you should just write your own plugin for. The out-of-the-box video room plugins aren't suitable. > the vast majority of the VideoRoom functionality is written in C It's still just a plugin that hooks the same callbacks and implements the same interfaces as any of the rest of them. Feel free to implement your own.

At that point why wouldn't I just use libwebrtc? The reason to get an off-the-shelf SFU is because all the hard work is in handling all the codec-specific workarounds, being able to handle keyframe request sharing, responding to RTCP bandwidth feedback to do SVC layer switching, and now doing all of this while most of the state is encrypted due to insertable streams... this is all hard stuff that people keep learning…

Like I said, Janus doesn't do anything by default except for some core RTC stuff and push packets around. You have to implement your own use-case via a plugin. It sounds like the Video Room plugin that's implemented in C is not exactly what you want. You can write your own plugin (maybe based on it) yourself.

If you want to implement E2E via insertable streams then you can start right here:

https://github.com/meetecho/janus-gateway/blob/master/plugin...

Re: Janus WebRTC Server

#47
post #24

Earlier quoted context omitted.

Did you write your own plugin or are you using VideoRoom or something? The thing that turned me off of Janus is that VideoRoom seemed way too high level and made tons of schema assumptions, but all of the important SFU functionality seemed intertwined into the codebase of that plugin, so if I were to actually want to build a "custom solution" it looked like I would have to maintain an annoying-to-merge fork of that t…

We write our own services to coordinate janus rooms over multiple instances. That service takes care of translating from our own domain specific entities to janus room. It's also responsible for sharding rooms to healthy and available Janus instances. Instead of treating janus rooms as thick/permanent, we prefer to treat them like "just-in-time", rooms get destroyed when not used and get provisioned when requesetd, m…

I recommend NOT implementing plugins in JavaScript with the Ducktape JS layer. I strongly recommend writing plugins in Lua for maximal compatibility and performance.

Re: Janus WebRTC Server

#49
post #23

I am currently working on a project to solve my own needs around this. If anyone wants to collaborate or chat about it please e-mail me. I've done some work around the Xiaomi cameras with the custom firmware so love to talk to others about what they want to see.

I hacked together a proof of concept of using Janus to wrap the H264 RTSP stream of the Xiaomi Dafang into a WebRTC stream without transcoding, giving close to real-time streaming of the ip camera to browsers without needing a plug-in.

Currently, Janus and Nginx (https/auth) run on a cheap VPS, and a device in the NAT network of the ip camera creates a Wireguard tunnel to get the RTSP stream to the VPS without needing to open/forward ports on the NAT.

Ideally, more of the components could run on the camera itself, but I haven't gotten to cross compile anything to the MIPS cpu of the Xiaomi camera. Will contact you so we can chat.

Re: Janus WebRTC Server

#50

For those that are interested in Janus and WebRTC in general, I highly recommend reading Lorenzo Miniero's (creator of Janus) Ph.D thesis [1] on the project and the state-of-the-art of WebRTC. It's brilliant and enlightening. The Janus project is a really marvel of engineering. [1] http://www.fedoa.unina.it/10403/1/miniero_lorenzo_27.pdf (PDF)

I didn't know anyone else apart from me and and my tutor had read my Ph.D Thesis... :-) Glad you found it informative! Janus was indeed born during my research efforts there.
Post reply on HN