Python Forum
The solution is probably simple, but I'm stuck, as an amateur is
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The solution is probably simple, but I'm stuck, as an amateur is
#1
A simple script to play a movie:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import pygame
import moviepy.editor
 
pygame.init()
screen = pygame.display.set_mode((1000,500))
 
clock=pygame.time.Clock()
pygame.time.set_timer(pygame.USEREVENT, 5)
 
running = True
while running:
 
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
        if event.type == pygame.MOUSEBUTTONDOWN:
            if event.button == 1:
                print('You left clicked')
 
        # video
        film = "Lacuna.avi"
        video = moviepy.editor.VideoFileClip(film)
        video.preview()
The problem is that no action is possible (e.g. a mouse click) until the video is over.
How to perform any action during the video playback.

Best regards.
Wookie
Reply
#2
What do you want to do with moviepy? It is a tool for making/editing movies. It is not a good choice for watching video clips.
Reply
#3
(Nov-13-2024, 06:34 PM)deanhystad Wrote: What do you want to do with moviepy? It is a tool for making/editing movies. It is not a good choice for watching video clips.

I began to realize this... :) And what is best for video playback?
Reply
#4
Quick Google search suggests. OpenCV, though I do not have experience with this.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Simple mutli-threaded scheduler using sched - stuck Mzarour 2 7,372 Nov-12-2019, 07:44 PM
Last Post: Mzarour

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020