Skip to main content

It concatenates a directory with images into a video via FFmpeg.

Project description

Python versions: 3.3 and above PyPI License: CC0-1.0 GitHub code size in bytes

This package is no longer supported! The new version is here: http://itustinov.ru/

Features

1. Fixing negligible cropping (about 8 pixels)

I don’t remember exactly, why I did this. Probably to prevent quality loss due to scaling.

Feature 1, cropping

Feature 1, cropping

Feature 1, extending

Feature 1, extending

The script aligns the frames to the left-top corner. You can use --color1 argument to adjust the background color.

2. Fixing the case, one changes camera settings during a day

A video file has a static resolution, but a camera resolution may be changed. If the change is small, this case will be indistinguishable from the previous one. But the considerable changes can be processed another way.

Aspect ratio difference < 0.45

In this case, the program will ignore aspect ratio and distort the frames.

To disable this, please use [-A|--never-change-aspect-ratio] argument. You can combine this with --color2 argument.

Feature 2.1

Aspect ratio difference >= 0.45

In this case, the program will add margins. You can use --color2 argument to adjust their color.

Feature 2.2

Requirements

  1. Python 3

  2. pip

  3. ImageMagick

  4. FFmpeg

Installation

On Ubuntu 18.10 and most of Linux distributions:

sudo python3 -m pip install --prefix /usr/local --upgrade catframes

On Windows/ReactOS:

pip install catframes

Usage

Usage video

This script scans JPEG and PNG files in a folder based on the file name extensions, not their signatures.

You can also run the internal subtasks separately:

  1. catframes_fix_resolution ensures, that all images in the current directory have the same resolution.

    1. Finds out, what resolution is most common in this directory.

      1. Renames corrupted images to {original_filename}_corrupted.

    2. Converts all the pictures in place to this resolution.

  2. catframes_to_video [--delete-images] [-o pathToFile.mp4] compresses them all to a single video file with 1 frame per second. Please, use catframes_to_video [--help] for more information.

You can also use Catframes to detect common resolution in a folder. This is a subtask of catframes_fix_resolution.

$ catframes_most_common_image_resolution_in_the_folder [--statistics|-s]

1280x720 => 3
800x800 => 2
-------------
Completed in 0.11370372772216797 seconds.

                   Method | Result
 ------------------------ | ---------------
                       mf | 1280x720
                    gtewa | 1280x800
$ var1=`catframes_most_common_image_resolution_in_the_folder`
$ echo $var1
1280x720

Disclaimer

I make no representations or warranties of any kind concerning the software, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law.

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

catframes-1.0.3.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

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

catframes-1.0.3-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file catframes-1.0.3.tar.gz.

File metadata

  • Download URL: catframes-1.0.3.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for catframes-1.0.3.tar.gz
Algorithm Hash digest
SHA256 848801d907c0b48ff0aa1fd6895cabfe0d3971205cc64fae71f56c00ac6ae4f7
MD5 47077b34ef1b97d134195898f3c36523
BLAKE2b-256 016a8f322a363d5d2e7b934d58344fb5ec03bf45c8dc02568625569f798008b2

See more details on using hashes here.

File details

Details for the file catframes-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: catframes-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for catframes-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1c961219c4db6e4f2f4787f443e622990ea54ee6d84d5fb386161603d449c9ff
MD5 6c71637bc8515470fcdc01ef72b01ff7
BLAKE2b-256 afc5cb4aefd585dcc8b989da2e6f121ab0bcc95d32a90fe9cb771b207794d239

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