/pyvideothumbnailer

Pyhton Video Thumbnailer. Command line tool for creating video preview thumbnails. It can be used to create preview images of individual video files, videos located in a directory and optionally its subdirectories. It is based on MoviePy, MediaInfo and PIL.

Primary LanguagePythonBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

pyvideothumbnailer

Pyhton Video Thumbnailer is a command line tool for creating video preview thumbnails. It can be used to create preview images of individual video files, videos located in a directory and optionally its subdirectories. It is based on MoviePy, MediaInfo and PIL/Pillow.

Installation

Pyhton Video Thumbnailer has the following dependencies:

The python packages can be installed using the Python Package Installer:

pip3 install moviepy pymediainfo Pillow

All code of Python Video Thumbnailer is contained in the file pyvideothumbnailer. It can be placed in /usr/local/bin or another directory on the system PATH variable and be made executable. Alternatively, it can be invoked by supplying its path as argument to the Python interpreter python3.

The optional configuration file .pyvideothumbnailer.conf needs to be placed in the user's home directory.

As of Ubuntu 22.04 LTS (Jammy Jellyfish), Ubuntu users can alternatively install the DEB package provided in the release section or install from this Ubuntu PPA.

Usage

Python Video Thumbnailer has meaningful defaults. So you can just start creating your first preview thumbnails image of an individual video file by invoking:

pyvideothumbnailer [VIDEO FILE]

or to create thumbnails of all video files located in the current working directory:

pyvideothumbnailer

or to create thumbnails of all video files located in a directory:

pyvideothumbnailer [DIRECTORY CONTAINING VIDEOS]

or in case that you want to create previews of videos in subdirectories as well:

pyvideothumbnailer --recursive [DIRECTORY CONTAINING VIDEOS]

Examples

Here are two examples how it works creating preview thumbmnails of Big Buck Bunny.

Using defaults:

pyvideothumbnailer bbb_sunflower_1080p_60fps_normal.mp4

bbb_sunflower_1080p_60fps_normal_defaults mp4

White header font on black background, DejaVuSans TrueType font instead of the built-in font, adding a comment at the bottom of the header, custom preview thumbnails image width and 5 x 4 preview thumbnails:

pyvideothumbnailer --background-color black --header-font-color white --header-font DejaVuSans.ttf --timestamp-font DejaVuSans.ttf --comment-text "Created with pyvideothumbnailer" --width 1024 --columns 5 --rows 4 bbb_sunflower_1080p_60fps_normal.mp4

bbb_sunflower_1080p_60fps_normal mp4_example5

Documentation

Visit the wiki page for more comprehensive information on installation and usage.