This is a set of Python scripts that transmit emulated video frames from a server to a client via a Python socket. The client-side script receives the video frames, and the server-side script sends the video frames.
To run these scripts, you'll need:
- Python 3.x installed on your machine
- Basic knowledge of Python and networking concepts
- Access to a server and a client that can communicate with each other via a Python socket
- Clone this repository to your local machine.
- Open the
client.py
andserver.py
files in your favorite text editor or IDE. - Modify the
server_address
variable in theclient.py
file to match your server's IP address and port number. - Modify the IP address and port number in the
server_socket.bind()
function in theserver.py
file to match your server's IP address and port number. - Modify the
frame_sizes
variable in theserver.py
file to match the desired frame sizes for the video transmission. You can also create aframe_sizes.txt
file in the same directory as theserver.py
file and list the frame sizes in separate lines. - Save the modified files.
- Open a terminal window and navigate to the directory where the
server.py
file is stored. - Run the
server.py
file by typingpython server.py
in the terminal. - The server will start listening for incoming connections from a client.
- Once a connection is established, the server will start transmitting emulated video frames to the client.
- The server will print the size of each transmitted frame to the console.
- Open a terminal window and navigate to the directory where the
client.py
file is stored. - Run the
client.py
file by typingpython client.py
in the terminal. - The client will connect to the server and start receiving emulated video frames.
- Once a frame is received, the client will print the timestamp and frame size to the console.
If you find a bug or have an idea for a new feature, feel free to contribute to this project by submitting a pull request.
These scripts were inspired by the following resources:
- Python Socket Programming Tutorial by Real Python: https://realpython.com/python-sockets/