An open API service indexing awesome lists of open source software.

https://github.com/katharostech/cast2gif

Tool to render Asciinema cast files to GIFs, *without* using Electron or a web browser. Written in Rust.
https://github.com/katharostech/cast2gif

asciinema asciinema-player cast gif gif-animation gif-creator rust

Last synced: 8 months ago
JSON representation

Tool to render Asciinema cast files to GIFs, *without* using Electron or a web browser. Written in Rust.

Awesome Lists containing this project

README

          

# Cast2Gif

A tool to convert [Asciinema](https://github.com/asciinema/asciinema) cast files to Gifs *without* using Electron or a web browser.

## Installing

We have yet to get CI setup for automated builds, but there is a musl Linux build that should run on any distro in our [pre-release].

[pre-release]: https://github.com/katharostech/cast2gif/releases/tag/pre-release

## Example Recording

Here is an example of a GIF created with `cast2gif`:

![example](./doc/example1.gif)

## Full Example

Here is a recording showing how to record a clip with [Asciinema](https://github.com/asciinema/asciinema) and render it with `cast2gif`:

![tutorial](./doc/tutorial.gif)

## Features to Add

Here are some features to get in as time permits, ordered by importance:

- Support for changing the output resolution/font-size
- Add a slight bit of padding around the terminal window.
- Automated builds for Windows, Mac, and Linux so users don't have to build it themselves
- Support for custom SVG templates to allow you to style the output
- Support for rendering animated PNGs
- Support for rendering animated SVGs

## Building and Running

To build you must have at least Rust 1.42+ installed. You can install it with [Rustup](https://rustup.rs/). Then Run

cargo build --release

After that the `cast2gif` program will be in the `target/release` folder.

Run `cast2gif --help` to get the usage instructions:

cast2gif 0.1.0
Zicklag
Renders Asciinema .cast files as gif, svg, or animated png.

USAGE:
cast2gif [FLAGS] [OPTIONS]

FLAGS:
-f, --force Overwrite existing output file
-h, --help Prints help information
-V, --version Prints version information

OPTIONS:
-c, --crop crop the recording while rendering. Specify crop in terminal cells as
`top=[int],left=[int],width=[int],height=[int]`.

ARGS:
The asciinema .cast file to render
The file to render to

## History

This project started after a [discussion](https://users.rust-lang.org/t/writing-an-asciinema-to-gif-tool/39450/15?u=zicklag) on the Rust forum.

## Alternatives

- [cast2gif](https://github.com/foubian/cast2gif) by @foubian
- A more polished alternative that runs in a web browser and has options for font-size and theme