screencap.py | Python

January 22nd, 2021 08:44:09 PM

					
""" Take screenshots at x interval - make a movie of doings on a computer. """ import time from datetime import datetime import ffmpeg import pyautogui while True: epoch_time = int(time.time()) today = datetime.now().strftime("%Y_%m_%d") filename = str(epoch_time) + ".png" print("taking screenshot: {0}".format(filename)) myScreenshot = pyautogui.screenshot() myScreenshot.save(today + "/" + filename) time.sleep(5) # # and then tie it together with: https://github.com/kkroening/ffmpeg-python/blob/master/examples/README.md#assemble-video-from-sequence-of-frames # """ import ffmpeg ( ffmpeg .input('./2021_01_22/*.png', pattern_type='glob', framerate=25) .filter('deflicker', mode='pm', size=10) .filter('scale', size='hd1080', force_original_aspect_ratio='increase') .output('movie.mp4', crf=20, preset='slower', movflags='faststart', pix_fmt='yuv420p') .run() ) """

Featured Posts