You've probably seen a bunch of /r/AskReddit narration style videos by now. So I set out to start working on a program to automate the creation of them, for fun :) Its still a work in progress, but the current state of the project allows it to:
- Take screenshots of top level comments of a thread using selenium.
- Generate audio using the epic Daniel voice for each comment.
- Have looping background music.
- Progressively show each sentence as it is spoken for a comment.
- Composite all of the above into a cool video. Heres a sample.
Output high quality content
Todo:
- Use PIL to generate comment screenshots.
- Ability to curate your own comments/support for replies.
Please feel free to make a PR with improvements :)
You will need to have the Firefox browser installed. You will also need to install Geckodriver. On mac this can be done easily with
brew install geckodriver
On Windows you will need download and move Geckodriver to Path
You will also need to download and install the Daniel voice. If you are using Python 64-bit on Windows, run DanielWindows64bit.reg
to allow the voice file to work in a 64-bit environment after installing the previous file.
$ pip3 install revvid
$ pip3 install git+https://github.com/fourjr/pyttsx3
Set the following environment variables with your Reddit app credentials.
REDDIT_CLIENT_ID=xxxxxx
REDDIT_CLIENT_SECRET=xxxxxxx
Note: Currently, the program does not work on Linux, nateshmbhat/pyttsx3#30). If it is possible to get Daniel's voice and TTS working, feel free to make a PR.
Usage: revvid [OPTIONS]
This program generates reddit narration videos! If no post ID is provided
then an interactive session which allows you to choose from hot posts
from the spcecified subreddit is started.
Options:
-p, --postid TEXT The post ID to generate the video from
-s, --subreddit TEXT The subreddit to display hot posts from.
-o, --out PATH The file path to output the video to.
-l, --limit INTEGER The amount of comments to process.
--night-mode BOOLEAN Whether or not the screenshots are in night mode
--title TEXT The text to prepend to the submission title.
--outro TEXT The outro text to be spoken.
--bg-music PATH Supply your own background music
--transition PATH Supply your own tv static transition
--help Show this message and exit.
Check out a few examples on the YouTube channel I made. Subscribe!
GNU AGPL v3
Feel free to make contributions, they are always welcome!
We use a modified pyttsx3 to support Windows, waiting on nateshmbhat/pyttsx3#57 to get merged into master.