Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a screen recorder in python?

Tags:

python

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")

1 Answers

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/

like image 151
Jason Avatar answered Nov 29 '25 19:11

Jason



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!