Skip to content

Instantly share code, notes, and snippets.

@alifa98
Last active May 10, 2020 12:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alifa98/a0bb14ca863d3132c0cef10f1eeed027 to your computer and use it in GitHub Desktop.
Save alifa98/a0bb14ca863d3132c0cef10f1eeed027 to your computer and use it in GitHub Desktop.
TimeLapse

Make Time lapse from desktop

command to take 3600 screenshots wit 3s delay. (3 hours)

Save screens in pwd of terminal

for i in {1..3600}; do scrot -d 3 '%Y-%m-%d-%H:%M:%S.png' ; done

convert screenshots to video file

This command convert images in pwd/directory/ to full resolution video (FPS = 30):

ffmpeg -f image2 -pattern_type glob -i 'directory/*.png' -r 30 -c:v libx264 -pix_fmt yuv420p out.mp4

For scale the video in output (keep aspect ratio so that height is adjusted to fit) use this (width=480px):

ffmpeg -f image2 -pattern_type glob -i 'directory/*.png' -r 30 -vf scale=480:-2,setsar=1:1 -c:v libx264 -pix_fmt yuv420p out.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment