log in

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

Hacker News - Thu Apr 8 05:38


Pear is a WebRTC SDK written in C. The SDK aims to integrate IoT/Embedded device with WebRTC applications.

Notice: This project is a work in progress. Currently, only support streaming H264 video to browser.


Getting Started

# sudo apt -y install libglib2.0-dev libssl-dev git cmake ninja-build
# sudo pip3 install meson
# git clone --recursive https://github.com/sepfy/pear
# ./build-third-party.sh
# mkdir cmake
# cd cmake
# cmake ..
# make


This example is tested on Raspberry Pi zero W with image 2021-01-11-raspios-buster-armhf-lite.img

  1. Open index.html with browser in your computer
  2. Copy textarea content to remote_sdp.txt
  3. Download test video file
  4. Run local file sample. (Please ensure that remote_sdp.txt and test.264 in the same directory)
  1. Copy base64 sdp answer to browser.
  2. Click start session.

You will see the video on your browser.