Zulko / moviepy

Video editing with Python
https://zulko.github.io/moviepy/
MIT License
12.09k stars 1.51k forks source link

How to Manage Moviepy Video Inside my PyGame Display? (x, y and sizing) #2065

Closed DouglasMartinEX closed 7 months ago

DouglasMartinEX commented 7 months ago

Hey, guys! I'm searching a lot but not finding the right answer: How can i manage a moviepy video? I have a 800x600 screen but and i want moviepy video smaller than that but my video always "takes" the display and go full size (the moviepy size, ignoring my screen).

pygame.init()

screen_width = 1000 screen_height = 800

screen = pygame.display.set_mode((screen_width, screen_height))

clip = VideoFileClip('vds/anime.mp4').resize((400, 260))

def videoplayer():
    while True:
        clip.preview()#.draw(SCREEN,(100,200))
        for event in pygame.event.get():
            if event.type == pygame.MOUSEBUTTONDOWN:
                clip.close()
                main_game()

I've stumbling in another problem too, the "clip.close" command not closes the video to go to main_game.