from Tkinter import *
from PIL import Image, ImageTk
import os
class App:
def __init__(self,master):
master.minsize(width=666, height=666)
master["bg"] = "black"
self.button = Button(text="Camera1",command=self.playvid)
self.button.pack(side= "top")
self.img = ImageTk.PhotoImage(Image.open("car.png"))
self.panel = Label(master, image=self.img)
self.panel.pack(side = "bottom", fill = "both", expand = "yes")
def playvid(self):
os.system("gst-launch-1.0 videotestsrc ! autovideosink")
root = Tk()
app = App(root)
root.mainloop()
root.destroy()
This is my code. If I press the s key, I want to stop the os.system
process that creates the gstreamer
window, i.e. if I press s then it should be equivalent to ctrl + c.
Also is it possible to play the video in tkinter itself?