Octolapse is a cool little program to let you capture stabilized time lapses of your 3D print. It does this by moving the print head to a fixed position after each layer and captures an image.
This is a hacky way to improve your time-lapse quality by using a DSLR camera. The way it works is that it uses the MQTT extension of Octolapse and waits for the MQTT event: "octoprint/event/PositionUpdate". The script then uses gphoto2 to capture a image from a camera, which is connected to the Raspberry Pi via USB. The final time lapse is rendered on a PC. To keep Octolapse happy, a normal webcam is connected too.
A Raspberry Pi with Octoprint and Octolapse installed
A dummy webcam to keep Octolapse happy
A DSLR camera
Fixed power supply for your DSLR (Optional)
A big SD card for the Raspberry Pi
Install gphoto2 on the Raspberry Pi
sudo apt-get install gphoto2
Check if your DSLR camera can be connected over USB to the Raspberry Pi. You can try to take a test image:
gphoto2 --auto-detectModel Port----------------------------------------------------------Nikon DSC D3300 usb:001,016
gphoto2 --camera 'Nikon DSC D3300' --capture-image-and-download --filename '%Y%m%d%H%M%S.jpg'
Check if you can power your DSLR camera from an external supply. Long prints take a toll on your battery an it's quite tedious to wait for hours to change the battery and maby miss it. Also its hard to change the battery without moving the camera.
Install the MQTT extension for Octolapse
Configure it like seen in the images
Download the trigger script
Modify the main.py file to use your camera instead of Nikon DSC D3300:
os.system("gphoto2 --camera 'Nikon DSC D3300' --capture-image-and-download --filename '%Y%m%d%H%M%S.jpg'")
Install some libraries on the Raspberry Pi:
sudo apt-get install python-pipsudo pip install paho-mqttsudo apt-get install -y mosquitto mosquitto-clients
You will need a normal webcam running the time-lapse while your DSLR is taking photos.
Configure your Octolapse like when using a normal webcam. Go into the camera settings and increase the Snapshot Delay as necessary (I used 2 seconds).
Start the python script
To keep the script running when you are connected over ssh use nohup instead
nohup python main.py &
Start the print. Begin with a small test print to configure the Snapshot Delay of the camera. You want this to be as short as possible to reduce stringing artefacts in your print. Try to find some settings for your DSLR which take the shortest time to capture images (manual focus..).
When the print is finished copy the images to your computer and render the time-lapse. I use ffmpeg on Ubuntu to do this. This might work on the Raspberry too but could take some time.
ffmpeg -r 25 -pattern_type glob -i '*.jpg' -c:v copy output.aviffmpeg -i output.avi -c:v libvpx-vp9 -s 1920x1080 -crf 30 -b:v 0 -c:a libopus -b:a 96k output.webm