Broadcast RTP Stream with Kurento

d00d picture d00d · Nov 28, 2014 · Viewed 8.1k times · Source

I have the following setup:

Raspberry Pi with raspicam (CSI camera) sends an RTP stream to a Server in the same local network with gstreamer1.0.

I´m using the following pipeline: raspivid -t 0 -h 720 -w 1080 -fps 25 -hf -b 2000000 -o - | gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=1 pt=96 ! gdppay ! tcpserversink host="RPI-IP" port=5000

I can receive the stream on my Ubuntu 14.04 server with this pipline: gst-launch-1.0 -v tcpclientsrc host="RPI-IP" port=5000 ! gdpdepay ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink sync=false

I installed kurento on the server following this instructions

Can someone point me to a document or tutorial on how to setup the server to get the RTP Stream out into the web, using WebRTC broadcast or HTTP streaming, so I can include the stream in a website without any plugins ?

I read in the documentation that there is an RTP-Endpoint and an WebRTC-Endpoint. So In my understanding I can connect both and would like to have this setup:

RPI -> GStramer --> RTP -> Server -> RTP-Endpoint (kurento Media Server) -> WebRTC-Endpoint (kurento Media Server) -> Browser(Client)

Is this even the right way to go? Other suggestions are welcome too.

Answer

lulop picture lulop · Dec 1, 2014

Indeed you can create that setup using Kurento Media Server. However, there are a couple of issues you neeed to consider:

  • Kurento Media Server will be transparently transcoding for you when you connect the H.264 based RtpEndpoint to the VP8 based WebRtcEndpoint. This transcoding is expensive in terms of CPU and you will pay it with less scalability in the broadcasting.
  • If you don't want to use an application server (so that all the logic is at the client app at the RPI), you will need to create a client capable of "speaking" with Kurento Media Server. For this, you need to implement the Kurento Protocol. Otherwise, you could use one of the built-in Kurento Clients through some kind of app server, but currently only Java and JavaScript are available.