Skip to main content

Catframes

It concatenates frames.

With this software, you can

  • create a timelapse video
  • turn an animation rendered in a PNG sequence into a video
  • compress your selfies
  • compress a sequence of frames from CCTV

The script takes folders with images and outputs MP4 or WebM.

It has GUI: catmanager

What exactly does it do

  1. It takes the folders in the order you specify them.
  2. It sorts images by name in natural order in each folder separately.
  3. It checks the resolution of each image and counts their numbers.
  4. It heuristically chooses the video resolution from the collected data.
  5. It resizes each image (on the fly) to fit into that resolution, preserving the aspect ratio and aligning the images in the center.
  6. It overlays various text information on the frames, if you specified this in the arguments.
  7. It concatenates the frames, having a fairly high resistance to emergencies.

Installation

Do this as root for system-wide installation:

python3 -m pip install catframes

Or you may install it only for your user:

sudo apt install pipx
pipx install catframes
pipx ensurepath

You may also copy catframes.py to /usr/local/bin manually. But then you will also need to install Pillow.

Dependencies that are not installable from PYPI:

  1. FFmpeg
  2. Monospaced fonts

Alpine: apk add ffmpeg font-dejavu

Debian/Ubuntu: apt-get install ffmpeg fonts-dejavu

Centos/RHEL: yum install ffmpeg dejavu-sans-mono-fonts

Windows: FFmpeg builds; Courier New included.

Usage

If you are launching the program for the first time, use --limit option to try different options on short video samples.

catframes --limit=3 sourceFolder sample.mp4

The command to run it with default settings looks like this:

catframes folderA folderB folderC result.webm

For automatic launches (through a CRON job, etc.), it's better to add --force and --sure options:

catframes -sf folderA folderB folderC result.webm

Default settings

Frame rate: 30 frames per second.

You may change it with -r parameter. Acceptable values are from 1 to 60. All source frames will be included, so this parameter determines speed of your video record.

Compression quality: medium.

You may change it with -q parameter. Acceptable values are poor, medium, high.

Margin (background) color: black.

You may change it with --margin-color. It takes values in formats #rrggbb and #rgb (hexadecimal digits; #abc means #aabbcc).

Text overlays

There is a 3 by 3 grid. You can place labels in all cells except the central one.

Please, use --left, --right, --top, --left-top, etc.

One of the cells may be reserved for important warnings. It is set by WARN value (in any case). By default, this is the top cell.

You can use any constant text in the labels, including line feeds (\n). You can also use a limited set of functions in curly brackets that output information about the source image or about the system.

To prevent special characters from being interpreted, you should use single quotes in Unix Shell, however, you must use double quotes in the Windows command line.

Example (Bash):

catframes \
    -r=5 --limit=10 \
    --left-top='Frame {frame:video}' \
    --left-bottom='{dir}/{fn}\n\nModified: {mtime}' \
    --right-bottom='Compressed {vtime:%Y-%m-%d %H:%M}' \
    folder video.webm

Read more about these functions in the docs.

See also

Documentation (in Russian, outdated)

Release files for catframes 2024.8.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for catframes 2024.8.3
File Size Uploaded
catframes-2024.8.3.tar.gz 69.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for catframes 2024.8.3
File Interpreter ABI Platform
catframes-2024.8.3-py3-none-any.whl Python 3 none any Details

Total release size: 138.7 kB

Release files / catframes-2024.8.3.tar.gz

Download URL catframes-2024.8.3.tar.gz
Size 69.7 kB
Tags Source
SHA-256 checksum
How to use checksums
cd08963e7ee8bb8835b7b7ce2ef9fa6064eeef531c4007a7a238ca5960659c15
BLAKE2b-256 checksum
How to use checksums
42962811bb3377f6059fe4e257dcdbbc0f327fac0c6328b8a757bb4cc0a5a8bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.4

Release files / catframes-2024.8.3-py3-none-any.whl

Download URL catframes-2024.8.3-py3-none-any.whl
Size 69.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d510930ccaff41f48f8a44afab90c545ac54c7d7ee7ff3ba407ef18f8c60af36
BLAKE2b-256 checksum
How to use checksums
b7c402a27f387e43d12d6700a964de21ee1930dd82614a971fa83bd0790ecd70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.4

Release history Release notifications | RSS feed

This release

2024.8.3 This release

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.10

1 release file

0.4.9

2 release files

0.4.8

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.3.1

2 release files

0.2.12

2 release files

0.2.11

2 release files

0.2.10

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page