This project uses the C preprocessor to render individual frames from the well known Bad Apple!! music video, without sound.
It cannot play the whole video without a little scripting help (a simple bash loop is well enough) but even then I found it very slow, so in addition to the scripts to run the "pure" version which truly renders entirely using the C preprocessor, I have also added a C program player.c which allows playing the entire video at 30fps.
First, frames.h was generated by turning each individual frame from the video in its "C macro encoding" equivalent. Then, by including decoder.h the preprocessor naturally expands each frame into its uncompressed, ASCII equivalent.
To run the pure version, it is sufficient to run:
$ bash play.shin the terminal. In case your CPU is monstrously fast and runs the thing at more than 30fps, you can tweak the usleep delay in the script. My computer runs the video 10-15x slower than real time this way.
To run the impure version it's sufficient to compile player.c before running it:
$ gcc -o player player.c && ./playerIf you want audio in the background:
$ mpv --script=script.lua --no-video bad_apple.mp4 And if you want to compare it with the real video in real time:
$ mpv --script=script.lua bad_apple.mp4 Enjoy this little demo video:
This program was only tested with GCC.