简体   繁体   English

如何将Moviepy调整为全屏大小?

[英]How to resize Moviepy to fullscreen?

I am making a game using pygame and I wanted to add cut scenes to it. 我正在使用pygame制作游戏,我想为其添加剪切场景。 The pygame movie module however doesn't work anymore so I had to resort to using moviepy. pygame电影模块不再起作用,所以我不得不诉诸于moviepy。 Moviepy isn't that well documented from what I can see so I'm having some trouble figuring it out. 从我所看到的内容来看,Moviepy的记录不充分,所以我很难弄清楚。 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). 我使用此代码块使它正常工作,但现在我需要全屏显示(所需的窗口屏幕为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)

As of moviepy version 0.2.3.4, you can call clip.preview(fullscreen=True) to make your preview fullscreen. 从moviepy版本0.2.3.4开始,您可以调用clip.preview(fullscreen=True)使预览全屏显示。 Press Esc or the quit button to quit. Esc或退出按钮退出。 See the pull request for further info. 有关更多信息,请参阅请求请求

Run pip install moviepy --upgrade to update moviepy to the latest version. 运行pip install moviepy --upgrade更新到最新版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM