Package: time-lapse
Time-Lapse assemblingThis repo contains tools used to compile Time-lapse movies using
ffmpeg. The ffmpeg utility is controlled via the ffmpeg-python wrapper.Example usage of this package can be found in thetime-lapse scriptsrepository.InstallationThis package requires theffmpegtool to be installed.brew install ffmpegThen install this package:pip install time-lapseAdditionally, when using the verbose output option a graph will be
rendered usinggraphviz, this requires the Graphviz library and the
related Python package:brew install graphviz
pip install time-lapse[graph]CodecFor near-universal compatibility the H.264 codec is used. The following
section describe some of the choices for specific configuration options.See the ffmpeg wiki for additional information:https://trac.ffmpeg.org/wiki/Encode/H.264Constant Rate FactorThis uses-crf 20to set a constant rate factor, which means the overall
quality of the movie should be constant. So bitrate varies to ensure
this. Higher value is lower quality. The quality and bit rates at this
value seem reasonable.Preset-preset sloweris used to improve the compression ratio for the selected
quality (crf), without taking too much time.Faststart-movflags +faststartis used to allow the movie to quickly start playing,
while it is still loading or buffering.Quicktime supportThe codec defaults to YUV 444, which is not supported by Quicktime. So
addpix_fmt yuv420pto fix Quicktime support.InputSelect input framesUse frames as input by giving a glob pattern which matches the desired
images. Usually these will be tiff images so use-pattern_type glob -i "*.tiff".FramerateWhen using image sequences as input the framerate of the desired output
should be given using-framerate 30.FiltersCommonly used filters:Deflickerhttps://ffmpeg.org/ffmpeg-filters.html#toc-deflickerScalehttps://ffmpeg.org/ffmpeg-filters.html#scaleCrophttps://ffmpeg.org/ffmpeg-filters.html#cropDrawtexthttps://ffmpeg.org/ffmpeg-filters.html#drawtext-1Video sizeshttps://ffmpeg.org/ffmpeg-utils.html#video-size-syntaxStepsFirst deflicker the video to ensure it is equally deflickered for
all outputsThen scale and crop the videos to fit the desired final resolutionsThen add the watermark (which should not be deflickered)Scale videoAdd scaling to ensure it fits in given dimensions. Negative values for
width or height make the encoder figure out the size by itself, keeping
the aspect ratio of the source. The integer of the negative value, i.e.
4 for -4, means that the size should be devisble by that value. TODO:
does it just scale/squish the video or crop?:-vf scale=1920:-2
-vf scale=960:540:aspect..Convert movieUsing time-lapse to find tif files, and create a movie called 'test_movie'
with 24 fps and deflickered:from time_lapse import output, source

source_input = source.get_input(['*.tif'], fps=24, deflicker=10, filters=None)
output.create_outputs(source_input, 'test_movie', verbose=False)InspectionBy passingverbose=Trueto create outputs the following ffmpeg-python
inspection methods will be performed.Show the ffmpeg command options ffmpeg-python would use:.get_args()By using graphviz the graph from input to output can be shown using:.view()