This repository contains a server-client program for video streaming using the aiortc library. The server generates continuous 2D images of a bouncing ball and transmits them to the client, which displays the images using OpenCV. The client performs ball tracking on the received frames and sends the computed ball coordinates back to the server.
- Python 3.10 or higher
- aiortc library
- OpenCV library
To run the server, follow these steps:
-
Open a terminal and navigate to the repository's directory.
-
Run the server program:
python server.py
-
The server will start generating the bouncing ball animation and transmitting the frames to the client.
-
On the server sider terminal, user can see message (coordinates and error) sent by client
To run the client, follow these steps:
-
Open a new terminal and navigate to the repository's directory.
-
Run the client program:
python3 client.py
-
The client will receive the offer from the server and display the received frames using OpenCV. It will also start a separate process for ball tracking.
-
The client process will track the ball in the frames using OpenCV's Hough Circle Transform and store the computed x, y coordinates.
-
The client will open an aiortc data channel to the server and send the ball coordinates to the server.
-
The server will receive the coordinates from the client and compute the error to the actual location of the ball.
-
The server will display the received coordinates and the calculated error.
-
Server IP Address: 127.0.0.1
-
Server Port: 8000