How encrize/bad-apple-in-100kb works
bad-apple-tiny is a self-contained terminal video player: launching it decodes an embedded raw LZMA1 stream, converts each packed monochrome frame to ASCII, presents frames to the terminal, and paces playback. Separate authoring tools can create the embedded header from a video or lower an existing header’s frame rate. The runtime connections are visible in main.c and the SOURCE INDEX; authoring-tool outputs and the standalone-player behavior are documented in the README.
Main entry points: main.c Player loop · video_data.h Compressed frames · lzma_dec.h Decoder API · convert.py Video converter
Components 11
Playback runtime
- Player loop
src/main.c - Decoder API
src/lzma_dec.h - Raw LZMA decoder
src/lzma_dec.c - Platform console
src/main.c - Playback timing
src/main.c
Embedded video
- Compressed frames
src/video_data.h
Content authoring
- Video converter
tools/convert.py - FPS re-encoder
tools/reencode.py
Other components
- Viewer
- Terminal
- Source video
Connections 11
- Viewer → Player loop: runs
README.md - Player loop → Compressed frames: reads stream
src/main.c - Player loop → Decoder API: calls decode
src/main.c - Decoder API → Raw LZMA decoder: implemented by
src/lzma_dec.c - Player loop → Platform console: presents frames
src/main.c - Platform console → Terminal: writes output
src/main.c - Player loop → Playback timing: paces playback
src/main.c - Source video → Video converter: converts video
README.md - Video converter → Compressed frames: generates header
README.md - Compressed frames → FPS re-encoder: resamples frames
README.md - FPS re-encoder → Compressed frames: rewrites header
README.md