A lightweight, real-time video chat system built using Python and socket programming. This project enables direct webcam-to-webcam streaming between two devices using simple Python scripts.
This application uses OpenCV and Python's socket library to establish a client-server connection for real-time video transmission. It’s perfect for learning the fundamentals of video streaming, networking, and multimedia communication in Python.
- Peer-to-peer streaming over sockets
- Real-time webcam feed using OpenCV
- Modular, easy-to-read code
- Works on LAN without heavy frameworks
- Cross-platform Python 3 support
.
├── client.py # Connects to server and displays received video
├── server.py # Captures webcam feed and sends it to client
├── videofeed.py # Frame capture & preprocessing
├── videosocket.py # Encoding, decoding & data transmission
├── requirements.txt # Python dependencies
└── README.md # Project documentation
Install the following Python packages:
opencv-python
numpyYou can install all at once using:
pip install -r requirements.txtpython server.pyThis will activate your webcam and begin sending video frames.
On another device (or terminal):
python client.pyEnsure the client connects to the correct IP address and port defined in the server.
Terminal Output Example (Client):
Connecting to server...
Receiving video stream...
Displaying feed...
Terminal Output Example (Server):
Camera started.
Sending frames to client...
Connection established.