#Static player
Compile a video once into a single .ascf file, then play it from any static host (GitHub Pages, Netlify, Cloudflare Pages) with no ASCILINE backend running.
The trade-off.
.ascffiles are larger than an equivalent.mp4. In exchange you get DOM-level interaction, real selectable text, and no dependence on the browser's video codecs. Static playback still has file loading, buffering and rendering costs; it is not magically free.
#Two ways to make an .ascf
#Python compiler (recommended)
python compiler.py your_video.mp4 --cols 250 --pixel --quantize 2
| Flag | Effect |
|---|---|
--quantize 0-3 |
Drops color bits to shrink the file (0 = lossless, 3 = aggressive) |
--profile |
Enables DCT (tag 4) compression: smallest files, slower encode, lossy. Forces --pixel |
--qf 1-100 |
DCT quality, default 70 |
--tolerance |
Color drift allowed before a pixel is re-sent |
--hard |
Maximum zlib compression: slower compile, smaller output |
The clips on this site are compiled this way.
#Browser Studio (no install)
Studio compiles a video to .ascf entirely inside your browser. Nothing is uploaded, no Python is needed, and it has a built-in preview with a seekbar.
Studio's encoder is deliberately conservative and emits only RAW, ZLIB and DELTA frames. It can play every tag, including DCT. For the smallest output, use the Python compiler.
#Playing a file
Drag and drop. Open static_player/index.html and drop the .ascf file (plus an optional .mp3 for audio) onto the page. No server involved.
From a URL. Serve the folder with any static server, for example python -m http.server, or use the SDK:
import { AsciiPlayer } from './src/asciline-player.js';
const player = new AsciiPlayer('#video', {
src: 'clip.ascf', audioSrc: 'clip.mp3', loop: true,
});
Or with the custom element:
<ascf-player src="clip.ascf" audio="clip.mp3" loop
style="width:100%; aspect-ratio:16/9"></ascf-player>
The player keeps a rolling buffer of about three seconds and discards frames after drawing them, so long clips don't have to sit in memory.
#What is in the file
A big-endian binary header (ASC2 magic, FPS, mode, pixel flag, columns, rows, total frames), then length-prefixed packets using the same tags as the live protocol. Older files, including the clips on this site, use an ASCF magic and a shorter header. Audio is a separate paired file, not embedded. The header is binary, not JSON.
See the SDK reference for the full player and element options.