ARTICLE / 2019.03.09
Time Lapsing - Android
1. App to Take Photos There's a lot of apps, but few are suitable for longer-term use. The main problem is if the phone powers down without creating a video. There were good: Timelapse Upload to Cloud Timelapse 24/7 Open Camera LapseIT Pro Open Camera is real…
1. App to Take Photos
There's a lot of apps, but few are suitable for longer-term use. The main problem is if the phone powers down without creating a video. There were good:- Timelapse Upload to Cloud
- Timelapse 24/7
- Open Camera
- LapseIT Pro
2. App to Upload
- DropSync
3. Making movie from images
I wrote a command-line python program to do this. See details on this below. It uses ffmpeg to create a movie. The Hx264 with defaults was a good format. To deflicker, I used the ffmpeg deflicker filter when building the movie. The timelapse-defilter python script also worked well, but was slower.Space and Time Requirements
Using the app below, I worked out a few scenarios. My details are:- 1920x1080 images: At 95% quality, this is about 0.3Mb.
- ffmpeg encoding on defaults with H264 codec in AVI container.
- No audio
- 100fps or 24fps in the 1 hour video didn't change the file size
- At one photo per 10s, it's 1Gb per day of images!
- Convert to video, it's 100Mb per day of videos
- ffmpeg H264 defaults give 7000kbit/s (or ~1Mb/s?)
- 1s for driving, close people
- 5s for sunsets, far people
- 10s sun movement, or slow clouds
- 1m plants
- 10m construction (not activity)
Making the Movies with FFMpeg
I wrote a command-line python program to control ffmpeg. ffmpeg creates the movie.Variable Frame Rate
This means you create a file with the duration of each image. For examplefile 'discont-stamped/20190319133410293.jpg'
duration 0:00:10.050000
file 'discont-stamped/20190319133413274.jpg'
duration 0:00:00.050000
Then you use ffmpeg to combine them. For example:
ffmpeg -hide_banner -loglevel verbose -y -f concat -vsync vfr -safe 0 -i 2019-03-19T13_to_2019-03-19T13-dis-vfr.avi.images -vcodec libx264 -r 22 2019-03-19T13_to_2019-03-19T13-dis-vfr.avi
It's tricky to get the framerate right if time-between-frames varies, and you want to keep all the frames. The "-r" options sets the output framerate (default: 25). The "-framerate" option is not uses, as the incoming framerate is defined by the duration between frames.
To take an example: 10 frames with 10 seconds between the 1st and 2nd, then 1 second. The average fps (real) is 10/(10+9) = 10/19 ~= 0.5fps. However, the maximum framerate is 1.0fps. ffmpeg will 'pad' the extra time between frames 1 and 2, effectively adding frames. To eliminate dropped frames, you must set "-r 1" in this case, instead of "-r 0.5"