Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

fludar/p2p-videocall

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Peer2Peer Videocall App

A basic P2P app that streams video using raw UDP packets

Key FeaturesBuild InstructionsScreenshotCreditsWhat did I learn?License

🧮 Key Features

  • 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

📦 Dependencies

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

🛠 Build Instructions

  1. Install CMake.
  2. 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
  1. 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

📸 Screenshot

screenshot

Here I used OBS for a virtual webcam since I didn't have a webcam at the momment.

🙏 Credits

  • 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

📖 What did I learn?

  • 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

📄 License

This project is licensed under the MIT License – see the LICENSE file for details.

About

P2P Videocall app

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published