Creating a timelapse image out of still images (windows 7/10 guide)


#1

Hey bifarmes,

im a bit late to the party, but this will be my first post to hopefully create some great original content and bring use to an awesome feature that this machine provides: timelapse videos.

I have some experience in doing that, and im currently updating my timelapse montages every friday on my instagram account: @homegrown_ger.

To create a timelapse video on your pc you have to go through several steps:

  1. Obtaining the pictures
    (1.1. renaming the pictures)
  2. use a program to sequence the images
  3. enjoy / share the goods.

Step 1: Get the images. I think Wanjun already setup a method to get the images. Either through the app downloaded to the phone or through the USB Ports. Either way is cool, but to have ssh access throgh an ftp program would be easier, since you spare a step to bring the files to the pc.

Step 1.1.: Renaming. I currently dont know in which format the filenames are given to the pictures taken by the aerokit. But if its not a sequence in a numerical ascending order it might be difficult to make the cutting software (ffmpeg) do its job. Here is a workaroung how to rename the pictures to 1.jpg, 2.jpg, 3.jpg given through a chronological order on a WindowsPC:
1.1.a) Open your editor.
b) type:

@echo off
setlocal EnableDelayedExpansion

set i=0
for %%a in (*.jpg) do (
set /a i+=1
ren “%%a” “!i!.new”
)
ren *.new *.jpg

c) save as “rename.bat” in the same folder as your images are.
This file is able to sequence any given order the aero kit provides. It might be optional though.
By checking the order of the renamed files you can verify the correct order. (the intervals of 1/30 is okay, i use 1/20min in flower and 1/30 in veg so i get the same number of pics per day)

d) Only do that if you know, that your images are in some kind of backup! (still on the aeokit-storage or on your phone)
Double click the rename.bat file. The images should now be renamed in an easy order and in place for squencing.

Step 2.: Use software to sequence the images to a video file.

If you own adobe premiere you can just import the images to an existing project file. Just navigate to your folder after chosing the option “import” and click on the file named “1.jpg” and check the option “sequenced images” to get a nested video line to your project.

if you dont own adobe premiere, id recommend to use the open source software ffmpeg.
ffmpeg is my way to sequence images since its pretty easy to use and doesnt need an expensive software with features i dont know/need to sequence the files. Basically all timelapses i create are unedited files made by that software.
In the beginning you need the software. It has a special type of usability since you can only access it by the MSDos prompt in Windows.

If you dont know how to do it, just take this guide (windows 7) or this guide (windows 10).

a) If you have ffmpeg available on your windows-system the first step is to open up the command prompt. Do its by pressing your windows button + r or search “cmd.exe” after you clicked your “Start”-button.

b) navigate to the folder where your pics are. Lets assume my pictures are in a folder named “c:/projects/420/timelapse/” type in:

cd c:/projects/420/timelapse/

if your pictures are on an USB drive or other hard disk type in the local identifier of the harddisk, like

cd g:

and then the path
cd g:/projects/420/timelapse/

cmd.exe doesnt know copy/paste but you can access it with right-clicking into the window!

c) Now its time to get ffmpeg to do its magic. The code im using is:
ffmpeg -r 24 -i %d.JPG -s hd1080 -vcodec libx264 timelapse1.mp4

it has to be typed into cmd.exe aswell.

  • the ffmpeg is telling windows to access the ffmpeg software
  • the -r 24 is setting up the framerate. You can go up to 60, or 30. This will affect the lenghts and size of your final video. And the smoothness
  • -i %d.JPG is telling the software, that the filenames are according to our renamed files (1.jpg, 2.jpg,…)
  • -s hd1080 is calling for a FullHD recording. You can change the “hd1080” to every resolution you want. E.g. “2560x1440” for 2k HD.
  • -vcodec libx264 is the used codec. libx264 needs to be installed and available on your system. if you got VLC player installed, youre good to go.
  • timelapse1.mp4 is the filename. The programm will ask you, if that already exists and overwrite/ wont overwrite it.

Before you hit that Enter button check if you did everything accoring to the plan:

  1. Every photo is in correct order and named sequential 1.jpg, 2.jpg, 3,jpg…
  2. You installed ffmpeg
  3. You navigated to the right folder using cmd.exe
  4. You have access to the x264 codec.

The ffmpeg will take abit of time to get everything done and you can grab your file afterwards in the same folder your images are in.

This is my current workflow. takes about 10 minutes every friday to get the pictures, back them up, rename them and putting them into a video file.

Cheers, and (Step 3:) let me/us know about any results. Timelapses are awesome, and we need more of them.


#2

Awesome read that’s for being a part of the team and bringing solid info to the family


#3

This is awesome! Gold standard of engineering and documentation!


#4

The mobile app exports out the zipped images into one file. The names of the images is time stamp. So they are already sequenced.

To better organize the files, they are separated into different folders by day. And inside of the date folder, there are 4 subfolders corresponding to the USB ports. In case there are more than one camera attached, and you want to do time lapse per camera (which makes more sense to me).

./zip
     ./2018-02-12
         ./2
         ./3
               1234567.jpg
               1234580.jpg
         ./4
               1234569.jpg
               1234582.jpg
         ./5

I am planning to offer options for the structure when users export time lapse images.

  1. Flat ( if only camera attached and don’t care about the dates)
  2. By Date only ( good for archive purpose and port is not important.)
  3. The default one by date and port.
  4. By Port only (good for time lapse for more than one camera)

Let me know if I am over engineering this. haha.


#5

Sorting by camera is totally fine, but having an extra folder for every day needs another workaround concerning the extraction out of the subfolders.
It might be helpful to let the daily subfolder go and give the filename an extension like (e.g. in the language im using)
$(date + "%Y-%m-%d_%H%M")
Which yields a file named: 2018-03-12_0600.jpg indicating that the picture was taken on March 12th in 2018 at 6 am. This is what im currently doing. I still doesnt end up with an ascending order of naturals, but my rename.bat does the job in 2 seconds for ~1k images.

The two seperate folders will still contain all the images and sequencing programs wont have much trouble doing their job.

Another thing: The script which takes the photos numbers them in ascending order, but cant differentiate between the cameras inside the filename.
Theres actually a workaround for that, which didnt work for me very well. I also didnt figure out some mathematical hack to get a ascending order of numbers out of the filenames for the sequencer to deal with.

In my opinion the best options are:

  1. Seperate folders for different cams, but not different dates.
  2. setup the naming so the files get a unique timestamp (and maybe a cam identifier in the name) and have a numbered order right before the .jpg.
    All programs i tested liked the files best if the numbers are countable like 1,2,3,…