Broadcast RTP Stream with Kurento

8.5k views Asked by At

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.

2

There are 2 answers

2
lulop On

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.
2
strumps On

Your question does not seem to be specific to Kurento. To broadcast audio and video you can use UV4L & Jitsi Meet instead:

Thanks to a new, special module for UV4L, it is now possible to join a room of any Jitsi Meet Web Conference anywhere (including those on the free, public meet.jit.si service) and broadcast live video and audio from your camera and microphone to all the participants or viewers in the room without the need of any browser installed on the Raspberry Pi!