How lekhanj/ascii-player works
ASCII Video Player accepts a video path, extracts PNG frames with FFmpeg, decodes each PNG through its zlib/DEFLATE data into pixels, converts pixels to colored ASCII, and plays frames in the terminal. The decoder’s custom Huffman and DEFLATE behavior is implemented within one module; BitReader is the sampled internal layer. The README documents dynamic and fixed Huffman support. The graph follows sampled call sites; internal PNG parsing details are not split into separate components.
Main entry points: index.ts CLI entry · player.ts Frame player · extract.ts Frame extraction · renderframe.ts Frame conversion
Components 12
CLI orchestration
- CLI entry
src/index.ts
Frame extraction
- FFmpeg check
src/ffmpeg.ts - Frame extraction
src/extract.ts
PNG decoding
- PNG zlib DEFLATE decoder
src/decoder.ts - Bit reader
src/bitreader.ts
Terminal playback
- Frame player
src/player.ts - Frame conversion
src/renderframe.ts - ASCII color renderer
src/renderer.ts
Other components
- Video user
- FFmpeg
- PNG frames
- Terminal
Connections 13
- Video user → CLI entry: provides video
- CLI entry → FFmpeg check: checks availability
- FFmpeg check → FFmpeg: probes version
- CLI entry → Frame extraction: extracts frames
- Frame extraction → FFmpeg: runs extraction
- Frame extraction → PNG frames: writes PNGs
- CLI entry → Frame player: starts playback
- Frame player → PNG frames: reads PNGs
- Frame player → Frame conversion: renders each frame
- Frame conversion → PNG zlib DEFLATE decoder: decodes PNG
- PNG zlib DEFLATE decoder → Bit reader: reads bits
- Frame conversion → ASCII color renderer: renders pixels
- Frame player → Terminal: writes frames