This is an overengineered script for auto-generating image macro style "memes". Inspired by Reddit's /r/prequelmemes community, who believe that there every line in the Star Wars prequels can be a meme, this script can pull screenshots from any movie and pair them with an associated subtitle to create a "meme".
Requirements
ffmpeg
;
install via your OS's distribution systemDependency setup is handled by Pipenv, so all you have to do to install everything is:
pipenv install
Use the Pipenv environment to run the script, like this:
$ pipenv run python movie-meme-generator.py
usage: movie-meme-generator.py [-h] [-m {interactive,script}] [-v | -q]
[--enable-imgur | --disable-imgur]
CONFIG_FILE
The execution of the script is configured via a YAML file. This repository
comes with a working sample file and "movie" with subtitles. You can see that
configuration in movie-meme-config.yaml
, and the
movie/subtitle files in resources/
.
You can run this sample configuration using:
pipenv run python movie-meme-generator.py movie-meme-config.yaml
There is another sample configuration of what extracting memes from the Star
Wars prequel trilogy would look like, in
sample-configs/star-wars.yaml
. The
actual movie/subtitle files are not provided; that's up beyond the scope
of this repo.
If you would rather not handle a local install of all that, and would rather have it handled for you, a Docker configuration is included. Assuming you have set up Docker for your system already, all you have to do to generate memes is:
resources/
directorymovie-meme-config.yaml
to reference and
use those files ./docker_build_run_script.sh
Interactive mode is not supported with Docker, as it requires access to your web browser.
You can also stand up a simple web server that creates memes over and over:
resources/
directorymovie-meme-config.yaml
to reference and
use those files ./docker_build_run_server.sh
http://localhost:8080
If you want to run the server without Docker, you're on your own