Live data from Hacker News

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

github.com

31–40 of 128 posts

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

#31

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.

MPEG1 over WebSockets: https://jsmpeg.com/

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

#33
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?

If you are interested in desktop implementations, you can access the telegram desktop source code, which also uses WebRTC: https://github.com/telegramdesktop/tdesktop/blob/a506e9b9eb7...

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

#34

How the world has changed that running something on a raspberry pi counts as "embedded". I was expecting this to be on some microcontroller...

For how many years do you want to keep defining embedded as single core, no MMU with a relatively low clock?

And in the same vein : settopboxes are considered embedded. TiVo's are.

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

#35
This would be interesting to integrate into https://github.com/openmiko/openmiko which is a firmware for the T20 based ip-cameras.

Right now, I am not aware of any cheap ip camera that can stream its H264 video to a regular web browser, with sub 500 ms latency. All manufacturers seem to have moved to an app, I guess they can show an RTSP stream in that way.

Older ip cameras had MJPEG which you could view in the browser, but that is really inefficient w.r.t. bandwidth.

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

#36
post #21
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?

The official one, pion (go) and webrtc-rs (rust) can all be used on both sides.

pion link: https://github.com/pion/webrtc

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

#37

Earlier quoted context omitted.

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

You can just use google stun servers they are free to use

Here's a list of public STUN servers (non google too) https://www.voip-info.org/stun/

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

#38
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.

You'd also need a TURN server if both peers are behind NAT without UPnP, which is very common. STUN alone wouldn't be enough.

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

#39

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 ?

Your p2p nodes might not be behind NAT. In a lot of populations you can rely on everyone having working v6 for example.

I think the question of what's "pure" p2p is somewhat academic. If your app uses DNS, is it p2p, isn't DNS just a distributed p2p database? Does p2p require that every aspect of your app right down to discovery is distributed among nodes running your app? Is it cheating to use an existing DHT? etc.

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

#40

This would be interesting to integrate into https://github.com/openmiko/openmiko which is a firmware for the T20 based ip-cameras. Right now, I am not aware of any cheap ip camera that can stream its H264 video to a regular web browser, with sub 500 ms latency. All manufacturers seem to have moved to an app, I guess they can show an RTSP stream in that way. Older ip cameras had MJPEG which you could view in the brows…

The stock Wyze and Xiaomi firmware for their T20 based cameras both use WebRTC to stream the video to their apps.
Post reply on HN