Long term, daytime only, timelapse on Android

I’ve had an old Galaxy Nexus repurposed for monitoring the garden while on vacation, but after a while I realized a better project with this setup would be timelapse of the entire season for the garden.

Initially I tried the timelapse feature in the Android Camera app, but after viewing the footage, the long night scenes were obviously distracting. Manually editing the frames out was doable, but would have to be automated – good luck finding the ideal solution for that.

I started looking at Android Apps that specialize in timelapse, and some came close with the ability to schedule recordings with custom settings, but those lacked the ability to schedule it every day between certain times.

A few of the timelapse apps took photos for each frame rather than assembling a movie automatically. To some that is an anti-feature, but for me, it made separating daytime and nighttime frames much simpler.

The app I chose was Tina Timelapse. This app is not without its caveats.  I found that Android’s media refresh process was not triggered when each photo was taken making the photos invisible to Dropbox’s Photo Sync and likewise Google+ Photo Sync, so there could be no automatic synchronization.  Another issue is the file naming convention resets, so duplicate names will pose conflicts when merging photo sets. You don’t want to dismount the phone to manually trigger media refreshes, otherwise you lose the consistency of the view in the photos.

Given those caveats, and the daytime only requirements, the only way to tackle things is to script things. I’m using a Linux laptop as an intermediary to transfer the files into my Dropbox folder which syncs to my Windows desktop where I use Windows Movie Maker to quickly generate the video.

Software requirements:

  • Android SDK installed & adb added to the Path on laptop
  • Exiftools installed on laptop
  • Tina Timelapse  installed on Android

Hardware requirements:

  • Spare Android Phone
  • Phone mount
  • USB cable plugged into an outlet

adb shell am broadcast -a android.intent.action.MEDIA_MOUNTED -d file:///mnt/sdcard/Camera &&
echo "Media Refreshed" &&
adb pull /sdcard/Camera/garden_5/ ~/Dropbox/Garden &&
adb shell rm -r /sdcard/Camera/garden_5/* &&
adb shell am broadcast -a android.intent.action.MEDIA_MOUNTED -d file:///mnt/sdcard/Camera &&
echo "Files moved" &&
cd ~/Dropbox/Garden &&
exiftool '-filename<ModifyDate' -d %Y-%m-%d_%H%M%S%%-c.%%le -r -ext jpg ~/Dropbox/Garden/ &&
mv 2014*{000000..070000}* ../../GardenRejects || true &&
echo "00h00-07h00 removed" &&
mv 2014*{200000..240000}* ../../GardenRejects || true &&
echo "20h00-24h00 removed"
echo "All done"

Looking at this script there are some parts to customize:

  1. Replace all occurrences of /sdcard/Camera with the location you specify in the Tina Timelapse settings
  2. Replace garden_5 with the name of the folder Tina Timelapse creates. By default it will be nameless_1
  3. Replace ~/Dropbox/Garden with the Dropbox location on your laptop and the folder name you want your photos stored in
  4. This line mv 2014*{000000..070000}* ../../GardenRejects states move all photos taken between midnight and 7am to the reject folder. Likewise 200000..240000 means between 8pm and midnight. These should be adjusted to your preferences.

After this runs, your photos will be named like 2014-06-23_170436.jpg so they can be ordered chronologically and all the photos specified as nighttime will be removed from the Dropbox folder.

If you are using Windows Movie Maker, simply drag all the photos into a new Movie project, select all photos, then click on Edit, and set the frame length to 0.03 seconds and then generate the movie.

Leave a Reply

Your email address will not be published. Required fields are marked *