Key Features • Build Instructions • Screenshot • Credits • What did I learn? • License
- Captures webcam frames and encodes them to JPEG
- Transmits video frames using UDP sockets
- Decodes incoming frames and displays them in real time
- Peer-to-peer connection without a central server
This project uses vcpkg for dependency management.
Required libraries:
- OpenCV – webcam capture & video rendering
- PortAudio – audio capture/playback
- Opus – audio compression codec
- [Winsock2 / BSD sockets] – UDP networking
- Install CMake.
- Install vcpkg and integrate it with CMake:
git clone https://github.com/microsoft/vcpkg cd vcpkg bootstrap-vcpkg.bat # Windows ./bootstrap-vcpkg.sh # Linux
Then install dependencies:
vcpkg install opencv portaudio opus
- Clone this repo and build:
git clone https://github.com/fludar/p2p-video-call
cd p2p-video-call
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake --build build
Here I used OBS for a virtual webcam since I didn't have a webcam at the momment.
- OpenCV – for video capture, JPEG encoding/decoding, and display
- PortAudio – for cross-platform audio input/output
- Opus – for real-time audio compression and decompression
- Winsock2 – for UDP networking on Windows
- BSD sockets – for networking on Linux/macOS
- vcpkg – for dependency management and easy CMake integration
- Basics of capturing and encoding video frames using OpenCV
- Sending and receiving raw UDP packets
- Simple audio capture and playback with PortAudio and Opus
- Multi-threading and synchronization with mutexes and atomic flags
- Handling low-level networking and socket programming in C++
- Error handling and resource management in multimedia applications
This project is licensed under the MIT License – see the LICENSE file for details.