WebRTC implementation in zig

I started learning zig a few months ago and decided to create my own live media server. I tried first implementing WebRTC in zig.

WebRTC is a collection of protocols that provides peer to peer real time communication.

Since the underlying protocols may be used elsewhere, so I divided the whole multimedia pipeline into several repos.

The only protocols that are not implemented in zig are SCTP (not supported yet) and DTLS (I’m using mbedtls for now)

The implementation uses blocking code style (polling events in while loop) instead of the callbacks as defined in the WebRTC API Spec.

I included an example app where I stream an mp4 file to a browser that can be found in the repo. And the only supported codec is H264.

Any feeedback or suggestion is welcome.

Now that I’m done here, it’s time to go back and read some RFCs.

Supported Zig versions

0.16.0

AI / LLM usage disclosure

AI/LLM is not used for the code. It’s only used to generate some tests.

11 Likes

Your agent code helped me to solve several Io issues

Kudos

1 Like