Coder Social home page Coder Social logo

katharostech / cast2gif Goto Github PK

View Code? Open in Web Editor NEW
29.0 4.0 6.0 3.13 MB

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

License: Other

Rust 100.00%
gif gif-animation gif-creator asciinema cast asciinema-player rust

cast2gif's Introduction

Cast2Gif

A tool to convert 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.

Example Recording

Here is an example of a GIF created with cast2gif:

example

Full Example

Here is a recording showing how to record a clip with Asciinema and render it with cast2gif:

tutorial

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. 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 <[email protected]>
Renders Asciinema .cast files as gif, svg, or animated png.

USAGE:
    cast2gif [FLAGS] [OPTIONS] <cast_file> <out_file>

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

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

ARGS:
    <cast_file>    The asciinema .cast file to render
    <out_file>     The file to render to

History

This project started after a discussion on the Rust forum.

Alternatives

  • cast2gif by @foubian
    • A more polished alternative that runs in a web browser and has options for font-size and theme

cast2gif's People

Contributors

ddystopia avatar dependabot[bot] avatar edeneast avatar jarrodsfarrell avatar piaoger avatar zicklag avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cast2gif's Issues

Documentation and usage instructions

Hi,

Thank You for this project that you created. I had fun learning rust and how to compile the application. I want to request that you add a few instructions in the README file to help others on how to compile the application and how to use it.

Regards

Can't build with old Rust

Rustc 1.39.0

   Compiling gif-dispose v2.3.0
error[E0658]: use of unstable library feature 'inner_deref': newly added
  --> /home/danbst/.cargo/registry/src/github.com-1ecc6299db9ec823/gif-dispose-2.3.0/src/screen.rs:74:29
   |
74 |         self.blit(local_pal.as_deref(), frame.dispose,
   |                             ^^^^^^^^
   |
   = note: for more information, see https://github.com/rust-lang/rust/issues/50264

Please add also Rust version which it should be built with (yeah, I know I should use nightly, but still would be great for r13y(reproducibility)).

Continuous Integration

Hi,

I think to automate building you could have setup the Github Actions in a flow:

  • Whenever a tag is pushed -> Build a version -> Archive artifacts -> (optionally) Attach artifacts to releases tab (I don't know if its possible)

I didn't use Github Actions yet, but I see it can store artifacts like Jenkins: https://docs.github.com/en/actions/configuring-and-managing-workflows/persisting-workflow-data-using-artifacts

Maybe some evening I can try to play with it and push some PR.

Failed to buld cast2gif

error[E0432]: unresolved import `font_kit::loaders::freetype`
 --> src/frame_renderer/fontkit.rs:6:14
  |
6 |     loaders::freetype::Font,
  |              ^^^^^^^^ could not find `freetype` in `loaders`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0432`.
error: could not compile `cast2gif`.

Env:

stable-x86_64-apple-darwin (default)
rustc 1.43.0 (4fb7144ed 2020-04-20)

cast2gif crashes on FreeBSD

Hello,

I've compiled cast2gif on FreeBSD 12.2 (amd64) using Rust 1.47.0 without any warnings/errors.

I got an error/crash when I execute:
./cast2gif ~/test.cast /tmp/test.gif
Illegal instruction (core dumped)

What should I do to help debugging this problem?

Thanks,

Nuno Teixeira

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.