Python 3 Tkinter ZOOM Clone Video Chat Script GUI Desktop App Using PyAudio & OpenCV Library Full Project For Beginners

 

 

Welcome folks today in this blog post we will be building a zoom clone video chat in python using opencv and pyaudio library. All the full source code of the application is shown below.

 

 

 

# Get Started

 

 

 

In order to get started you need to make a requirements.txt file and copy paste the following contents

 

 

requirements.txt

 

 

appdirs==1.4.4
beautifulsoup4==4.9.3
black==21.6b0
certifi==2021.5.30
chardet==4.0.0
click==8.0.1
colorama==0.4.4
docopt==0.6.2
idna==2.10
Js2Py==0.71
MouseInfo==0.1.3
mypy-extensions==0.4.3
numpy==1.21.0
opencv-python==4.5.2.54
packaging==20.9
pathspec==0.8.1
pipwin==0.5.1
PyAudio 
PyAutoGUI==0.9.52
PyGetWindow==0.0.9
pyjsparser==2.7.1
PyMsgBox==1.0.9
pyparsing==2.4.7
pyperclip==1.8.2
PyPrind==2.11.3
PyRect==0.1.4
PyScreeze==0.1.27
pySmartDL==1.3.4
PyTweening==1.0.3
pytz==2021.1
regex==2021.4.4
requests==2.25.1
six==1.16.0
soupsieve==2.2.1
toml==0.10.2
tzlocal==2.1
urllib3==1.26.6
vidstream==0.0.14

 

 

 

And now you need to open command prompt and execute the below command

 

 

pip install -r requirements.txt

 

 

This will install all the packages or dependencies which are written inside the file

 

 

Now make a main.py file and copy paste the following code

 

 

main.py

 

 

from vidstream import (
    AudioSender,
    AudioReceiver,
    ScreenShareClient,
    CameraClient,
    StreamingServer,
)
import tkinter as tk
import socket
import threading

local_ip_address = socket.gehostbyname(socket.gethostname())

server = StreamingServer(local_ip_address, 7777)
receiver = StreamingServer(local_ip_address, 6666)


def start_listening():
    t1 = threading.Thread(target=server.start_server)
    t2 = threading.Thread(target=receiver.start_server)
    t1.start()
    t2.start()


def start_camera_stream():
    camera_client = CameraClient(text_target_ip.get(1.0, "end-1c"), 7777)
    t3 = threading.Thread(target=camera_client.start_stream)
    t3.start()


def start_screen_sharing():
    screen_client = ScreenShareClient(text_target_ip.get(1.0, "end-1c"))
    t4 = threading.Thread(target=screen_client.start_stream)


def start_audio_stream():
    audio_sender = AudioSender(text_target_ip.get(1.0, "end-1c"))
    t5 = threading.Thread(target=audio_sender.start_stream)
    t5.start()


# Gui part
window = tk.Tk()
window.title("PyMeet")
window.geometry("300x200")

label_target_ip = tk.Label(window, text="Target IP: ")
label_target_ip.pack()

text_target_ip = tk.Tk(window, height=1)
text_target_ip.pack()

btn_listen = tk.Button(
    window, text="Start Listening", width=50, command=start_listening
)
btn_listen.pack(anchor=tk.CENTER, expand=True)

btn_listen = tk.Button(
    window, text="Start Camera Stream", width=50, command=start_camera_stream
)
btn_listen.pack(anchor=tk.CENTER, expand=True)

btn_listen = tk.Button(
    window, text="Start Audio stream", width=50, command=start_screen_sharing
)
btn_listen.pack(anchor=tk.CENTER, expand=True)


window.mainloop()

 

 

Now run the above python script by typing the below command as shown below

 

 

python main.py

 

Leave a Reply