It concatenates a directory with jpegs into a video via FFmpeg.
Project description
Features
1. Fixing unstable frame size
Some software for some reason may save a part of frames with negligible cropping (about 8 pixels).
Even if this is not your case (it scales the image, for instance), if a resolution was changed to very close one, it’s still better to use cropping/extending on video, than scaling, to prevent further quality loss.
The script aligns the frames to the left-top corner.
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.
A change to approximately the same aspect ratio
A change to a very different aspect ratio
Requirements
Python 3
ImageMagick
FFmpeg
Installation
On Ubuntu 18.10 and most of Linux distributions:
sudo python3 -m pip install --prefix /usr/local catframes
On Windows/ReactOS:
pip install catframes
Usage
All these scripts scan JPEG and PNG files in a folder based on the file name extensions, not their signatures.
catframes_fix_resolution ensures, that all images in the current directory have the same resolution.
Finds out, what resolution is most common in this directory.
Renames corrupted images to {original_filename}_corrupted.
Converts all the pictures in place to this resolution.
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.
$ catframes_most_common_image_resolution_in_the_folder [--statistics|-s] 1280x720 => 3 800x800 => 2 ------------- Completed in 0.023589134216308594 seconds.
$ var1=`catframes_most_common_image_resolution_in_the_folder` $ echo $var1 1280x720
But this script renames corrupted images as well.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for catframes-0.4.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3424747a47b95bf46d70d61dc47b481e9798ac4c7fdfce599402151a0081900f |
|
MD5 | 7d5b011a5593240463e3c1612f14d3d8 |
|
BLAKE2b-256 | 2ef747f7a739625fd945a211c6b2863e864df938532e9c7d9b6ef82b6ee8dbe5 |