sepfy/libpeer
FreeWebRTC Library for IoT/Embedded Device using C
FreeFree tier
Inputs: video, audioOutputs: video, audio
About sepfy/libpeer
libpeer is a portable WebRTC library written in C, designed for IoT/embedded devices. It enables real-time video and audio streaming over WebRTC on resource-constrained platforms such as ESP32, Raspberry Pi, and PICO. The library uses BSD sockets and supports multiple codecs (H264, G.711 PCM A-law/µ-law, OPUS), data channels, STUN/TURN for NAT traversal, IPv4/IPv6, and signaling methods including WHIP and MQTT. Dependencies include mbedtls, libsrtp, usrsctp, cJSON, coreHTTP, and coreMQTT. It is released under the MIT license.
Key Features
Written in C with BSD sockets for portability
Supports H264 video codec
Supports G.711 PCM A-law and µ-law audio codecs
Supports OPUS audio codec
DataChannel for peer-to-peer data exchange
STUN/TURN for NAT traversal
IPv4/IPv6 support
WHIP signaling protocol support
MQTT signaling protocol support
Examples for ESP32, PICO, Raspberry Pi
Pros & Cons
Pros
- Lightweight and designed for resource-constrained embedded devices
- Portable across multiple platforms (Linux, ESP32, Raspberry Pi, PICO)
- Supports multiple audio/video codecs and signaling methods
- Open source with MIT license, free to use and modify
- Uses standard WebRTC protocols for interoperability
Cons
- Requires manual compilation and dependency management
- Limited documentation beyond the README and examples
- Not a full WebRTC stack; lacks advanced features like adaptive bitrate or congestion control
Best For
Real-time video streaming from ESP32 to WebRTC clientsTwo-way audio streaming on Raspberry PiData channel ping-pong on PICO boardIoT/embedded device integration with browser-based WebRTC applicationsMJPEG over datachannel for ESP32
FAQ
What platforms does libpeer support?
libpeer is designed for IoT/embedded devices and has examples for ESP32, Raspberry Pi, and PICO. It runs on Linux and other POSIX systems with BSD sockets.
Which audio and video codecs are supported?
libpeer supports H264 video, and audio codecs G.711 PCM A-law, G.711 PCM µ-law, and OPUS.
Does libpeer support signaling?
Yes, it supports WHIP and MQTT signaling protocols, and includes a generic example with a test website.
What are the dependencies for building libpeer?
Dependencies include mbedtls, libsrtp, usrsctp, cJSON, coreHTTP, and coreMQTT.
Is libpeer open source?
Yes, it is licensed under the MIT license.