Problems with tkinter , video opencv and multiprocessing in python -
i have problem creating 2 processing. want create new opencv process when open new video file via button tkinter gui, how separate these processes.
import cv2 import numpy np multiprocessing import queue,process tkinter import * tkinter import filedialog video import * class app: def ter(self): self.video = video(self.filename) start(self.video) def open_file(self): self.filename = filedialog.askopenfilename(filetypes=(("video", "*.avi;*.mp3;*.mov") , ("all files", "*.*"))) self.q = queue() if not self.filename none: p = process(target = self.ter) p.start() p.join() def get_filename(self): self.q.put(self.filename) def __init__(self,top): b = button(top, bg="red", width=20, height=3, text="открыть файл", command=self.open_file, font="arial 12") b.pack(side = bottom) self.filename = '' def started(): root = tk() app1 = app(root) root.mainloop() if __name__ == '__main__': q = queue() p = process(target = started) p.start() p.join() so, how create new process when try open new video.
Comments
Post a Comment