Use Tkinter to create GUI development tools (35) Video playback components in Tkinter

In the previous article, we introduced using the OpenCV component to play MP4 files in Tkinter, but the OpenCV component does not support audio and can only watch silent video.
In this article, we introduce the video playback component HP_mplay in Tkinter. This is also a sub-module under HP_tk2. This module can be implemented to play network video or network music in Tkinter, and it is also possible to play local video.
The demo program code is given below.

import  tkinter  as  tk   #导入Tkinter
import HP_mplay as hmv

root=tk.Tk()
root.title('Tkinter中的有声视频播放演示') 
root.geometry('{}x{}+{}+{}'.format(800, 600, 100, 200))
mv2= hmv.playFrame(root,file='.\\temp\\01.mp4')
mv2.create_control_view()
mv2.pack(expand = 1, fill = tk.BOTH)

root.mainloop()

The results of running the program are given below.
Insert picture description here

Guess you like

Origin blog.csdn.net/hepu8/article/details/106323691