我想玩幾個視頻。 並得到了錯誤:pygame玩很多電影
python2.6: ../../src/xcb_io.c:183: process_responses: Assertion `!(req && current_request && !(((long) (req->sequence) - (long) (current_request)) <= 0))' failed.
我覺得在某些線程錯誤,和pygame的電影播放器。
在上pygame的文件中寫道:
The video overlay planes are drawn on top of everything in the display window. To draw the movie as normal graphics into the display window, create an offscreen Surface and set that as the movie target. Then once per frame blit that surface to the screen
能給我舉例如人?
pygame.init()
screen = pygame.display.set_mode((1024, 768))
background = pygame.Surface((1024, 768))
screen.blit(background, (0, 0))
pygame.display.update()
movie = pygame.movie.Movie('media/video.mpg')
mrect = pygame.Rect(0,0,140,113)
movie.set_display(screen, mrect.move(65, 150))
movie.set_volume(0)
movie.play()
mrect2 = pygame.Rect(0,0,140,113)
movie2 = pygame.movie.Movie('media/video2.mpg')
movie2.set_display(screen, mrect2.move(350, 150))
movie2.set_volume(0)
movie2.play()
您的代碼目前爲止還不錯。你正在使用哪種操作系統,pygame和libxcb版本? – sloth
Ubuntu 10.10,pygame最新版本。此主題可能會被關閉。 – Anshik