Solution - Date/Time on timelapse


#1

Is it possible to get the Time & Date on the time lapse snapshots? I think it would entail running the snapshot through ffmpeg before saving which would add some load so probably not for every setup but an RP 3b+ should have no issue doing this in real time or with a small change to the ffmpeg process that generates the mpg file we could use the date/time the files was written to get the time and add it to the rendered video.

Jerry


#2

Octolapse can add a custom text overlay to your timelapse, including the current date and time. The text overlay is added by adding the text to every frame in a post processing step right before rendering, so ffmpeg isn't involved.

It requires that you manually install fontconfig if you're running OctoPi. You'll have to disable the XY axis stabilization if you want an OctoPrint style timelapse.

FYI this was a user added feature (thanks again Shadowen!), and is really nifty! Currently it only supports a small number of replacement tokens, but if you think of some additional ones that would be useful let me know please!


#3

Thank you,

I have octolapse installed and working but I do not want to move the head out of the way, I simply want the date/time on the frame, unneeded movement of the head simply extends the print time, increases retraction and re priming as well as layer alignment issue probability. 3d printing is already time consuming enough. OctoPrint + ffmpeg in itself could add the timestamp so easily by using the time stamp or file name sans any plugins. Octolapse is a great plugin however it takes a simple matter to an extreme for my purposes, I'm probably not the norm though.

Video https://www.youtube.com/watch?v=iQDm8dSKYxw&feature=youtu.be


#4

Yes, that's why I suggested that you disable the stabilization. You can also disable zhop and retract (quality settings inside snapshot profile), turn the camera delay (camera profile settings) to 0 and it will only pause for long enough to grab an image from the stream. You probably won't even notice it.


#5

Ah ha! So many settings, I found the place to remove the pause/animation......

Thank you I should have read your post much more carefully..........


#6

No problem! Just so you know, I'm working on simplifying things. In the process of adding a few different setup types - Automatic, Basic and Advanced. What is there now will be advanced, pretty much. Basic will hide a bunch of stuff that doesn't really need to be messed with much. Automatic will hide even more, and extract most things Octolapse needs directly from your gcode files (if you are using Slic3r or Simplify. Cura won't play ball and put the settings in the gcode. Somebody will need to write a plugin to make it work, probably me).

Let me know how it goes!


#7

Are there any head movements invoked by octolapse if I disable x/y i stabilization? I "think" I still see a z axis raise/lower or filament retract or something cause a movement hickup happening every snapshot?


#8

Complete remake of this to internalize it into OctoPrint.

** Define an event in ~/.octoprint/config.yaml
example:
events:
enabled: true
subscriptions:

  • command: ~/timestamp_timelapse.py "{file}"
    enabled: true
    event: CaptureDone
    type: system

** Make sure you have fonts (apt-get install fontconfig fonts-dejavu-core)

** Contents of timestamp_timelapse.py

#!/home/pi/oprint/bin/python
from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw
import os
import sys
import datetime
now = datetime.datetime.now()
MyStamp = now.strftime("%Y-%m-%d %H:%M:%S")
MyImage = sys.argv[1]
font = ImageFont.truetype("/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf", 24)
fontcolor = (66,134,244)
img = Image.open(MyImage)
draw = ImageDraw.Draw(img)
draw.text((10,680), MyStamp, fontcolor, font=font)
img.save(MyImage, format='JPEG', quality=100)