Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gif output support #36

Open
piaoger opened this issue Mar 28, 2018 · 13 comments
Open

Gif output support #36

piaoger opened this issue Mar 28, 2018 · 13 comments
Labels

Comments

@piaoger
Copy link

piaoger commented Mar 28, 2018

I might be a good idea to build a new tool or sub-command which convert cast to gif(or svg). Original asciinema2gif is useful but installing deps is boring :)
asciinema2gif: link

@LegNeato
Copy link
Owner

I think it could go in this tool. I see two logical entry points:

  1. For new recordings: asciinema rec /path/to/file.cast --format gif/svg/whatever
  2. For existing recordings: asciinema convert /path/to/file.cast --format gif/svg/whatever

@LegNeato LegNeato changed the title build a new tool or subcommand similar to asciinema2gif Gif output support Mar 28, 2018
@LegNeato LegNeato added enhancement New feature or request output formats labels Mar 28, 2018
@LegNeato
Copy link
Owner

LegNeato commented Mar 28, 2018

Some quick notes after investigation:

@LegNeato LegNeato added the hard label Mar 28, 2018
@LegNeato
Copy link
Owner

LegNeato commented Apr 3, 2018

I've been poking at this and have been able to render a static image using alacritty. There are some outstanding issues but nothing that can't be resolved, so this is definitely going to be possible somewhat soon.

output

@LegNeato
Copy link
Owner

LegNeato commented Apr 4, 2018

Update: I got gif support working, including clamping to 60fps and having proper duration between frames to keep file size down:

output

I'm going to clean it up a bit, report my findings to alacritty so they can merge their WIP diff, and then we will support gifs!

@piaoger
Copy link
Author

piaoger commented Apr 17, 2018

It seems we can have gif support soon🤔

@piaoger
Copy link
Author

piaoger commented Apr 17, 2018

not sure if gifski is helpful which is gapl licensed.
https://github.com/ImageOptim/gifski

@polyzen
Copy link

polyzen commented Jul 14, 2018

There are also (Node) projects that render as SVG:
https://github.com/marionebl/svg-term-cli
https://github.com/derhuerst/asciicast-to-svg

Would outputting multiple filetypes in one invocation be a good idea?

@ku1ik
Copy link

ku1ik commented Jul 18, 2019

I've implemented a minimal virtual terminal in Rust for asciinema recently, for the purpose of integrating it into web player (rust-wasm) and screenshot generation: https://github.com/asciinema/vt-rs

It's working nicely, although I haven't had a chance of preparing README, publishing to crates.io, nor integrating into web player. Not sure if useful to you at this stage but I thought mentioning it won't hurt :)

@LegNeato
Copy link
Owner

Sweet, looks awesome! I'll look into integrating, the alacritty changes have stalled.

@zicklag
Copy link

zicklag commented Mar 14, 2020

I've just started working on finding a way to render gif's. I'm posting what I find in a forum topic.

I think it might be simple enough to support SVG, animated PNG, and Gif with one solution.

I'm going to try to put the converter logic into its own crate lib/cli because I think it would be useful to people who still want to use the normal asciinema CLI, but we can also include the crate as a library to asciinema-rs so that it is built-in to this tool as well.

@piaoger
Copy link
Author

piaoger commented May 24, 2020

Found someone using this tool:
https://github.com/nbedos/termtosvg

@zicklag
Copy link

zicklag commented May 24, 2020

@piaoger Yes, I've used that before. It is very nice. My biggest problem came when I needed to paste a recording into GitHub and they for some reason don't support SVG in comments!

I forgot to post an update by my https://github.com/katharostech/cast2gif/ program is actually basically working. It needs some new features to be a little nicer, but it is functional now. It's a rust crate so we could incorporate it into asciinema-rs.

@piaoger
Copy link
Author

piaoger commented May 24, 2020

@zicklag
yes. I found cast2gif and you also mentioned termtosvg in the post after that.Let me try asciinema-rs and cast2gif together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants