[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] Rendering a movie from a hidden surface to the main display
- To: pygame-users@xxxxxxxx
- Subject: [pygame] Rendering a movie from a hidden surface to the main display
- From: alex <latengoyo@xxxxxxxxxx>
- Date: Tue, 21 Mar 2006 21:16:50 +0100
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Tue, 21 Mar 2006 15:17:01 -0500
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
- User-agent: Mozilla Thunderbird 1.5 (X11/20051201)
I want to overlay images and text over videos. I'm currently using the movie object.
I've seen in the documentation that this can be accomplished creating a hidden surface which pays the movie, and rendering its contents as images in the display surface.
I'm getting segmentation faults when i try to play the movie.
Traceback (most recent call last):
File "pimplayer.py", line 73, in ?
if __name__ == '__main__': main()
File "pimplayer.py", line 60, in main
pimmovie.play()
File "/home/alex/documents/programming/pimplayer/pimobjects/PimMovie.py", line 84, in play
self.screen.blit(self.surface,(0,0))
pygame.error: display Surface quit
Fatal Python error: (pygame parachute) Segmentation Fault
This is the code for the method play():
def play (self):
self.surface=pygame.Surface(self.size)
self.movie.set_display(self.surface)
self.movie.play(self.repeat)
while self.movie.get_busy():
self.screen.blit(self.surface,(0,0))
pygame.display.update()
time.sleep(0.1)
I've had no problem playing the movie on the display surface. But i can't seem to be able to render the movie from another surface.
BTW is there any way to obtain the value from the movie's frame rate? i think i should set the time.sleep to a value according to the movie's frame rate.
Thanks for your help.
alex.