how to place video background or video background in pyqt5? (python3.6)

0
import sys
from PyQt5.QtWidgets import QApplication, QMainWindow,QDialog
from PyQt5.QtGui import QPalette, QBrush, QPixmap,QImage
from PyQt5 import uic
import PIL
from PIL import *
from PIL import ImageQt
import imageio
import time
video_name = "C:/Users/quico/Desktop/stri/striming/resursos/videos/video3.mp4" #This is your video file path
video = imageio.get_reader(video_name)
def bucle():
    while True:
        stream()
def stream():
    for image in video.iter_data():
        im=Image.fromarray(image)
        img=im.resize((600,400), Image.ANTIALIAS)
        pal=ImageQt.ImageQt(img)
        pal2=QImage(pal)
        rex=QPixmap.fromImage(pal2)
        w=QDialog()

#Clase heredada de QMainWindow (Constructor de ventanas)
class Ventana(QDialog):

 #Método constructor de la clase
     def __init__(self):
  #Iniciar el objeto QMainWindow
         QDialog.__init__(self)
  #Cargar la configuración del archivo .ui en el objeto
         uic.loadUi("diseño1.ui", self)
         self.setWindowTitle("Cambiando el título de la ventana")


#Instancia para iniciar una aplicación
app = QApplication(sys.argv)
#Crear un objeto de la clase
_ventana = Ventana()
bucle()
#Mostra la ventana
_ventana.show()
#Ejecutar la aplicación
app.exec_()

hello good I am doing an application with the environment qt and Python I am occupying as an environment of development of the graphical interface the qt designer but I found the inconvenience that I can not place a video as a wallpaper, because I want to place a video because this video has an animation in between and it has ben to the graphic interface

It occurred to me to decompose the video into images and place them in sequence as wallpaper to the qt but the program stuck and does not work if someone can help me please

here is the design you make

    
asked by blancos38 12.01.2018 в 04:49
source

0 answers