Streaming surveillance cameras using WebRTC

There was a time, you needed to enable port forwarding if you were planning to make a service publicly available for the internet. Isn't that great? Using the concept of port forwarding, you can now watch your video surveillance cameras, residing on your local home network, from everywhere in the world using a simple username and password. Boom 💥!

Port Forwarding? Hell no!
WebRTC has landed!

WebRTC has landed

Using the concept of WebRTC you can now access your cameras from anywhere in the world, just like you would do, using port forwarding. However the cool thing is that you don't need to do port forwarding.

Wait a minute, what are those acronyms? RTP, ICE,..

Although WebRTC is great, it comes with a steep learning curve, but really steep. There is much to learn, and a lot of those building blocks deserves its own expertise or at least a packed book. So before you can really master WebRTC, its good to start with a high-level overview.

So how can WebRTC help me exposing IP cameras?

We at Kerberos.io are relying heavily on WebRTC when it comes to P2P streaming. At one side we have a IP camera in a company network, on the other hand we have a user requesting the IP camera stream, for example from a cellular network, on his mobile phone.

WebRTC how does it work?

Thanks to the concept of signalling and ICE (Interactive Connectivity Establishment), WebRTC can establish the best possible P2P connection between the camera and the user behind the mobile phone.

What are those ICE candidates?

I don't want to get too detailed, but you have a couple of Candidate Types, and they are very well documented on the internet. You have HOST candidates, SRFLEX candidates, RELAY candidates. Read more about what they do here. https://webrtcforthecurious.com/docs/03-connecting/#candidate-gathering

So again, how does WebRTC help me exposing my video surveillance cameras?

Ok, finally we are at the purpose of this article. In the world of video surveillance, you typically have a VMS running in the form of a NVR or kind of agent. The VMS is hosted inside the same network of where your IP cameras are running. Agents are typically more intelligent and flexible than a simple NVR, therefore we will focus on the Kerberos.io agent, and show you why agents are superior towards NVRs.

Transcoding

You could just send over the original camera stream to the browser of the WebRTC user, but do you want to send over 4K streams to a mobile phone, or even a Desktop browser? And do you want to watch multiple 4K streams at the same time? There might exist situations where you would like that to happen, but in most cases such as poor network bandwidth you don't want that.

Thank you Pion

The Kerberos team highly supports the Pion project, as it proved to be very stable, mature and most importantly has an amazing community.

Presales Engineer @SAP , Founder of @kerberosio . Passionated by technology.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store