Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is RTSP and WebRTC for streaming?

I'm very newbie for streaming. But I must do a user-based streaming system with IP camera. It will be like security cameras. One user will has one stream. My team think working with RTSP. And they want know how will we do it and what is rtsp , webrtc , rtp. I'm researching and i want to ask to you. So what is exactly RTSP? Some IP cameras say supporting WebRTC and what is this? Is this compatitable with RTSP? Which is the best protocol for user based streaming ?

like image 200
faksu3442 Avatar asked Jul 26 '15 09:07

faksu3442


People also ask

Does WebRTC use RTSP?

WebRTC is often touted as being designed for low latency. While that is certainly true, both WebRTC and RTSP employ the same underlying transport protocol for video and audio streaming: RTP (or SRTP when encrypted).

What is WebRTC streaming?

WebRTC leverages three HTML5 APIs enabling browsers to capture, encode, and transmit live streams. While streaming workflows can often require an IP camera, encoder, and streaming software, the most basic WebRTC use-cases can manage the whole enchilada with just a webcam and browser.

What is RTSP used for?

RTSP started as a way to allow users to play audio and video straight from the internet, rather than having to download media files to their devices. The protocol has been applied for various uses, including internet camera sites, online education and internet radio.

Which is better WebRTC or HLS?

HLS is more widely supported but can be less reliable and has higher latency than WebRTC. Both protocols offer a high level of quality and security. It is important to choose the right protocol for your needs. If you need low latency and high quality, then WebRTC is the best choice.


2 Answers

Let me explain to my Best. Correct me if i m wrong anywhere you feel.

Streaming media data :

You are transferring media data ( audio/ video ) from one end to another end.

RTSP/RTP/UDP, RTCP

RTSP It is a Streaming protocol, and it works like a remote control. Think what you could do with remote control. Play, pause.. etc, that's what RTSP Implements and takes care of. Well, then who is transferring data ?. Here RTP comes into picture. RTP is a transport protocol used by RTSP. RTP uses UDP. Ahh..I know what is UDP/TCP, where all the RTP comes from? There is one core difference between UDP and TCP that we care about. In UDP you can not track if there is a packet loss, and hence RTP. RTP works on UDP, but provides facilities to track the missed packet, so that the receiver can act accordingly. For Example, if there is a packet loss at receiver end for h.264 packet transfer, he could request sender to give full 'I' frame. You can assume RTCP is just a control protocol that works with RTP for QoS Metric.

Ok, so far so good. Now, several question appears in our mind. Everything is now in browser. Yes, can we stream the media to the browser?. Yes, that's where WebRTC comes into picture. WebRTC again uses RTP protocol. so, webRTC is a standard, that helps to media stream from/to browsers. also, it has additional features mentioned below.

1) It is browser based.

2) One Big difference is that is facilitates Peer to Peer network connection with the help of TURN/STURN server.

3) In build codec support.

4) It supports Arbitrary data transfer too. ;)

Hope it gives some basic idea.

like image 199
Whoami Avatar answered Oct 12 '22 00:10

Whoami


RTSP is a streaming control protocol, to control streaming server (whoami's remote control analogy in another answer is a very nice way to think of it). It defines how to package data to stream it and how both ends of the connection should behave to support the protocol.

To be clear, it does not actually transport the media data itself - the RTP (Real Time Transport) protocol takes care of this.

To further complicate things, RTCP (Real Tine Control Protocol) exists also - despite the name, its main purpose is to collect statistics for the RTP session.

SDP (session description protocol) is also useful to be aware of in this context -it contains information about the session parameters for the stream and is used by RTSP etc. Example parameters include session name, time the session is available, URI etc.

WebRTC is a project and a set of IETF drafts that provide browsers with a set of API's to support 'Rich' web communications.

In very simple terms WebRTC might provide an API to allow a web programmer (i.e. someone using Javascript to create a browser based client) use a protocol like RTP to stream data.

Note the word 'might' above - currently WebRTC does not support direct interworking with RTSP at this time, although there is some discussion around it:

  • https://groups.google.com/forum/#!topic/discuss-webrtc/fKL2dJ1-l-Y
like image 38
Mick Avatar answered Oct 12 '22 00:10

Mick