I wanted to create a time lapse of a 3D print however I wasn’t sure the best way to do this. I’ve made time lapses using octoprint before, but for that to work, octoprint needed to be the machine driving the printer. I tend to prefer running my Ultimaker from the SD card as I’ve forgotten what all my previous octoprint settings were to get it running as smoothly as the Cura settings from the card. I also wanted to work on a more generic way to create a time lapse.
I decided to setup a MotionEyeOS system to generate photos 24/7 from a raspberry pi camera mounted in my printer. It may not be the highest pixel count, but I have it available to use. I configured the camera to the minimum framerate in MotionEye, 2 FPS, and told it to generate images of all frames at 100% quality.
Using this, I generated all the pictures, searched through the archive to find the start and end times (probably better to make notes of that when they happen rather than searching afterwards), and copied them to a folder I could create the time lapse from.
I decided to use FFMPEG to generate the time lapse since its open source and I already have it installed on my machine. I ended up using the command below to generate it from my folder of photos.
ffmpeg -r 30 -pattern_type glob -i "*.jpg" -s 1920x1080 -vcodec libx264 output.mp4
The parameters are below:
-r30″: the framerate (fps), increasing this will reduce the timelapse playtime
- “-pattern_type glob”: to allow for selecting all JPGs using “*.jpg”
- “-s 1920×1080”: downscales the images to an HD format
- “-vcodec libx264”: force to use the x264 codec
This ended up being a pretty easy way to create a time lapse that’s generic to any use case. All it requires is a raspberry pi, camera, and ffmpeg.