Skip to content

(WIP) A prototype video player for the Uxn virtual machine

License

Notifications You must be signed in to change notification settings

GhettoBastler/uxn-player

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

uxn-player

An animation player for the Uxn virtual machine.

cat

It displays 1 bpp animations stored with a custom made file format. Audio isn't supported.

This project started as an exercise for learning Uxntal and is still a work in progress.

File format

Clips used by uxn-player follow the custom 1ba file format (for 1-bit animation), described in ENCODING.md.

Requirements

  • Python 3 with the Pillow module
  • uxn assembler and emulator

Build

uxnasm player.tal player.rom

Usage

Encoding GIF files

Use gif21ba.py to generate the encoded file:

python gif21ba.py src-file encoded-file

The encoder converts color GIFs into grayscale, and uses ordered dithering with a 2x2 Bayer matrix to turn them into 1 bpp images. Custom threshold values for dithering can be specified with the -t/--thresholds option. For example, the command bellow uses the following threshold matrix:

$${\left\lbrack \matrix{80 & 100 \cr 150 & 60} \right\rbrack}$$
python gif21ba.py -t 60 80 100 150 src-file encoded-file

Playback

To play the animation, pass it as an argument to player.rom. Window size is set dynamically:

uxnemu player.rom encoded-file

Use Space to pause the video.

TODO

  • Use transparency optimization to reduce file size
  • Adjust playback speed (currently set to 30 fps)
  • Rewrite encoder in uxntal
  • Add support for 2 bpp frames

Licensing

The code for this project is licensed under the terms of the GNU GPLv3 license.

About

(WIP) A prototype video player for the Uxn virtual machine

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published