Ejemplo n.º 1
0
 def _show_video_thumbnail(self, path, widget):
     try:
         video = VideoFile(path)
         video.seek_to(20)
         timestamp, frame = video.get_next_frame()
         image = QtGui.QImage(frame.data, frame.width, frame.height, QtGui.QImage.Format_RGB888).scaledToWidth(widget.width())
         pixmap = QtGui.QPixmap.fromImage(image)
         widget.setPixmap(pixmap)
     except Exception as e:
         logger.error(e)
         return