Enabling time lapse - Phil1988/FreeDi GitHub Wiki

What is this about?

In this will capture your prints and create time lapses. For this we need to install the Moonraker Time Lapse plugin and configure your slicer to trigger photo capture at each layer change, creating smooth time lapse videos of your prints.

[!NOTE] Before starting, make sure you have a working camera installed and configured in Mainsail.

Time required: ~15 minutes


Prerequisites

  • A running system without errors :)
  • Working camera with Crowsnest configured (see Installing a Camera)
  • SSH access to your printer
  • ffmpeg installed (pre-installed on FreeDi)

Installation

1. Install Moonraker Time Lapse

For detailed instructions, please have a look at the main project of Moonraker Time Lapse and leave a star at their github ;) Moonraker Time Lapse Installation Guide

In short: Connect to your printer via SSH and run the following commands:

cd ~/
git clone https://github.com/mainsail-crew/moonraker-timelapse.git
cd ~/moonraker-timelapse
make install

This will clone the repository and execute the installer script.

[!TIP] The installer will automatically restart Moonraker and klipper services.

2. Install ffmpeg if not already installed (only for custom OS users. FreeDi image users can skip this)

FreeDi has ffmpeg pre-installed. If you're using a custom OS, verify installation:

ffmpeg -version

If not installed, run:

sudo apt install ffmpeg

3. Enable Auto-Updates

To keep the time lapse plugin updated via Moonraker's update manager, add this to your moonraker.conf [page:1]:

# moonraker.conf

[update_manager timelapse]
type: git_repo
primary_branch: main
path: ~/moonraker-timelapse
origin: https://github.com/mainsail-crew/moonraker-timelapse.git
managed_services: klipper moonraker

Save the file and restart Moonraker in Mainsail.


Configuration

The latest guide is always on the origin repository: https://github.com/mainsail-crew/moonraker-timelapse/blob/main/docs/configuration.md

For convinience, the next sections will show the key steps what it does, by

  • Setting up the timelapse addon
  • Enabling the timelapse addon by adding it to the printer.cfg
  • Adding layer change G-code commands to your Slicer for time lapse

Basic Setup

  1. Open Mainsail and go to Machine
  2. Open the moonraker.conf file
  3. Add a basic time lapse configuration:
[timelapse]
output_path: ~/printer_data/timelapse/
frame_path: /tmp/timelapse/printer
  1. Save and restart Moonraker

Adding Time Lapse to your printer.cfg

  1. Open Mainsail and go to Machine
  2. Open the printer.cfg file
  3. Add the addon to your printer.cfg for being able to use it:

Insert this somwhere (recommended somewhere at the top at the includes): ***ini [include timelapse.cfg]


Click Save&Restart.

Slicer Configuration (Required!)

[!IMPORTANT] The time lapse plugin does NOT capture images automatically. You must configure your slicer to execute G-code commands at each layer change that trigger the camera.

To enable time lapse capture, you need to add specific G-code commands in your slicer settings. Without this slicer configuration, no images will be captured during prints.

Open your Slicer and find the Pritner setttings C-code section. You will see something like "Before layer change Gcode" (the exact word varies a bit from the slicer and release). Then add this to tell your printer to take a picture on each layer:

TIMELAPSE_TAKE_FRAME

Usage

Once installed and configured:

  1. Slice your model with the layer change G-code configured (see Slicer Setup)
  2. Start your print
  3. The plugin captures an image at each layer change when triggered by the G-code
  4. After the print completes, the video is automatically rendered
  5. Access your time lapse videos in Mainsail under the Time Lapse section

[!TIP] You can adjust frame rate, resolution, and other video settings in the Time Lapse section of Mainsail.


Advanced Configuration

For detailed configuration options, including:

  • Custom output paths
  • Video quality settings
  • Camera positioning
  • Multiple camera support

Refer to the Moonraker Time Lapse Configuration Guide.


Troubleshooting

No images are captured:

  • Most common issue: Layer change G-code not configured in slicer - see Slicer Setup
  • Verify camera is working in Mainsail
  • Check that TIMELAPSE_TAKE_FRAME macro exists in your Klipper config
  • Review moonraker.log for errors

Video rendering fails:

  • Ensure ffmpeg is installed: ffmpeg -version
  • Check available disk space: df -h
  • Review time lapse logs in Mainsail

Poor video quality:

  • Increase camera resolution in crowsnest.conf
  • Adjust video bitrate in time lapse settings
  • Ensure proper lighting on print bed

Next Steps

[!IMPORTANT] Required: Configure your slicer for time lapse capture: Slicer Setup

Learn more about advanced time lapse options: Moonraker Time Lapse Documentation


See Also:


Enjoy capturing your projects in beautiful time lapse! 🎬