如何在canvas Tkinter中显示VideoFileClip

时间:2017-06-03 18:29:32

标签: python video canvas tkinter moviepy

我想在画布中显示视频,而不是在新窗口中打开。 我想知道如何停止和暂停视频。

import pygame
from Tkinter import *
def movie():
    from moviepy.editor import *
    pygame.display.set_caption('Hello World!')
    clip = VideoFileClip('1.mp4')
    clip.preview()    
    pygame.quit()
root = Tk()
root.title("AVATAR")
label = Label(root, fg="dark green")
label.pack()
frame = Frame(root,background='red')
frame.pack()
canvas = Canvas(height=200,width=200)
canvas.pack()
conversationbutton = Button(frame, text='play in canvas',width=25,fg="green", command=movie)
conversationbutton.pack(side = RIGHT)
stopb=Button(root, text="stop").pack()

由于

0 个答案:

没有答案