How to do a star trails timelapse

For a school project my daughter is involved in, we’re asked to “show that the stars move in the sky” in a video. It’s easy to make a timelapse and see the stars moving across the sky in the video. It’s also easy to do a still photo with star trails, by stacking each individual shot.

But I’d like to try a composite of both, in which the video starts with pin point stars, and the star trails are added gradually.

I saw a reference on the internet about ImageMagick and the use of “-compose lighten” to get incrementally blended images, but my scripting skills are not good enough.

I’m sure some IM/script guru here can give me some tips!

Here’s a version of the still image with the star trails. I wanted to take advantage of being in Venice for vacations, and having access to a rooftop balcony with a view on San Marco. Indeed, it’s from the top of the San Marco campanile that Galileo made a demonstration of his astronomical telescope, made with Murano glass lenses. Using his telescope, Galileo made a number of observations on the movement of astronomical bodies, which led him to support Copernic’s idea that that the earth is not the center of the universe, and that it probably revolves around the sun, as well other planets. I thought it would make a nice educational video!

I did this using StarStax and Shotcut.

Just do a ‘normal’ stack in StarStax, but tell it to save the intermediary frames and then take those frames in Shotcut (or any other video editor) and make your timelapse.

2 Likes

For a school project … “show that the stars move in the sky” …

Either this is a trick question, or the teacher is not familiar with the works of

Have fun!
Claes in Lund, Sweden

1 Like

Here is a movie, which demonstrates, that the earth is rotating and the stars are fixed :slight_smile:

Hermann-Josef

4 Likes

Are you joking?!? How can a disc rotate?!? :stuck_out_tongue:

4 Likes

That is explained below (see Seasons):
https://wiki.lspace.org/mediawiki/Discworld_calendar

Have fun!
Claes in Lund, Sweden

1 Like

This is a small project for a 10 years old child. When I saw that the teacher asked to show that stars move in the sky, of course I thought about the whole story (Galileo, and some others before him).
But in fact, just fixing the stars and seeing the earth rotate doesn’t give a proof that the earth rotates. It’s just changing the referential. You need to examine the differential movements of the other planets to see that their trajectories are not simple circles. And I think that one of the main observations of Galileo in this regard, is the observation of the Venus phases, which could not be explained easily by the planet revolving around the earth, and that it had to revolve around the sun instead.

1 Like

Ok, I found a regular star trails script on the web, and adding a line to save a copy of the file at each step gives me what I want:

#!/bin/bash

cp $(find . -name "*.jpg" -print -quit) ./tmp/base.jpg

for f in *.jpg; do
  [ -e "$f" ] || continue
  echo $f
  convert ./tmp/base.jpg $f -compose lighten -composite ./tmp/base.jpg
  cp ./tmp/base.jpg ./tmp/Composite-$f
done

rm ./tmp/base.jpg

Edit: added the commands to detect the first image in the series, and to delete the “base.jpg” image.

And the resulting video made in Kdenlive:

3 Likes

Wow that is exxcellenté! Nice job the both of you.

Here’s the starlapses ive done… with their generating commands.

cp capture000000.jpg out000000.jpg ; prev=0 ; previous=0 ; counter=1 ; current=1 ; until [ $counter -gt 309 ] ; do current=$(echo 0000000$counter|tail -c 7) && prev=$((counter-1)) && previous=$(echo 0000000$prev|tail -c 7) && previous=$(echo 0000000$prev|tail -c 7) && gmic capture$(echo $current).jpg out$(echo $previous).jpg blend lighten -o out$(echo $current).jpg && ((counter++)) ; done && ffmpeg -framerate 48 -i out%06d.jpg -vcodec libx264 -s 1280x720 -preset slow -crf 5 -pix_fmt yuv420p ~/Desktop/startrails1d.mkv

ffmpeg -i ~/Desktop/timelapses/timeclouds2b.mkv -i ~/Desktop/timelapses/timeclouds3c.mkv -an -filter_complex "[0:v]trim=start=0:end=4,setpts=PTS-STARTPTS[firstclip];[1:v]trim=start=3:end=17,setpts=PTS-STARTPTS[secondclip];[0:v]trim=start=4:end=6,setpts=PTS-STARTPTS[fadeoutsrc]; [1:v]trim=start=0:end=3,setpts=PTS-STARTPTS[fadeinsrc]; [fadeinsrc]format=pix_fmts=yuva420p, fade=t=in:st=0:d=1:alpha=1[fadein]; [fadeoutsrc]format=pix_fmts=yuva420p, fade=t=out:st=0:d=1:alpha=1[fadeout]; [fadein]fifo[fadeinfifo]; [fadeout]fifo[fadeoutfifo]; [fadeoutfifo][fadeinfifo]overlay[crossfade]; [firstclip][crossfade][secondclip]concat=n=3[output]" -map "[output]" -crf 5 ~/Desktop/timelapses/timeclouds2b3c.mkv

2 Likes

I wrote a lousy batch script for windows cmd (and I added commands to autodetect the first file name):

@echo off

for %%F in (*.jpg) do (
 set firstfile=%%F
 goto first
)

:first
echo "%firstfile%"

mkdir tmp

copy %firstfile% tmp\base.jpg

for %%f in (*.jpg) do (
  @echo %%f
  convert tmp\base.jpg %%f -compose lighten -composite tmp\base.jpg
  copy tmp\base.jpg tmp\Composite-%%f
)

del tmp\base.jpg && del firstfile

I would suggest taking a look at MoviePy, User Guide — MoviePy 1.0.2 documentation, which is a python library to hide the complexity of using FFMPEG. With it and a couple of minutes in GIMP you could:

  1. Create a horizon mask so as to avoid over exposing the buildings
  2. Have a number of seconds of the first frame, (possibly with a title overlay for some of it).
  3. Then have a growing stack of frames combine until you get the desired length of trail. Possibly modifying the colour &/or brightness of the stars from the “older” images in each frame.
  4. Continue with the stack size combined into a frame until you run out of frames.

MoviePy is of course cross platform & free/open source.

1 Like