sepfy/pear logo

sepfy/pear

Free

WebRTC Library for IoT/Embedded Device using C

FreeFree tier
Type
Open Source

About sepfy/pear

libpeer is a portable WebRTC library written in C, designed for IoT and embedded devices such as ESP32 and Raspberry Pi. It uses BSD sockets and supports H.264 video, G.711 PCM (A-law and μ-law) and OPUS audio codecs, as well as DataChannel and STUN/TURN for NAT traversal. The library integrates with signaling protocols like WHIP and MQTT, and is distributed under the MIT license.

Key Features

Written in C for portability across platforms
Supports H.264 video codec
Supports G.711 PCM audio (A-law and μ-law) and OPUS
DataChannel for low-latency data transfer
STUN/TURN for NAT traversal
IPv4 and IPv6 support
Signaling via WHIP and MQTT
Dependencies: mbedtls, libsrtp, usrsctp, cJSON, coreHTTP, coreMQTT
Examples for ESP32, Raspberry Pi Pico, and Raspberry Pi
MIT licensed open source

Pros & Cons

Pros
  • Lightweight and portable C implementation suitable for embedded systems
  • Supports multiple audio and video codecs (H.264, G.711, OPUS)
  • Includes STUN/TURN for reliable NAT traversal
  • Open source under MIT license with permissive reuse
  • Active community with 1.5k stars on GitHub
  • Provides ready-to-use examples for popular platforms (ESP32, Pico, Raspberry Pi)
Cons
  • Requires manual build process with multiple dependencies
  • Primarily targeted at embedded/IoT devices, may not be suitable for desktop or server use
  • Documentation limited to README and examples; no extensive API docs
  • May require familiarity with C and embedded development to integrate

Best For

Integrating real-time video/audio streaming from IoT devices (e.g., ESP32) to web browsersBuilding video doorbells or surveillance cameras with embedded hardwareTwo-way audio communication on Raspberry PiData channel communication for IoT sensor dataPing-pong data exchange on resource-constrained devices like Raspberry Pi Pico

FAQ

What is libpeer?
libpeer is a portable WebRTC library written in C for IoT and embedded devices. It enables video and audio streaming over WebRTC using BSD sockets.
Which platforms are supported?
libpeer supports platforms like ESP32, Raspberry Pi Pico, and Raspberry Pi. It also runs on generic Linux systems.
What codecs are supported?
Video codec: H.264. Audio codecs: G.711 PCM (A-law and μ-law) and OPUS.
Does libpeer support STUN/TURN?
Yes, it includes STUN/TURN support for NAT traversal.
What license is libpeer released under?
It is released under the MIT license.