An asciinema compiler.
This project was made as a helper to compile videos into asciinema, mainly focused in making the bad apple video play on a text interface (TTY/framebuffer/console/etc).
It is one of the steps I took before working on my bad apple kernel & OS (WIP)
You must have cargo
, rustc
and ffmpeg
(binary) installed.
cargo install --git https://github.com/S0raWasTaken/bad_apple asciic
--help output:
USAGE:
asciic [OPTIONS] [video] [output] [-- <ffmpeg-flags>...]
ARGS:
<video> Input video to transform in asciinema
<output> Output file name [default: output]
<ffmpeg-flags>... Pass extra flags to ffmpeg
OPTIONS:
-c
Colorize output
-h, --help
Print help information
-i, --image <image>
Compiles a single image
-n, --skip-compression
Disables compression on colored outputs
--no-audio
skips audio generation
--paint-fg
Paints the foreground instead of background
-s, --size <frame-size>
The ratio that each frame should be resized [default: 216x56]
-t, --threshold <compression-threshold>
Manually sets the compression threshold [default: 10]
-V, --version
Print version information
Examples:
Compiling a normal video:
asciic video.mp4 output.bapple
Compiling a colored video:
asciic -c video.mp4 output.bapple
Compiling an image:
asciic -i image.png
# Output will be available in image.txt
Compiling a colored image:
asciic -i image.png -c --skip-compression
# We skip the color compression step, since it's a single image
Passing the frame size argument:
asciic video.mp4 output.bapple -s 500x150
# This command gives out a warning about things getting wonky at high image sizes,
# but you can safely ignore them if you want :)
Read here