我想通过在while循环中一个接一个地“粘贴”它的帧来显示一个使用pygame的视频(一次迭代一帧)。大概是这样的:
import pims
import pygame
pygame.init()
gameDisplay = pygame.display.set_mode((500,800))
clock = pygame.time.Clock()
v = pims.Video('somevideo.avi')
run = True
while run:
# ... (here goes more code)
gameDisplay.blit(v[k], (0,0)) # This function should show the kth video frame
k = k + 1
# ... (here goes more code)
我尝试过此代码的不同变体,但无法使其正常工作
多谢各位
目前没有回答
相关问题 更多 >
编程相关推荐