mirror of
https://github.com/chev2/shitpost-video-generator.git
synced 2025-10-30 08:12:03 +00:00
💩 Takes provided video/audio clips and splices them together at random to produce randomly-generated humor.
- Update .gitignore - Rename input and output folders to be lowercase - Add some basic configuration capability - Rename a lot of variables |
||
|---|---|---|
| input_audio_sources | ||
| input_video_sources | ||
| .gitignore | ||
| LICENSE | ||
| main.py | ||
| README.md | ||
shitpost-video-generator
Generates an output video with overlayed audio and effects using a list of audio and video inputs.
How does the script work?
Here's how it works:
- Gets all video & audio sources in the
VideoSourcesandAudioSourcesfolders. - Gets a seed for the random module, which can be used if a user wants to re-generate the same video again.
- 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.
- 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.
- Merges all the now effect-applied videos into one big video.
- Applies effects to the audio files, which include trimming the audio to be a random short length. The script will also attemt to repeat audio clips less than 5 seconds to give a repetitive-like nature to the end result.
- The merged video clip & merged audio clip is then merged together to produce the final result.
How to use
- Put a list of desired video sources into the
VideoSourcesfolder, and a list of desired audio sources into theAudioSourcesfolder. I recommend keeping the video file formats the same, but it shouldn't matter. The resolution of videos does not matter, either. - Run the script, and choose a seed if you want to reproduce the same video. Otherwise, type 'any' to choose a random seed.
- Choose the amount of videos you want the script to merge together to produce the final result. I recommend 30 for roughly minute-long videos.
- The script will do the rest, and generate the final video in the root folder, which will be formatted as
final_result_<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 videos.
Requirements
- Python
3.8(an older version may work, but this one's verified working) - Python module
moviepy