Hacker News new | past | comments | ask | show | jobs | submit login
Pure C WebRTC (github.com/awslabs)
107 points by seansh on Jan 7, 2024 | hide | past | favorite | 16 comments



I was going through some of my old projects and saw one that used this webrtc library. I remember at least at the time (3-4 years ago) if you wanted a webrtc communication channel outside of the browser there were really only two options. One was from Google [1], which is used in both chrome and firefox, and the other one was this c library.

I recall it took me a week to figure out how to properly compile Google's implementation (which uses the bazel build system) as a static or dynamic library to link to. Even then, I think I couldn't get it below something like 50MB. I don't remember the exact binary size but it was so large that I either had to give up using it or give up calling my app "lightweight".

Later I learned that there was also another great implementation written in Go [2] but obviously not feasible if the rest of your project is not in Go.

[1] https://webrtc.googlesource.com/src

[2] https://github.com/pion/webrtc


AFAIK 50mb is the entire WebRTC that has a lot of browser-related stuff. If you only needed P2P connection establishment, you could take old version of libjingle from the point in time when it was a separate library.


A lot of those 50mb will probably disappear if you statically link your binary against the library.


The optimization for size is pretty hard (for me at least). Lots of cool stuff you can do. But if you are on a time crunch/trying to go to production it doesn’t happen.

These days I just default to ‘thin’ implementations like mbedtls when I know it’s gonna come up :)


There is also a Rust implementation based on Pion that is active: webrtc-rs/webrtc


s/Rust/Go/


It's not clear what platforms this can run on or how it is related to kinesis


I am really excited about https://github.com/sepfy/libpeer. It has examples ready for ESP32 etc....

When working on KVS I wasn't familiar with the embedded space at all. I saw 'heavyweight' embedded where you were running on Linux. Then you had RTOS/No OS at all. I wasn't prepared for these devices at all. If we can make WebRTC work in the embedded space I think it will really accelerate what developers are able to build!

Remotely driven cars, security cameras, robots in hospitals that bring iPads to infectious patients etc... Creative people are building amazing things. The WebRTC/video space needs to work harder and support them :)

-----

I love how diverse the WebRTC space is now. Outside of this implementation you have plenty of other options!

* https://github.com/shinyoshiaki/werift-webrtc (Typescript)

* https://github.com/pion/webrtc (Golang)

* https://github.com/webrtc-rs/webrtc (Rust)

* https://github.com/algesten/str0m (Rust)

* hhttps://github.com/sepfy/libpeer (C/Embedded)

* https://webrtc.googlesource.com/src/ (C++)

* https://github.com/sipsorcery-org/sipsorcery (C#)

* https://github.com/paullouisageneau/libdatachannel (C++)

* https://github.com/elixir-webrtc (Elixir)

* https://github.com/aiortc/aiortc (Python)

* GStreamer’s webrtcbin (C)

See https://github.com/sipsorcery/webrtc-echoes for examples of some running against each other.


Kinesis Video Streams are somewhat broke . I had to use another tool.

I would connect as viewer (ConnectAsViewer) and when I disconnected often the connection would stay open. And since there's a 10 client limit, after multiple disconnections in the same couple of minutes the system thought there was 10 client and blocked new client but there was zero clients.


I've used WebRTC in JavaScript, but I can't quite get why I would use this library. Can anyone respond with use cases?


Edge device that is communicating with web clients on a network would be my guess. People use WebRTC (mainly the Go library though) to create Remote Desktop implementations. Ex: https://github.com/imtiyazs/webrtc-remote-desktop


I hadn't considered an RDP use-case. Thanks!


Worked on a product that did that cross-platform thanks to go, surprisingly simple to work with.


Customers I have seen

* Taxi uploaded footage to analyze (guns, hostile body language)

* Rescue Delivery Robot (Get a delivery robot unstuck when AI gives up. Need video + send commands)

* Remote Mining Equipment ( Video + Control)

* Remote Surgery (Specialist hands super imposed for local generalist)

* Security Cameras/Doorbells

* Kids smart watch to give parents audio+video

* Battery Operated Wearable Cameras


Interesting, I hadn't thought of that. As a a developer about to use the Pi at the edge, I can see how this would be helpful with delivering footage from the IoT devices.

I'm not sure I understand or would use AWS as the hub though, I would probably build my own server hub.


Anyone find a way to get raspivid (or a lower abstraction) to play nice with WebRTC and negotiate the bit rate depending on the connection quality?




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: