- Install GCC (tested on 12.2.0) and pyvideoreader (
pip3 install pyvideoreader
) - Enter target terminal size to terminal_size.txt
- Replace line 7 of preprocess.py with:
video = VideoReader('<path to your video>')
and line 10 of generate_cpp.py with:
'<path to your video>').number_of_frames)()
(thanks @56independent for a comment!)
- Run:
python preprocess.py
python generate_cpp.py
- Run with buffering so that animation plays with original 30fps
g++ sources/badapple_*.cpp |& python buffer.py
- Or just play (this doesn't keep up speed and passes very fast)
g++ sources/badapple_*.cpp
It seems like this code is inately tied to a specific video on the disk that does not exist. It links to a home folder of a user which does not exist on most systems, never mind the
Videos/badapple.webm
file.To fix this, replace line nine of
preprocess.py
with:and line 10 of
generate_cpp.py
with:And now this program should be portable. You just need to put any webm file called
badapple.webm
within the directory you are executing the scripts from. It should be black and white for the best results.