mpeg problem with pygame
Fredrik Lundh
fredrik at pythonware.com
Wed Aug 27 10:50:12 EDT 2003
"AnsNum" wrote:
> when I start this program, the movie doesn't play smoothly, anybody has an
> idea ?
> (I use windowsXP)
>
> import pygame
> from pygame.display import flip
> from pygame.locals import *
>
> pygame.init()
> screen = pygame.display.set_mode((640,480))
> pygame.mixer.quit()
> movie = pygame.movie.Movie("d://pygame//video3.mpeg")
> movie.set_display(screen, (0,0))
> movie.play()
> movie.set_volume(1)
> flip()
> while 1:
> if not movie.get_busy():
> break
just guessing, but that busy loop might suck up more spare cycles
than you have. try inserting a short sleep:
while 1:
if not movie.get_busy():
break
time.sleep(0.1)
</F>
More information about the Python-list
mailing list