Reputation:
Is it possible to create a screen recorder in python, I found a way to capture still images, can I compile these images into a video format? Is there anything framework I can use? thank you for any suggestions, here is the script for single images:
from PIL import ImageGrab
import time
time.sleep(5)
ImageGrab.grab().save("screen_capture.jpg", "JPEG")
Upvotes: 3
Views: 8663
Reputation: 13964
Yes, you can compile them to video format. FFMPEG is a phenomenal command-line tool that can be run from inside python provided it is installed and on your path.
Here is a great tutorial on how to take still images and turn them into a video: http://hamelot.io/visualization/using-ffmpeg-to-convert-a-set-of-images-into-a-video/
Upvotes: 3