Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
sepfy committed Aug 17, 2024
1 parent 5eb3d7e commit 496b669
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cmake
build
17 changes: 6 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# libpeer - Portable WebRTC Library for IoT/Embedded Device

![pear-ci](https://github.com/sepfy/pear/actions/workflows/pear-ci.yml/badge.svg)
![build](https://github.com/sepfy/pear/actions/workflows/build.yml/badge.svg)

libpeer is a WebRTC implementation written in C, developed with BSD socket. The library aims to integrate IoT/Embedded device video/audio streaming with WebRTC, such as ESP32 and Raspberry Pi

Expand All @@ -13,6 +13,7 @@ libpeer is a WebRTC implementation written in C, developed with BSD socket. The
- OPUS
- DataChannel
- STUN/TURN
- IPV4/IPV6
- Signaling
- [WHIP](https://www.ietf.org/archive/id/draft-ietf-wish-whip-01.html)
- MQTT
Expand All @@ -26,23 +27,17 @@ libpeer is a WebRTC implementation written in C, developed with BSD socket. The
* [coreHTTP](https://github.com/FreeRTOS/coreHTTP)
* [coreMQTT](https://github.com/FreeRTOS/coreMQTT)

### Getting Started
### Getting Started with Generic Example
```bash
$ sudo apt -y install git cmake
$ git clone --recursive https://github.com/sepfy/libpeer
$ cd libpeer
$ ./build-third-party.sh
$ mkdir cmake
$ cd cmake
$ cmake ..
$ make
$ cmake -S . -B build && cmake --build build
$ wget http://www.live555.com/liveMedia/public/264/test.264 # Download test video file
$ wget https://mauvecloud.net/sounds/alaw08m.wav # Download test audio file
$ ./examples/sample/sample
$ ./generic/sample/sample
```

### Examples
### Examples for Platforms
- [ESP32](https://github.com/sepfy/libpeer/tree/main/examples/esp32): MJPEG over datachannel
- [ESP32-S3](https://github.com/sepfy/libpeer/tree/main/examples/esp32s3): Push video and audio to media server
- [Raspberry Pi](https://github.com/sepfy/libpeer/tree/main/examples/raspberrypi): Video and two-way audio stream

2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project(examples)

add_subdirectory(sample)
add_subdirectory(generic)

28 changes: 13 additions & 15 deletions examples/esp32/README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,52 @@
# ESP32
Stream JPEG over WebRTC datachannel with ESP32.
This guide demonstrates how to stream JPEG images over a WebRTC data channel using ESP32 hardware.

## Support List

| Hardware ||
## Supported Devices
| Device |Image|
|---|---|
| [XIAO ESP32S3 Sense](https://wiki.seeedstudio.com/xiao_esp32s3_getting_started/) |<img src="https://files.seeedstudio.com/wiki/SeeedStudio-XIAO-ESP32S3/img/xiaoesp32s3sense.jpg" width="64">|
| [ESP32-EYE](https://github.com/espressif/esp-who/blob/master/docs/en/get-started/ESP-EYE_Getting_Started_Guide.md) |<img src="https://www.espressif.com/sites/default/files/esp-eye-2-190116.png" width="64">|
| [ESP32 M5Camera](https://github.com/m5stack/M5Stack-Camera) |<img src="https://static-cdn.m5stack.com/resource/docs/products/unit/m5camera/m5camera_01.webp" width="64">|
| [M5Camera](https://github.com/m5stack/M5Stack-Camera) |<img src="https://static-cdn.m5stack.com/resource/docs/products/unit/m5camera/m5camera_01.webp" width="64">|

## Instructions
## Setup Instructions

### Install esp-idf
at lease v5.2
### Install esp-idf (v5.2 or higher)
```bash
$ git clone -b v5.2.2 https://github.com/espressif/esp-idf.git
$ cd esp-idf
$ source install.sh
$ source export.sh
```

### Download
### Download Required Libraries
```bash
$ git clone --recursive https://github.com/sepfy/libpeer
$ cd libpeer/examples/esp32
$ git clone --recursive https://github.com/sepfy/esp_ports.git components/srtp
```

### Configure
### Configure Your Build
```bash
$ idf.py menuconfig
# Choose Example Connection Configuration and change the SSID and password
```

### Build
### Build the Project
```bash
$ idf.py build
```

### Test
### Flash and Test
```bash
$ idf.py flash
```
Check the serial port message:
Monitor the serial port output:
```
I (10813) Camera: Camera Task Started
I (10813) webrtc: peer_signaling_task started
I (10813) webrtc: peer_connection_task started
I (10823) webrtc: [APP] Free memory: 3882160 bytes
I (10823) webrtc: open https://sepfy.github.io/webrtc?deviceId=esp32-xxxxxxxxxxxx
```
Open the browser and visit the website showing by serial port message
Open your browser and navigate to the URL provided in the serial port output:
![image](https://github.com/sepfy/libpeer/assets/22016807/46df15b1-9e28-4a6b-bf0a-4f676778cf7d)

File renamed without changes.
2 changes: 1 addition & 1 deletion examples/sample/main.c → examples/generic/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ int main(int argc, char *argv[]) {
pthread_create(&peer_connection_thread, NULL, peer_connection_task, NULL);
pthread_create(&peer_singaling_thread, NULL, peer_singaling_task, NULL);

reader_init("./media/");
reader_init();

while (!g_interrupted) {

Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 496b669

Please sign in to comment.