💩 Takes provided video/audio clips and splices them together at random to produce randomly-generated humor.
Find a file
Chev 72aba68200
Change where sources are located
Makes things a little more organized, but it's a breaking change
2026-01-26 17:34:42 -08:00
input Change where sources are located 2026-01-26 17:34:42 -08:00
src RepeatMultiple bug fix 2026-01-25 17:48:08 -08:00
.gitignore Change where sources are located 2026-01-26 17:34:42 -08:00
LICENSE Initial commit 2020-09-18 19:22:11 -07:00
main.py Change where sources are located 2026-01-26 17:34:42 -08:00
pyproject.toml Use tqdm for progress bars 2026-01-24 16:59:23 -08:00
README.md Change where sources are located 2026-01-26 17:34:42 -08:00
uv.lock Use tqdm for progress bars 2026-01-24 16:59:23 -08:00

shitpost-video-generator

Generates an output video with overlayed audio and effects using a list of audio and video inputs.

How it works

Here's how it works:

  1. Gets all sources to use from the input/video/, input/audio/ and input/image/ directories. This is where you put your sources.
  2. Gets a seed for the random number generator, which can be used if a user wants to re-generate the same exact video again.
  3. Chooses n random videos where n is the number of videos the user wants to merge into the final results (e.g. if you want to merge 40 different videos, it chooses 40 random videos). The script will first to attempt to avoid duplicate videos. If the chosen video amount is higher than the available videos, then the script will add duplicate videos to meet that amount.
  4. Applies a bunch of random effects to the video files, which include trimming the video to be a random short length, mirroring the video, speeding it up or slowing it down, reversing the video, as well as other effects.
  5. Merges all the now effect-applied videos into one big video.
  6. Applies images onto this big video at random, at random positions and sizes.
  7. Also adds audio files at random spots, and can additionally apply effects to them, which include trimming the audio to be a random short length. The script will also attempt to repeat audio clips less than 5 seconds to give a repetitive-like nature to the end result.
  8. Everything is then merged together to produce the final result, which is put into the output/ directory.

Requirements

Python 3.9 or greater is required. This project has been tested on Python 3.11.

uv

uv is the recommended installation method. You can find how to install uv here.

After uv is installed, simply run uv run main.py in whatever folder you downloaded this from. That's all!

pip

If you'd prefer to use traditional pip/venv:

  1. Ensure you're using a compatible Python version: python --version
  2. Remove any existing virtual environment if it exists. (Usually venv/ or .venv/)
  3. Create a new virtual environment: python -m pip venv venv
  4. Activate the virtual environment: source venv/bin/activate
  5. Install MoviePy: pip install moviepy==2.2.1 tqdm
  6. Run the script with python main.py

How to use

Please take a look at the requirements above before following these steps. uv is the recommended install method.

  1. Download the GitHub repo (click the green 'code' button, then 'Download ZIP') and extract it somewhere.
  2. Put a list of desired sources into their respective directories:
    • Videos in input/video/
    • Sounds in input/audio/
    • Images in input/image/
  3. Run the script, and choose a seed if you want to reproduce the same video later. Otherwise, type 'any' to choose a random seed.
  4. Choose the amount of videos you want the script to merge together to produce the final result.
  5. The script will do the rest, and generate the final video in the root directory, which will be formatted as result_seed-<seed>_<number-of-videos>_<effects-enabled>.mp4.

Performance

This script uses moviepy - due to the amount of ffmpeg processes moviepy opens from this script, it has really high memory usage. I have seen this script use upwards of about ~2.5GB of memory for 40 random loaded videos. I don't know of a way around this.