Use an Ip-Camera with Webrtc

Use an IP-camera with webRTC

Short answer is, no. RTSP is not mentioned in the IETF standard for WebRTC and no browser currently has plans to support it. Link to Chrome discussion.

Longer answer is that if you are truly sold out on this idea, you will have to build a webrtc gateway/breaker utilizing the native WebRTC API.

  1. Start a WebRTC session between you browser and your breaker
  2. Grab the IP Camera feed with your gateway/breaker
  3. Encrypt and push the rtp stream to your WebRTC session from your RTSP stream gathered by the breaker through the WebRTC API.

This is how others have done it and how it will have to be done.

UPDATE 7/30/2014:

I have experimented with the janus-gateway and I believe the streaming plugin does EXACTLY this as it can grab an rtp stream and push it to an webrtc peer. For RTSP, you could probably create RTSP client(possibly using a library like gstreamer), then push the RTP and RTCP from the connection to the WebRTC peer.

How to play IP Camera RTSP feed with WebRTC in Ant Media Server?

There are two ways to do this with Ant Media Server.

  1. You can add the RTSP URL for your camera to Ant Media Server as a stream source. You can do this as documented here or you can use this REST method by providing the source URL. With this solution you will have video/audio data on the server side and you can record or re-stream it.

  2. The second way is more innovative and but it is applicable for the camera which has own processors (mostly ARM) on it. In this solution you can run the Embedded SDK software on your camera's processor. This software can capture video/audio data from the camera and feed that data to the WebRTC peer. In this case data is sent directly to the WebRTC peer without passing through the server.

    You can find for about Embedded SDK here.
    You can find reference project executable files for different architectures here.

    Lastly if you want to modify and build this reference project by your self you
    will need SDK libraries. You can login to antmedia.io and download the SDK libraries.

RTSP stream from an ip camera onto a web page without using any server / webrtc / node or any other cloud based solutions

Unfortunately you will need to use something to bridge protocols. Browsers don’t support RTSP.

RTSPtoWebRTC is a easy to use modern solution. It requires a server though.

You could also convert the feed to HLS/DASH or just a streamable mp4/webm. Those can all just be done via ffmpeg/GSteamer.

RTSP to WEBRTC live video streaming

I don't think you will be able to do this with just your browser. You will need some sort of media gateway.

RTSPtoWebRTC is an active project that does exactly what you want! It is written in Go and uses Pion WebRTC

Can I emulate a IP Network Camera as a Media Device that is detected by Chromium?

v4l2loopback is one way you could do this! This allows you to feed a virtual webcam on Linux with arbitrary media.

Then you could have a pipeline in GStreamer that looks like

gst-launch-1.0 rtmpsrc location=$RTMP_SRC ! decodebin ! v4l2sink device=/dev/video0

This pipeline fetches the media from your RTMP server, decodes it and then pushes it to your new virtual webcam. Your device name may be different, ls /dev/video* will be helpful. Then when you open Chromium you can choose a new virtual webcam that is being fed via rtmpsrc.


As a follow up question, do you need to publish via Chromium? It is very easy to publish with something like Pion WebRTC you can give it arbitrary media and it can push to the browser. It also has examples on how you can pull from a rtmpsrc.


Another solution could be OBS. It allows you to consume an RTMP Source, and then you can output a Virtual Cam. So OBS would serve a webcam that contains your produced content, which would just be one full screen video pulled from RTMP.

How to intergrate IP-Camera with kinesis-video-streams-webrtc-sdk sample code?

https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-js contains an implementation of the KVS Signaling client and a sample that ties up the browsers WebRTC implementation together with the signaling in an application. In order to stream a generic rtsp you will need to modify the browsers implementation of the webrtc or add your own handling of the webrtc in the first place and feed the frames into the webrtc of the browser.

You could also check out the native C-based WebRTC implementation from KVS: https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-c

Stream Video using Twilio from IP Camera RTSP


Can someone point me to an example that streams video from an RTSP
stream provided by an IP Camera?

Since you've tagged Javascript you've got to realise that rtsp:// is not an expected video source within the HTML5 environment. There isn't a specific example for RTSP stream from camera.

possible solution :

The only solution I can think of is to use a virtual webcam software that outputs a video stream/file instead of showing feed from device webcam.

The virtual webcam would be detected like a normal webcam (by browser / webRTC), but instead of showing your face, it shows a pre-recorded stream/file. If you involve FFmpeg you could replace MP4 file with your RTSP live-stream.

On the Twilio / HTML5 code side, you simply select the "virtual cam" as if real webcam, now this way you can send RTSP feed as if it's your webcam feed.



Related Topics



Leave a reply



Submit