- 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
This does not appear to work on macs, which sneakily use clang instead of gcc (you can check this with
g++ --version
)For example when I run it on my machine the substitution error does not print all of line 28, so no animation for me.
I reproduced this on GodBolt. I found that clang will only print the source if the length of the line that is unable to find a proper substitution is 4096 or less.
https://godbolt.org/z/1dKzPh5Wh
However if you switch to GCC, it'll print significantly longer lines.
Not feeling up for installing GCC for this, and a 64 x 64 resolution rendering isn't the dream. Cool idea though!