Creating Video Contact Sheets and Photo Collages

This guide will walk you through the process of creating video contact sheets and photo collages using various tools. The guide is divided into three sections:

  1. Using Media Player Classic - Home Cinema (MPC-HC) for Beginners
  2. Using vcsi for Advanced Users
  3. BONUS: Creating Photo Collages

Using Media Player Classic - Home Cinema (MPC-HC)

MPC-HC is a light-weight, open-source media player for Windows. It is equipped with a feature that allows the creation of video contact sheets.

Step 1: Download and Install MPC-HC

Visit the official MPC-HC Github page and install MPC-HC.

Step 2: Configure Thumbnail Settings

  1. Open MPC-HC
  2. Navigate to "File" > "Save Thumbnails".
  3. Specify the number of rows and columns for your contact sheet. (For a 5x5 grid, set both values to 5)

Step 3: Generate Thumbnails

  1. Choose a location to save the thumbnail image
  2. Give it a name, and click "Save".

Using vcsi (Advanced)

vcsi is a Python package that enables the creation of video contact sheets from the command line. More information can be found in the vcsi documentation on GitHub.

Step 1: Install vcsi

vcsi can be installed via pip:

pip install vcsi

Step 2: Generate Thumbnails

The following command will generate a basic 5x5 contact sheet:

vcsi -g 5x5 input.mp4

Replace input.mp4 with the name of your video file.

Step 3: Advanced Thumbnail Generation

Here's a more advanced command for generating customized thumbnails:

vcsi input.mp4-v-t--no-overwrite-w 1920-g 5x5--background-color 000000--metadata-font /path/to/font.tff--metadata-font-size 32--metadata-font-color ffffff--start-delay-percent 10--end-delay-percent 20
  • Replace input.mp4 and /path/to/font.tff with the actual paths to your video file and font file, respectively.
  • *Note that the default font for vcsi does not support Japanese characters. To use a custom font with --metadata-font you will need to need to download one from Google Fonts.

Step 4: Simplify usage with a Batch File or Function

To simplify the command, you can create a batch file on Windows or a function on Linux:

On Windows:

  1. Open Notepad and paste the command:
    @echo off
    vcsi %1 -v -t --no-overwrite -w 1920 -g 5x5 --background-color 000000 --metadata-font C:\path\to\font.tff --metadata-font-size 32 --metadata-font-color ffffff --start-delay-percent 10 --end-delay-percent 20
    
  2. Save the file as cs.bat in your %UserProfile% (C:\Users\YourUsername) directory.
  3. Open Notepad and paste the command:
    1
    2
    3
    4
    @echo off
    for /R %%G in (*.mp4, *.mkv, *.ts) do (
        vcsi "%%G" -v -t --no-overwrite -w 1920 -g 5x5 --background-color 000000 --metadata-font C:\path\to\font.tff --metadata-font-size 32 --metadata-font-color ffffff --start-delay-percent 10 --end-delay-percent 20
    )
    
  4. Save the file as thumbs.bat in your %UserProfile% (C:\Users\YourUsername) directory.

Next, you need to add the locations of cs.bat and thumbs.bat to your system's Path variable. Here's how to do it:

  1. Open the Run dialogue with Windows key + R.
  2. Type sysdm.cpl and press enter.
  3. In the System Properties window that opens, click on the 'Advanced' window pane then Environment Variables.
  4. In the Environment Variables window, under 'System variables', scroll down and select 'Path', then click on 'Edit...'
  5. In the Edit Environment Variable window, click on 'New' and then 'Browse...'
  6. Navigate to the directory where cs.bat is located (%UserProfile%), select it and click 'OK'.
  7. Repeat this process for thumbs.bat.
  8. Click 'OK' on all the remaining windows to close them.

Now, you can generate a single contact sheet by typing cs input.mp4 or multiple contact sheets for all videos in the current working directory by typing thumbs in your command prompt.

On Linux:
You can define a function in your shell's configuration file (like ~/.bashrc for bash or ~/.zshrc for zsh):

1
2
3
4
5
6
7
function cs() {
  vcsi "$1"  -v  -t  --no-overwrite  -w 1920  -g 5x5  --background-color 000000  --metadata-font /path/to/font.tff  --metadata-font-size 32  --metadata-font-color ffffff  --start-delay-percent 10  --end-delay-percent 20
}

function thumbs() {
  vcsi -r .  -v  -t  --no-overwrite  -w 1920  -g 5x5  --background-color 000000  --metadata-font /path/to/font.tff  --metadata-font-size 32  --metadata-font-color ffffff  --start-delay-percent 10  --end-delay-percent 20
}

Don't forget to source your shell's configuration file to apply the changes:

source ~/.bashrc  # for bash

or

source ~/.zshrc  # for zsh

Now, you can generate a contact sheet by typing cs input.mp4 in your terminal. To generate thumbnails for all videos in the current directory, use thumbs.


BONUS: Creating Photo Collages

In addition to creating video contact sheets, you can also create photo collages from a directory of images using PyPhotoCollage. Here's a quick guide on how to do that.

Step 1: Install PyPhotoCollage

Download the PyPhotoCollage Python file directly from this link and save it on your computer. Install the Pillow package, which is required for PyPhotoCollage, using pip:

pip install pillow

Step 2: Generate Collages

Here are a couple of example commands:

Example 1: This command creates a wide (
aspect ratio of 2.0), 3840-pixel wide collage of 500 images from the specified folder. The images are shuffled because the -s flag is used:

python PhotoCollage.py -f '/path/to/images' -o collage.png -W 3840 -r 2.0 -s -c 500

Example 2: This command creates a square (aspect ratio of 1.0), 2160-pixel high collage of all images in the specified folder. The images are presented in sequential order because the -s flag is not used:

python PhotoCollage.py -f '/path/to/images' -o collage.png -H 2160 -r 1.0

Replace '/path/to/images' with the actual path to your images. The -o option specifies the output file for the collage.

That's it! With these tools, you can create both video contact sheets and photo collages. Enjoy!

Edit

Pub: 29 Jul 2023 16:36 UTC

Edit: 29 Jul 2023 18:18 UTC

Views: 295