Heavily inspired by:
- Armin Hinterwirth (https://github.com/amphioxus) - https://www.amphioxus.org/content/timelapse-time-stamp-overlay
timelapse.py
is the main script
video_stitcher.py
timestamper.py
- ffmpeg (usually comes with Pi OS)
- Pillow (aka PIL, also should ship with Pi)
- /usr/share/fonts/truetype/freefont/FreeMono.ttf
- Initial Images will be outputted to
imgXXXXXX.jpg
inside theoutput
folder - Next, timestamps are drawn onto the images, they're stored as
imgXXXXXX-resized.jpg
- Finally the
imgXXXXXX-resized.jpg
images are stitched into a video insideoutput/video
folder astimelapse_YYYY-MM-DD_HHmmSS.mp4
- Modify
main()
insidetimelapse.py
to use what you need
python3 timelapse.py [length in seconds] [interval in seconds] [directory to output]
python3 timelapse.py 3600 60 /home/pi/Camera
python3 timelapse.py 28800 3600 /home/pi/Camera
python3 timelapse.py 60 1 /home/pi/Camera
An additional OPTIONAL 4th command line argument has been added for rotation, it behaves as per this.
Options are 0, 90, 180, and 270
python3 timelapse.py 60 1 /home/pi/Camera 270
- Run as cronjob for 1 minute with 1 second intervals
- Output images and video to /home/pi/Camera
- Run at 4AM every morning
- Output the Logs to a file inside my Camera folder
crontab -e
0 4 * * * python3 /home/pi/Camera/timelapse.py 60 1 /home/pi/Camera >> /home/pi/Camera/output.log 2>$