I want to make a single GUI with button, and displaying the video inside the same window when i click this button. In my code bellow, there is a window of tkinter appeared with the button, and when I click that button, it display a video capture in (another window), I want this captured video appeared in the same window that contains the button. can anyone please help me to edit this code with all my thanks.
import cv2
import tkinter as tk
def cap_vid():
vid = cv2.VideoCapture(0)
while (True):
ret, frame = vid.read()
cv2.imshow('frame', frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
root = tk.Tk()
video_label = tk.Label()
video_label.pack(expand=True, fill="both")
my_button = tk.Button(text="Click Me", command=cap_vid)
my_button.pack()
root.mainloop()