This repository contains my test code for connecting an C++ WebRTC client to an python WebRTC server.
- Python 3.11
- Conda
- CMake
- Build Essentials (for Linux)
nlohmann_json
- LibDataChannel
OpenCV
FFmpeg
-
Set up a Python environment and install dependencies:
conda create -n webrtc_test python=3.11 conda activate webrtc_test pip install -r requirements.txt
-
Start the Python WebRTC server:
python3 webrtc_server.py
-
Verify WebRTC functionality by opening
index.html
in a browser and ensuring the JavaScript example runs without issues. -
Close the browser and restart the WebRTC server:
python3 webrtc_server.py
-
Install the Libdatachannels library: Follow the instructions from the LibDataChannel GitHub repository to install LibDataChannel.
-
Install C++ Dependencies:
sudo apt-get install nlohmann-json3-dev sudo apt-get install libopencv-dev sudo apt-get install libavcodec-dev libavformat-dev libavutil-dev libswscale-dev sudo apt install build-essential
-
Compile the C++ client by installing the required build tools and using CMake:
cmake . cmake --build .
-
Run the C++ client:
./webrtc-client
-
Observe that C++ client communication is broken: Despite data being sent, the
recv
method ofMediaStreamTrack
is never triggered.