How can I capture and save a sequence of images or a video of a pygame screen? Basically I want to share my game video on youtube. Also, want to make a tutorial.
Use pygame.image.save on your screen surface:
pygame.image.save
window = pygame.display.set_mode(...) ... pygame.image.save(window, "screenshot.jpeg")
Note that this will slow down your program tremendously. If it is time-based, you may wish to fake the framerate when doing a capture.