This application replicates a streaming platform like Twitch. It provides a chat server, a video streaming server, and a screen sharing server. The chat server allows multiple clients to join a chatroom, exchange messages, and perform administrative tasks like kicking users and promoting users to admins. The video streaming server captures frames from a webcam and streams them to connected clients, while the screen sharing server captures the screen and streams it to connected clients.
- Broadcast messages: Broadcasts messages to all connected clients.
- Private messages: Send private messages to specific users -
/private <nickname> message
- Admin commands:
/kick <nickname>
: Kick a user from the chat (admin only)./addadmin <nickname>
: Promote a user to admin (admin only)./listusers
: List all connected users./listadmins
: List all admin users (admin only).
- Webcam streaming: Captures frames from the webcam and streams them to connected clients.
- Frame rate control: Configurable frame rate for streaming.
- Screen capture: Captures the screen and streams it to connected clients.
- Frame rate control: Configurable frame rate for streaming.
- Python 3.11.5
opencv-python
pyautogui
-
Clone the repository:
git clone https://github.com/mainakm7/streaming_platform_app.git
-
Install the required packages:
pip install opencv-python pyautogui pillow
-
Run the chat server:
python server_chat.py
This will start the chat server.
-
Run the video distribution server:
python stream_video_distribution.py
This will start the video distribution server.
-
Run the screen share distribution server:
python stream_screenshare_distribution.py
This will start the screen share distribution server.
-
Run the video host:
python stream_video_host.py
This will start the video host and stream webcam data to the video distribution server.
-
Run the screen share host:
python stream_screenshare_host.py
This will start the screen share host and stream screen data to the screen share distribution server.
-
Connect to the chat server: Make sure to update the server HOST IP properly.
- After connecting, enter a nickname when prompted.
-
Connect to the video streaming server and screen sharing server: Use a client script to connect to the video streaming server and the screen sharing server to display the streamed video and screen.
server_chat.py
: Contains the chat server implementation.stream_video_distribution.py
: Contains the video distribution server implementation.stream_screenshare_distribution.py
: Contains the screen share distribution server implementation.
stream_video_host.py
: Main script to run the video host.stream_screenshare_host.py
: Main script to run the screen share host.
client_gui.py
: Main script to run the client-side script.
Feel free to submit issues or pull requests if you have suggestions or improvements. Please ensure any changes are well-documented and tested.
This project is licensed under the MIT License. See the LICENSE file for details.
- Python's
socket
module for providing the core functionality. opencv-python
for video capture and processing.pyautogui
for screen capture.tkinter
for the graphical user interface.- Inspiration from various network programming resources.