Live data from Hacker News

A simple C implementation to stream H.264 to browser using WebRTC

github.com

11–20 of 128 posts

Re: A simple C implementation to stream H.264 to browser using WebRTC

#11

I'm not very familiar with WebRTC & how the browser pulls video usually, in what way is this better? Also, what benefits does WebRTC give over other protocols?

WebRTC is generally for video conferencing as that requires real time communication.

Live streams or videos on the web are most commonly hls or dash protocols. Just mp4 file play while download also works.

Hls/dash are not built for lower latencies. They are built for easy CDN distribution and flexible switching between different resolutions and bitrates. Live streams generally are at least a few seconds behind.

Re: A simple C implementation to stream H.264 to browser using WebRTC

#12

Earlier quoted context omitted.

WebRTC with STUN is pure p2p where ffmpeg it requires a rtmp or rtsp server

... how is STUN pure p2p ? you still need to have a STUN server somewhere no ?

STUN is just for punching holes in your NAT router, and also discovering what is your public IP address. Both things will be needed for the other peer to know where to reach you. And the other way around.

Once this NAT thing has been done by both parts, and the actual communication has started directly P2P, STUN is not needed any more.

Re: A simple C implementation to stream H.264 to browser using WebRTC

#13
post #12

Earlier quoted context omitted.

... how is STUN pure p2p ? you still need to have a STUN server somewhere no ?

STUN is just for punching holes in your NAT router, and also discovering what is your public IP address. Both things will be needed for the other peer to know where to reach you. And the other way around. Once this NAT thing has been done by both parts, and the actual communication has started directly P2P, STUN is not needed any more.

> STUN is just for punching holes in your NAT router, and also discovering what is your public IP address.

I know, but what I mean is that "true P2P" on our current internet architecture is not possible, you always need the help of a third party

Re: A simple C implementation to stream H.264 to browser using WebRTC

#14

I'm not very familiar with WebRTC & how the browser pulls video usually, in what way is this better? Also, what benefits does WebRTC give over other protocols?

What other protocols do you know that offer low latency almost real time video and all that in the browser?

There is RTSP but that does not work in browsers.

Re: A simple C implementation to stream H.264 to browser using WebRTC

#15
post #12

Earlier quoted context omitted.

STUN is just for punching holes in your NAT router, and also discovering what is your public IP address. Both things will be needed for the other peer to know where to reach you. And the other way around. Once this NAT thing has been done by both parts, and the actual communication has started directly P2P, STUN is not needed any more.

> STUN is just for punching holes in your NAT router, and also discovering what is your public IP address. I know, but what I mean is that "true P2P" on our current internet architecture is not possible, you always need the help of a third party

If we are still in the 90's that definition of "true p2p" would be: two computers with both having public IPs and transferring packets via TCP. But nowadays we are always behind NATs so we became less strict with the definition of what is true p2p

Re: A simple C implementation to stream H.264 to browser using WebRTC

#16
post #4

In complete sincerity, how is this better than ffmpeg https://trac.ffmpeg.org/wiki/StreamingGuide

If you're using ffmpeg with rtp, you can use Pion to make it a WebRTC stream: https://github.com/pion/webrtc/tree/master/examples/rtp-to-w...

Re: A simple C implementation to stream H.264 to browser using WebRTC

#18
post #17

I've seen a few WebRTC server implementations pop up recently but the only clients I have seen are web browsers. Does anyone know of any WebRTC client implementations apart from the browser? Or am I misunderstanding the WebRTC architecture completely?

Windows, https://github.com/microsoft/winrtc

Re: A simple C implementation to stream H.264 to browser using WebRTC

#19
post #6
post #4

In complete sincerity, how is this better than ffmpeg https://trac.ffmpeg.org/wiki/StreamingGuide

It's certainly not better than FFmpeg. But I had a look through the source code and the author seems to have a fairly good grasp of WebRTC. The library looks really useful for anyone that wants to quickly understand WebRTC and how to use librtp and libsrtp. It's mostly a bare-bone wrapper around those libs.

Maybe it would be a good starting point for someone integrating it into ffmpeg

Re: A simple C implementation to stream H.264 to browser using WebRTC

#20
post #17

I've seen a few WebRTC server implementations pop up recently but the only clients I have seen are web browsers. Does anyone know of any WebRTC client implementations apart from the browser? Or am I misunderstanding the WebRTC architecture completely?

At a low level, webrtc interoperates with VoIP. But because webrtc doesn't mandate a signalling protocol and VoIP uses SIP, generally you need a browser to run whatever proprietary signalling the site decided to implement in JS.
Post reply on HN