Timelapses - aaronwmorris/indi-allsky GitHub Wiki

Overview

indi-allsky utilizes ffmpeg to convert a sequence of images into a timelapse video.

Key settings

  • Framerate - The number of frames per second to be utilized for the timelapse video. A smaller number will make the video longer, but it will be choppier. A larger number will be more smooth, but shorten the video.
  • Bitrate - The target data bit rate for the output. A larger number will result in more data and more detail at the expense of a larger file size. 5000k is a good number for HD videos. 10000k might be better for 4K.
  • Scaling - Scales the output of the video resulting in a lower resolution and smaller file size. Scaling the video also reduces the memory requirements to generate the video
  • Codec - The encoder for the video. x264 is the default and usually the best option
  • Skip frames - Skips frames at the beginning of the timelapse. The exposures are usually wrong when there is a transition between day and night resulting in over or under-exposed images. This setting give the opportunity to remove those frames from the video.

Notes on ffmpeg scaling

A common problem related to ffmpeg scaling is this selection can cause the timelapse generation to fail. If the scaling percentage results in a resolution that is not divisible by 2, the timelapse will fail. Unfortunately, ffmpeg is not smart enough to self-correct this problem and you cannot know ffmpeg will fail until it runs.

This is why there is a selection specifically for IMX477 (Raspberry Pi HQ camera). The percentage based calculations will fail (on IMX477).

Memory - x264

Memory requirements are primarily driven by the resolution of the timelapse generated by the FFMPEG utility. A higher resolution camera can be used on lower memory system by scaling the output resolution of the FFMPEG process.

Output Resolution Recommended Memory Minimum Memory FFMPEG Process Memory
1280 x 960 (1.2MP) 2GB 1GB with 1GB swap 0.4GB
1920 x 1080 (2MP) 2GB 1GB with 1GB swap 0.6GB
3840 x 2160 (8MP) 4GB 2GB with 1GB swap 1.7GB
3008 x 3008 (9MP) 4GB 2GB with 1GB swap 1.8GB
4056 x 3040 (12MP) 4GB 2.5GB
6224 x 4168 (26MP) 8GB 5.0GB
9152 x 6944 (64MP) 16GB 12.0GB

Codecs

Codec Notes
x264
x265 hevc Slower on SBCs like Raspberry Pi. Greater memory usage. HVEC not widely supported by browsers
webm
h264 OMX Limited to Raspberry Pi running 32-bit OS
h264 v4l2m2m Raspberry Pi - Limited to 1920x1920 - Use Scaling
h265 hvec v4l2m2m Raspberry Pi - Limited to 1920x1920 - HVEC not supported by most browsers
h264 QSV Intel accelerated encoder

Intel QSV

sudo apt-get install \
  intel-media-va-driver-non-free \
  i965-va-driver

Pre-Processors

Processor Description
Standard No pre-processing is performed, images used as-is
Wrapped Keogram The keogram for the time period is wrapped around the image circle

Pre-Processor settings

Setting Description
Image Circle Size of the image circle for processing (Used by Wrapped Keogram)
Keogram Ratio For the Wrapped Keogram, this is the ratio of the size of the keogram to the image circle. 0.15 = 15%

Pre-Processing resources

Pre-processors that process every image for a timelapse have to read each image, run the processing, and write new temporary images. On a Raspberry Pi 3 system, processing averaged 1.5s per image for the wrapped keogram. This would mean a 2000 image timelapse required 3000 seconds (50 minutes) of pre-processing time, in addition to the 15-30 minutes for building the timelapse from those images.

Depending on the resolution of the camera, the temporary images may require 1-4GB of disk scratch space while the timelapse is generated.

If the processor expands the size of the image, it will require more memory. Recommend 4GB of memory for pre-processors.