Skip to main content

A CLI tool to create time-lapse videos from images, with cropping, normalization, and filtering.

Project description

PyElapse

A Python script for creating time-lapse videos from images.

If you have found this, you probably have the same issue I had: There are plenty of tools to manipulate images, but some of them lack bulk processing capabilities. This script is meant to fill that gap for my use case. I wanted to create a time-lapse video of my construction site and needed to remove night photos, weekends, crop images, and normalize the intervals of the images. It is far from perfect, but it works for me. If you have any suggestions or improvements, feel free to open an issue or a pull request.

Example usage:

pyelapse remove-photos /path/to_image_folder/ --exclude-time 22:00-06:00 --exclude-days sat,sun
pyelapse create-timelapse /path/to_image_folder/ --output path/time-elapse-video.mp4 --fps 30

install

pip install pyelapse

Remove Photos

You can try out different removal settings by restoring previously removed images before running the removal:

pyelapse remove-photos /path/to_image_folder/ --exclude-time 22:00-06:00 --exclude-days sat,sun --restore-removed
  • The --restore-removed flag moves all images from the removed folder back to the main folder before applying the removal logic.
  • You can also rename the kept files using the EXIF date/time and a custom suffix with --rename, e.g.:
pyelapse remove-photos /path/to_image_folder/ --exclude-time 22:00-06:00 --exclude-days sat,sun --rename Own_Name

This will produce files like 2024-06-07-14-30-00-Own_Name.jpg.

Batch Crop Images

Crop all images in a folder to a rectangle, specifying the upper left and lower right corners, and preserving EXIF data:

pyelapse batch-crop /path/to_input_folder/ /path/to_output_folder/ --start-x 100 --start-y 50 --end-x 700 --end-y 950
  • The crop window is defined by the upper left (--start-x, --start-y) and lower right (--end-x, --end-y) corners.
  • EXIF information is preserved in the output images.
  • You can optionally rotate the image before cropping using --rotate, e.g.:
python pyelapse.py batch-crop /input /output --start-x 100 --start-y 50 --end-x 700 --end-y 950 --rotate 4.14
  • You can also rename the output files using the EXIF date/time and a custom suffix with --rename, e.g.:
python pyelapse.py batch-crop /input /output --start-x 100 --start-y 50 --end-x 700 --end-y 950 --rename Own_Name

This will produce files like 2024-06-07-14-30-00-Own_Name.jpg.

Normalize Image Intervals

If your images have different time intervals (e.g., some 3 minutes apart, some 1 minute apart), you can normalize them so the video plays at a constant speed:

python pyelapse.py normalize-intervals /path/to_input_folder/ /path/to_output_folder/ --target-minutes 1
  • This will duplicate or skip frames as needed so all intervals match the target (e.g., 1 minute).
  • Use the output folder as input for your time-lapse creation.

Create Timelapse Video

You can compress the output .mov file using ffmpeg and H.264 by specifying the --crf option (lower values mean higher quality, typical range 18-28):

python pyelapse.py create-timelapse /path/to_image_folder/ --output output.mov --fps 24 --crf 23

This will create output.mov and then compress it to output_compressed.mov using ffmpeg.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyelapse-0.1.1.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyelapse-0.1.1-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file pyelapse-0.1.1.tar.gz.

File metadata

  • Download URL: pyelapse-0.1.1.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.3

File hashes

Hashes for pyelapse-0.1.1.tar.gz
Algorithm Hash digest
SHA256 67220d44c0bd8fae15121d0bf6fdba63b241092aaf5bc3bc786e5070aec363c8
MD5 a6c6d0d200106b3f25e76b8e913136cd
BLAKE2b-256 d264d1c2a01b342b1f02add5c29aea14032cd35000ff4c7b869dd8a1fc69460b

See more details on using hashes here.

File details

Details for the file pyelapse-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pyelapse-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.3

File hashes

Hashes for pyelapse-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 baa1ea49690154931a6269b5c9906ccbef031141d36b5821445a73736618c7f4
MD5 f0a1abd63e49a9cdf1bc4ea1ce2355d6
BLAKE2b-256 51b1df38948231bc09b3bf5dc36b190a5639f63601445287b1adf1f4334839f1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page