How to capture rtp stream from webrtc then convert it to hls to broadcast to client? - webrtc

How to capture rtp stream from webrtc then convert it to hls to broadcast to client ?
I want to receive rtp from webrtc in browser via media server (eg kurento ... ) then convert it to hls stream. User can use hlsEndpoint to play.
WebRTC -> RTP -> HLS
What is the correct way?
My aim is to create a live stream app that supports push streams using webrtc , i'm working with rtmp , i want webrtc as an additional option.
Tks all.

Just use a media server to covert WebRTC to Live Streaming like RTMP, HTTP-FLV or HLS, please read this wiki.
Because the WebRTC is not only RTP, but also need to transcode the audio from opus to aac, and there is something like the jitter-buffer, NACK or packet out-of-order to handle.
For live streaming, the RTMP is the de-facto standard in live streaming industry, so if you covert WebRTC to RTMP, you got everything, like transcoding by FFmpeg, forwarding to YouTube, or DVR to file, etc.

If you need to convert WebRTC to HLS or RTMP you may check Ant Media Server
The community edition also provides this.

Related

Ant Media, Jitsi and Janus Which one is best to start live voice stream one to many in Mobile Applications?

I want to build a mobile application where one of the participating users can broadcast audio at a time to other participants can only listen audio, Ant Media, Jitsi and Janus Which one is best to start live voice stream one to many in Mobile Applications?
In my opinion [as a stream engineer] Before trying to choose a webrtc sfu, decide why you need webrtc technology ?
For one to many stream, hls is better and cheaper, easy to use with 3rd party cdn.
If you need to publish stream via webrtc, still you dont have to force end user to watch it as webrtc. Because the webrtc has limitation,
for instance
wowza can handle
750 concurrent endpoint
kurento 200
jitsi 500
janus (I tried 2017 and at that time not stable )
ant media 1300.
If I were you I'll prefer ant media,
here is reason
ingest webrtc -> play webrtc ( ABR enabled )
ingest webrtc -> play hls ( without any transcoding, the stream will be published with h264 )
ingest rtmp -> play hls
ingest rtmp -> play webrtc
wowza can only do
webrtc ingest -> transcode ( vp8,9 to h264 ) -> hls
rtmp to webrtc not supported by wowza. Also ant media enterprise edition is cheaper than wowza.

Is it possible to deliver RTSP stream via Kurento. WebRTC to RTSP

I want to use Kurento as media server which takes WebRTC as an input and provides RTSP stream as url: rtsp://kurento/streamName
Is this possible?
I saw https://github.com/lulop-k/kurento-rtsp2webrtc/ project which does opposite thing.
My final goal is to deliver a stream to mobile browsers via JSMPEG.
This is not possible, as Kurento team says: "We can consume it, but not produce it."
Now, as a common solution for this, you could stream from Kurento to Wowza media server using an RTP endpoint, and then re-stream RTSP from Wowza. In KMS google group there is a lot of content related to the integration between the two of them.

How to stream WebRTC audio to Icecast server?

How can i make an audio stream captured in browser using WebRTC to be streamed live via icecast/shoutcast protocols?
Use liquidsoap + webcaster.js:
https://github.com/webcast/webcaster

Which codec is used for online video Streaming?

I am using WebRTC with kurento media server, as far as i came to know WebRTC supports VP8 for video Streaming and using opus for audio Streaming, So my question is if i want to compress the stream which includes both audio and video, so do i need to use both(VP8 and opus)?
If you are streaming both audio and video then it will use both an audio codec (typically Opus) and a video codec (typically VP8, VP9, or H.264).

How does webRTC implement synchronization of the their audio and video streams from remote?

webRTC is implemented PeerConnection as per https://apprtc.appspot.com/
How does webRTC implement synchronization of the their audio and video streams from remote?
Normal RTP a/v sync done using RTCP SR/RR reports and the timestamps in each SRTP packet.
See any VoIP application.