This tool extracts clips from multiple video files, resizes them to the same resolution, and combines them into a single "recap" video file, with crossfade and audio normalisation, as well as custom subtitles.
The user can either specify their desired clips manually or let recap-video-generator automatically select the best clip for each video by detecting choruses within the audio.
There are three options: either use the Python script directly, run the program inside a Docker container, or run as an executable (Windows only).
This script recap_generator.py uses the third party Python modules OpenPyXL, MoviePy, Pychorus, jsonschema and ruamel.yaml. Furthermore, Pychorus requires the non-Python package FFmpeg. Please install these before attempting to run the Python script.
If you are on Linux, install the required packages via the following commands:
pip install openpyxl moviepy pychorus jsonschema ruamel.yaml
sudo apt install ffmpegIf you are on Windows:
pip install openpyxl moviepy pychorus jsonschema ruamel.yaml
winget install ffmpegIf you are on Mac:
pip install openpyxl moviepy pychorus jsonschema ruamel.yaml
brew install ffmpegFirst, put the video files to be used in the recap inside the Videos folder provided, specify any options for recap generation in options.yaml, and enter the clip data in video_data.xlsx (video filenames and optionally clip start/end times and subtitles).
Then navigate to the recap-video-generator directory in the terminal and run the following commands:
docker build -t recap-generator:latest .
docker run --rm -v $PWD:/src recap-generator:latestNote that the Docker container will only be able to see files within the recap-video-generator directory, so make sure any custom file locations specified in options.yaml (e.g. output file location, fonts, intro image) are within this directory and are specified as relative paths.
An executable for Windows users is available at https://berlyne.net/code/recap-generator. If using the executable, the only requirement is installation of FFmpeg:
winget install ffmpeg- Put the video files that are to be used for the recap in the
Videosfolder provided. - Enter the following data into
video_data.xlsx:- The filenames of the video files in the
Videosfolder, including extensions; - (Optional) The start and end times of the video clips you wish to include in the recap, in the form
hh:mm:ss; - (Optional) Three lines of subtitles for each clip.
- The filenames of the video files in the
- Specify any options for recap generation in the
options.yamlfile.- This includes input/output file locations, clip selection options, subtitle properties, and intro clip properties.
- Note: If you specify that you are using your first clip as an intro clip, any subtitles for that clip will automatically be placed in the centre of the screen. This may be used as an alternative to a custom image overlay.
- Run the recap generator (either by running
recap_generator.pyor by running the Docker container or by running the Windows executablerecap_generator.exe)
Note, if the user does not specify a start and end time for a given clip, recap-video-generator will attempt to detect a chorus within the audio and select a clip automatically.