/timelapse_compiler

App for timelapse video compilation from images

Primary LanguageShell

Timelapse Compiler

App for timelapse video compilation from images.

How it works:

  1. Analyzes sizes of all images in folder using exiv2 and takes largest
  2. Resizes smaller images to largest using ImageMagic.mogrify
  3. Generates subtitles with datetime got from filenames
  4. Compiles images to video and overlay subtitles

Folder structure:

DATA:
    - FOLDER_NAME1:
        - date_time1.jpg
        - IMG_date_time2.jpg
        - ...
    - FOLDER_NAME2:
        - ...
    - video
        - FOLDER_NAME1.mp4
        - ...

How to use

  1. (once) organize your data as mentioned above
  2. (once) build container (if not yet) podman build -t rokiden/timelapse_compiler:latest -t rokiden/timelapse_compiler:$(date +%Y%m%d_%H%M%S) .
  3. run container (pass data, envs, folder, gpu, quotas) podman run --rm -t --cpus=8 --device=/dev/dri/renderD128 -v /path/to/DATA:/data -e TL_VIDEO_H=1080 rokiden/timelapse_compiler:latest FOLDER_NAME
  4. your video placed at DATA/video/FOLDER_NAME.mp4

Configuration ENVs available in Dockerfile

Details

  • Image based on linuxserver/ffmpeg
  • Subtitles generated by python script, TL_SUB_FPS(must be divider of TL_FPS).

FFMPEG pipeline:

CPU: transparent_background -> render_subtitles -> crop -> upload_to_GPU
GPU: subtitles_from_cpu ---------------------v
GPU: *.jpg -> mjpeg_qsv -> scale_qsv -> overlay_qsv -> h264_qsv
  • Main stream fully hardware processed by Intel Quick Sync.
  • Subtitles rendered by CPU, but it is easy task.
  • Developed and tested on i5-1240P.