Skip to main content

cvf

Console Video File — ASCII video format for the terminal.

Stores ASCII frames in a ZIP container with JSON metadata and LZMA-compressed frames. Playback uses CuiFW to render frames in the terminal.

Features

  • JSON metadata
  • LZMA-compressed frames
  • ZIP container
  • No ffmpeg for playback
  • Stdlib only
  • Windows, Linux, macOS, Termux

Install

pip install cvf

Optional, for playback:

pip install cuifw

API

import cvf

cvf.CreateVideo(path, frames, width, height, fps=15, chars=..., metadata=None, compress_level=6)
cvf.PlayVideo(path, color=None, bg=None, show_status=True, loop=False)
cvf.VideoData(path, load_frames=True)

CreateVideo

Write a .cvf file.

import cvf

frames = [...]  # list of bytes, each width*height
cvf.CreateVideo("out.cvf", frames, width=80, height=24, fps=15)

Returns the output path.

PlayVideo

Play a .cvf file using CuiFW. Requires CuiFW installed.

import cvf

cvf.PlayVideo("out.cvf")

Returns the player object.

VideoData

Read a .cvf file.

import cvf

data = cvf.VideoData("out.cvf")
print(data["meta"]["fps"])
print(data["frame_count"])

for frame in data["frames"]:
    pass

Metadata only:

data = cvf.VideoData("out.cvf", load_frames=False)

File format

A .cvf file is a standard ZIP archive:

file.cvf
├── meta.json
├── chars.txt
└── frames.lzma

meta.json

{
    "format": "CVF",
    "version": "1.0",
    "width": 80,
    "height": 24,
    "fps": 15,
    "frame_count": 450,
    "chars": " .:-=+*#%@",
    "compression": "lzma-xz",
    "raw_size": 864000,
    "compressed_size": 312450,
    "created": "2026-10-07T12:34:56"
}

chars.txt

Character palette. Each byte in the frame data is an index into this string.

Default:

 .:-=+*#%@

frames.lzma

All frames concatenated, then compressed with LZMA (XZ).

Frame size = width * height bytes. Total raw size = width * height * frame_count bytes.

Size

80x24, 15 FPS, 10s   raw 288 KB   cvf ~110 KB
80x24, 15 FPS, 60s   raw 1.7 MB   cvf ~600 KB
120x40, 15 FPS, 60s  raw 4.3 MB   cvf ~1.4 MB

Requirements

  • Python 3.7+
  • Stdlib only
  • Optional: CuiFW for playback

Limitations

  • ASCII only
  • Fixed frame size
  • No audio
  • Fixed FPS
  • No seek during playback

License

MIT — see LICENSE.

Author

Suleiman

Changelog

1.0.0

  • Initial release
  • CreateVideo, PlayVideo, VideoData
  • JSON metadata
  • LZMA-compressed frames
  • ZIP container

Metadata

Release files for cvf 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cvf 1.0.1
File Size Uploaded
cvf-1.0.1.tar.gz 12.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cvf 1.0.1
File Interpreter ABI Platform
cvf-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 24.2 kB

Release files / cvf-1.0.1.tar.gz

Download URL cvf-1.0.1.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3004d85bf0a5cfa5e62d4ad27b5a1f64c20f343b8a36a808b4b26c4d819692de
BLAKE2b-256 checksum
How to use checksums
9fe22cdd4df8efd03cce044a17840661d788765c0546834d5cdec66a787649e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Release files / cvf-1.0.1-py3-none-any.whl

Download URL cvf-1.0.1-py3-none-any.whl
Size 11.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8571d0e808807fe6f2c9c713489792dea1a9c65902bd3ed0903d77807df8b65e
BLAKE2b-256 checksum
How to use checksums
73812fb9525aff3071bc4b1a777c85ebac3382199f81e5d338402d1f4f41ac03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Release history Release notifications | RSS feed

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page