Video streaming through TCP socket (client/server application)
This algorithm written in python is showing how to transfer a video and sound data over a tcp socket connection.
You will need the following python libraries install on your system if you are trying to run the code from source.
1. socket # for creating socket object
2. threading # used for Subclassing code to run in parallel
3. pygame # for displaying the video on the server and client
4. lz4 # for compression
5. pyinstaller # to build executable files (pip install pyinstaller)
Start the client socket first; then start the server socket in a command prompt.
Your firewall/anti-virus may display a message in order to allow the socket to run on your system,
please allow the connection for both sockets.
ClientSocket -a 192.168.1.112 -p 16815
ServerSocket -a 192.168.1.112 -p 16815
Note : For this application to work, don’t forget to add the folder Assets in the same
directory as the currently running server socket application.
Tasks on the server side:
Tasks on the client side:
Note : To create an excutable file from the source code, do the following
pyinstaller --onefile ClientSocket.py
pyinstaller --onefile ServerSocket.py
You will find the executables in the <