/video-screenshot-grid-maker

Create an image grid containing screenshots from a video.

Primary LanguagePython

Video Screenshot Grid Maker (VSGM)

Create a jpg file containing screenshots from a video presented in a grid.

Table of Contents

1. Prerequisites

1.1 Requirements

FFmpeg must be installed and accessible via the $PATH environment variable for VSGM to run. The python wrapper ffmpeg-python is also required.

1.2 Installing FFmpeg

Before using ffmpeg-python, FFmpeg must be installed and accessible via the $PATH environment variable.

There are a variety of ways to install FFmpeg, such as the official download links, or using your package manager of choice (e.g. sudo apt install ffmpeg on Debian/Ubuntu, brew install ffmpeg on OS X, etc.).

Regardless of how FFmpeg is installed, you can check if your environment path is set correctly by running the ffmpeg command from the terminal, in which case the version information should appear, as in the following example (truncated for brevity):

$ ffmpeg
ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)

Note: The actual version information displayed here may vary from one system to another; but if a message such as ffmpeg: command not found appears instead of the version information, FFmpeg is not properly installed.

1.2.1 Installing FFmpeg for windows

From the download page above you can select the ffmpeg essentials build, which contains the needed .exe files. Make sure they are available via the $PATH.

ffmpeg-git-essentials.7z

1.3 Installing the python FFmpeg wrapper

The latest version of ffmpeg-python can be acquired via a typical pip install:

pip install ffmpeg-python

2. Usage

2.1 How to use wizard

Execute the vsgm.py file and it will ask you for a drive name, then you can select what folder to scan for video files.

python vsgm.py

The script will scan the folder you chose and its subfolders for video files, and create screenshot grids with the same name.

2.2 Scan a specific folder

You can execute the script by adding the folder to scan for videos as a parameter.

python vsgm.py e:\my-videos

2.3 Example grid

grid example

3. FAQ

3.1 Error in UnicodeEncode

If you get an error dealing with UnicodeEncoding errors like:

File "C:\Python311\Lib\encodings\cp1252.py", line 19, in encode  
UnicodeEncodeError: 'charmap' codec can't encode character '\u0440' in position 59: character maps to <undefined>

Run the following command in terminal to make sure you are using UTF-8 which has all of the unicode characters.

export PYTHONIOENCODING=utf-8  

4. Version History

4.1 Log

v1.1

- Added videfilename and length in upper left corner  
- Made the final image smaller if wider than 5000 px  
- Added __init__py file in scripts folder  
- Updated example image  

v1.0

- Project started  

5. Information

5.1 License

This project is licensed under the terms of the MIT License. Enjoy!

5.2 Author

Kim Steinhaug: @steinhaug LinkedIn Website