Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resize Moviepy to fullscreen?

I am making a game using pygame and I wanted to add cut scenes to it. The pygame movie module however doesn’t work anymore so I had to resort to using moviepy. Moviepy isn’t that well documented from what I can see so I’m having some trouble figuring it out. I got it to work using this block of code but all I need now is to full screen it (desired window screen is 640x400). So how would I go about doing so? Thank you in advance.

from moviepy.editor import *
from pygame import *# Window display
WIN_WIDTH = 640
WIN_HEIGHT = 400
HALF_WIDTH = int(WIN_WIDTH / 2)
HALF_HEIGHT = int(WIN_HEIGHT / 2)
DISPLAY = (WIN_WIDTH, WIN_HEIGHT)
DEPTH = 32
FLAGS = FULLSCREEN

#display.set_mode(DISPLAY, FLAGS, DEPTH)  #define screen values
display.set_caption("I'm Working!")
Credits = 'Untitled.mp4'
def playVid(video):
    clip = VideoFileClip(video)
    clip.resize(DISPLAY).preview()
    return


playVid(Credits)
like image 318
Moe Avatar asked Apr 20 '18 12:04

Moe


1 Answers

As of moviepy version 0.2.3.4, you can call clip.preview(fullscreen=True) to make your preview fullscreen. Press Esc or the quit button to quit. See the pull request for further info.

Run pip install moviepy --upgrade to update moviepy to the latest version.

like image 195
Tom Burrows Avatar answered Sep 17 '22 11:09

Tom Burrows