Moviepy fullscreen

微笑、不失礼 提交于 2019-12-24 05:55:19

问题


I'm creating a simple pygame, and cannot find out how to make Moviepy preview clip in full screen. Using Moviepy for my opening cinematic. Here is my code:

import moviepy
import os
from moviepy.editor import *
import pygame

pygame.display.set_caption('Game title')

os.environ["SDL_VIDEO_CENTERED"] = "1"

clip = VideoFileClip('qq.mp4')

clip.preview()

execfile("startGame.py")

I'm not sure if this is the best practice in pygame to use for an opening full-screen cinematic...


回答1:


I changed in Python\Python36-32\Lib\site-packages\moviepy\video\io preview.py line 94

screen = pg.display.set_mode(clip.size)

to

screen = pg.display.set_mode(clip.size,pg.FULLSCREEN)

and resized the clip to be under my resolution (1280x800). Otherwise it throws an error.

import pygame
from moviepy.editor import VideoFileClip
pygame.init ()
clip = VideoFileClip('Intro.mpg')
clipresized = clip.resize (height=700)
clipresized.preview ()
game_loop()
pygame.quit ()
quit()

I use moviepy for the same reason as you do and my code looks very much like yours (this does not mean it is right). This is not the best way to do it and screws up the lib for other uses but it worked for me.



来源:https://stackoverflow.com/questions/42190332/moviepy-fullscreen

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