Python视频错误?

时间:2019-01-28 20:11:24

标签: python pygame

我不明白为什么它没有运行,请有人帮我。

我已经下载了pygame库

import pygame

FPS = 60

pygame.init()
clock = pygame.time.Clock()
movie = pygame.movie.Movie("/Users/admin/Desktop/Starlite.mpg")
screen = pygame.display.set_mode(movie.get_size())
movie_screen = pygame.Surface(movie.get_size()).convert()

movie.set_display(movie_screen)
movie.play()


playing = True
while playing:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            movie.stop()
            playing = False

    screen.blit(movie_screen,(0,0))
    pygame.display.update()
    clock.tick(FPS)

pygame.quit()

这是我在终端中收到的错误消息。

Hello from the pygame community. https://www.pygame.org/contribute.html
2019-01-28 13:56:12.273 Python[44653:4791526] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to (null)
vidtest.py:7: RuntimeWarning: use movie: None
  movie = pygame.movie.Movie("/Users/admin/Desktop/Starlite.mpg")
Traceback (most recent call last):
  File "vidtest.py", line 7, in <module>
    movie = pygame.movie.Movie("/Users/admin/Desktop/Starlite.mpg")
  File "/Users/admin/Library/Python/3.7/lib/python/site-packages/pygame/__init__.py", line 108, in __getattr__
    raise NotImplementedError(MissingPygameModule)
NotImplementedError: movie module not available

0 个答案:

没有答案