How to resize Moviepy to fullscreen?

大兔子大兔子 提交于 2019-12-01 03:32:08

问题


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)

回答1:


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.



来源:https://stackoverflow.com/questions/49941881/how-to-resize-moviepy-to-fullscreen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!