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:

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

Remove Photos

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

python pyelapse.py 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.:
python pyelapse.py 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:

python pyelapse.py 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.0.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.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyelapse-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 a5ba6f1968ee5064676040c18dd1f1f34906c738f300271dc9ceaceb3e84f50d
MD5 8b2596fcd93f860c106a32ab8a53cb99
BLAKE2b-256 25f594d1226146154c49c5da2b3c8e2c922f0b4df0dc896ca08c4cb671723a0c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyelapse-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8063139a0d310ef9da889e086f30a38348cf6cb1305c1e9902620538cda2bcc2
MD5 9114cf76c3ba1c5bcdd85a1d3ea01be4
BLAKE2b-256 30f65ad2e1f58ecf7193ecbd766cf9b1a67a0fe66d0ababbc9f784ca6ac7f15c

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