asciinema / agg Goto Github PK
View Code? Open in Web Editor NEWasciinema gif generator
License: Apache License 2.0
asciinema gif generator
License: Apache License 2.0
I have recorded the same sequence of commands on different hosts.
This one looks great (apart from that missing emoji):
I would like to adjust the size of this window post-recording. Is that possible?
FTR:
agg --version
agg 1.2.0
uname -a
Linux x22 5.15.58 #1-NixOS SMP Fri Jul 29 15:25:34 UTC 2022 x86_64 GNU/Linux
agg --speed=2 --font-size=24 --theme=monokai dagger-install.cast dagger-install-loop.gif
gifsicle --no-loopcount dagger-install-loop.gif > dagger-install.gif
Thank you!
Attaching the original cast files as zip 👉 dagger-install-casts.zip
I have a cli application with spinner and I also use some unicode characters such as “🤖” (U+1F916) and “⠸“.
They show up as outline rectangles instead. I have also tried to use Nerd Font by specify custom --font-dir
and --font-family
WebP offers the same quality and also animations, but needs way less data. (One GIF of mine was 171 KB and the same as WebP was just 13 KB)
To make life of the project maintainers easier please submit bug reports only.
This is bug tracker for asciinema gif generator (aka agg). If your issue seems to be with another component (cli recorder, js player, server) then open an issue in related repository.
Ideas, feature requests, help requests, questions and general discussions should be discussed in project's Discussions instead: https://github.com/orgs/asciinema/discussions
If you think you've found a bug or regression, go ahead and delete this message and fill in the details below.
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Versions:
Additional context
Add any other context about the problem here.
Describe the bug
When I generate a gif it is very blurry. This is the case no matter how much I increase the font size.
To Reproduce
Steps to reproduce the behavior:
cargo install --git https://github.com/asciinema/agg
agg 620649.cast output.gif
Expected behavior
I expected a gif to be generated with non-blurry text, similar to the demonstration examples in the README.
Versions:
Additional context
Output of -v
:
[INFO agg] terminal size: 59x18
[INFO agg] selected font families: ["DejaVu Sans Mono", "DejaVu Sans"]
[INFO agg] selected theme: dracula
[INFO agg] gif dimensions: 514x372
93 / 93 [=================================================================================================================================================] 100.00 % 203.99/s
[INFO agg] rendering finished in 0.45609793s
This seems to be because naersk
is setting a wrong meta.mainProgram
(ie., includes version string unnecessarily)
❯ nix run github:asciinema/agg
error: unable to execute '/nix/store/4vwhkp4c8vdxv3j0yr0llv5dc0h5r0jg-agg-1.4.2/bin/agg-1.4.2': No such file or directory
❯ ls /nix/store/4vwhkp4c8vdxv3j0yr0llv5dc0h5r0jg-agg-1.4.2/bin
agg
Describe the bug
The resulting Gif's initial frames contain a bunch of output which in reality takes much longer to actually be outputted.
To Reproduce
Steps to reproduce the behavior:
agg
to render into a Gif: agg 589983.cast 589983.gif
Expected behavior
For the recording as shown on the web and the rendered Gif to be somewhat similar.
Versions:
Thanks for maintaining this project. I get this build error:
$ cargo install --path .
...
Compiling agg v1.3.0 (/Users/simon/src/DEVTOOLS/agg)
error[E0616]: field `background` of struct `Pen` is private
--> src/renderer/fontdue.rs:148:38
|
148 | if let Some(c) = pen.background {
| ^^^^^^^^^^ private field
|
help: a method `background` also exists, call it with parentheses
|
148 | if let Some(c) = pen.background() {
| ++
...
$ cargo --version
cargo 1.67.1 (8ecd4f20a 2023-01-10)
$ rustc --version
rustc 1.67.1 (d5a82bbd2 2023-02-07)
First of all, thanks for making this tool! I'm really glad to see a modern replacement to asciicast2gif
, and using it has been incredibly easy!
This is a partial dupe of #2, except on macOS instead of Linux.
When I try to render this asciicast with a build of the latest main
and the font workaround in #2:
./target/release/agg 524144.cast abi3audit.gif --font-dir=~/Downloads/Noto_Emoji/static/
I get frames that are still missing emoji:
whereas my expected output is something like that on the asciinema website, but with B&W emoji instead:
I downloaded the Noto Emoji fonts from the same Google Fonts source as in #2, and I can confirm that they're actually present at that directory:
$ ls ~/Downloads/Noto_Emoji/static/
NotoEmoji-Bold.ttf NotoEmoji-Regular.ttf
NotoEmoji-Light.ttf NotoEmoji-SemiBold.ttf
NotoEmoji-Medium.ttf
Please let me know if there's any additional information I can provide, and thank you in advance!
With a (very much default) starship (https://starship.rs/ - from cargo install starship
) installation, the prompt contains a Vagrant symbol in the KDE konsole
output proper.
The agg
rendition of a screen cast does not show the Vagrant symbol, but a plain rectangle - see the very very right of the prompt.
konsole
is configured to use Cascadia Console PL 10pt
(https://github.com/microsoft/cascadia-code) and shows
My emoji fonts are google-noto-emoji-color-fonts.noarch
, google-noto-emoji-fonts.noarch
.
All fonts are system fonts, as managed by Fedora Linux 36 (dnf install ...).
asciinema
recording: starship.cast.zip
agg
(43977bf) generates from agg starship.cast starship.cast.gif
I believe I got the font configuration consistent and correct, on the system, in konsole
, and for agg
I cloned your repo on a Debian 11 (ARM) and typed cargo build -r
as you state in your README.md.
The argument "-r" is not known by that version.
It doesn't work also without the "-r".
error: failed to parse manifest at `/home/user/Downloads/agg/Cargo.toml`
Caused by:
failed to parse the `edition` key
Caused by:
this version of Cargo is older than the `2021` edition, and only supports `2015` and `2018` editions.
Installing a newer version of cargo is not the point here. Please just update your README.me file to mention that restriction.
Describe the bug
When rendering the cast containing icons from Nerd Fonts, the icons are not displayed in the resulting gif.
To Reproduce
Steps to reproduce the behavior:
ascinema play /tmp/test.cast
. Nerd Font icons are displayed properly.agg --font-family 'FiraCode Nerd Font' /tmp/test.cast /tmp/out.gif
.firefox /tmp/out.gif
.Expected behavior
Icons are supposed to be visible the same way as when using ascinema play /tmp/test.cast
Versions:
Additional Context:
agg -vvv --font-family 'FiraCode Nerd Font' /tmp/test.cast /tmp/out.gif
[INFO agg] terminal size: 135x34
[INFO agg] selected font families: ["FiraCode Nerd Font"]
[INFO agg] selected theme: dracula
[DEBUG agg::renderer::fontdue] looking up font for families=["FiraCode Nerd Font"], weight=400, style=Normal
[DEBUG agg::renderer::fontdue] found font with id=ID(380)
[INFO agg] gif dimensions: 1180x686
[DEBUG agg::renderer::fontdue] looking up font for families=["FiraCode Nerd Font"], weight=700, style=Normal
[DEBUG agg::renderer::fontdue] found font with id=ID(440)
[DEBUG agg::renderer::fontdue] looking up font for families=["FiraCode Nerd Font"], weight=400, style=Normal
[DEBUG agg::renderer::fontdue] found font with id=ID(380)
2 / 2 [======] 100.00 % 5.05/s [INFO agg] rendering finished in 0.39664295s
Hello,
Is there a way to control the font fallback?
I tried to use --font-family 'Source Code Pro, Hack Nerd Font Mono
but Arial Unicode MS
is picked
[2023-02-23T22:29:23Z WARN usvg::text::shaper] Fallback from Source Code Pro to Arial Unicode MS.
This is when using the resvg
renderer
In ubuntu WSL:
$ agg /tmp/tmpwgt1f50h-ascii.cast demo.gif
Error: no faces matching font family JetBrains Mono,Fira Code,SF Mono,Menlo,Consolas,DejaVu Sans Mono,Liberation Mono
the recording was created with the default asciinema rec
command
Could you please fix the command for pulling the docker image of agg? It seems to not work.
Describe the bug
I wanted to create a gif of my gimoji project in action to put in the README. However, turns out that agg
is for some reason not able to render the emoji characters. Attaching both the cast (had to mart it as txt to satisfy Github) and generated gif.
To Reproduce
Steps to reproduce the behavior:
gimoji
run.Expected behavior
Emojis to be there in the gif.
Versions:
Caused by:
failed to load source for dependency vt
Caused by:
Unable to update https://github.com/asciinema/vt-rs.git?tag=v0.5.0#dd885473
I change Cargo.toml and removed vt's tag (using vt v0.5.0 (https://github.com/asciinema/vt-rs.git#c25b2c30)) and it builds OK
I needed to use ImageMagick (mogrify -loop 0 <gif>
) to add looping 🤔
Looping absent both without --no-loop
and with --no-loop=false
.
For context, I've used the following agg
command:
theme=000000,ffffff,000000,ff0000,00ff00,ffff00,00ffff,ff00ff,00ffff,d9d9d9,4d4d4d,ff0000,00ff00,ffff00,00ffff,ff00ff,00ffff,ffffff
agg --speed=0.75 --theme="$theme" \
--cols=122 --rows=35 \
--font-size=14 --line-height=1.2 \
"$cast_path" "$gif_path"
I can provide more details if needed.
Describe the bug
Hi! Thanks for making asciinema and agg and sharing them as Software Libre! 🙏
I recorded some cast file with asciinema 2.3.0, fed it to agg and it panicked. Note the "width": 0, "height": 0
, those were produced by asciinema from…
export COLUMNS=90
export ROWS=20
…in the environment at recording time.
So now for the crashing agg:
# RUST_BACKTRACE=1 ~/.cargo/bin/agg ~/Desktop/bug.cast.txt out.gif |& sed "s,${USER},user123,"
thread 'main' panicked at /home/user123/.cargo/git/checkouts/avt-68339788ba7d673e/28aed2b/src/buffer.rs:80:13:
index out of bounds: the len is 0 but the index is 0
stack backtrace:
0: rust_begin_unwind
at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/panicking.rs:595:5
1: core::panicking::panic_fmt
at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/panicking.rs:67:14
2: core::panicking::panic_bounds_check
at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/panicking.rs:162:5
3: <avt::terminal::Terminal as avt::parser::Executor>::print
4: avt::vt::Vt::feed_str
5: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
6: std::thread::scoped::scope
7: agg::run
8: agg::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
4 / 4 [=====================================================] 100.00 % 221.70/s
# sed -n '79,81p' ~/.cargo/git/checkouts/avt-*/*/src/buffer.rs
pub fn print(&mut self, (col, row): VisualPosition, cell: Cell) {
self[row].print(col, cell);
}
To Reproduce
~/.cargo/bin/agg bug.cast.txt out.gif
Expected behavior
No panic
Versions:
https://github.com/asciinema/agg#ec02812e
) — ec02812eAdditional context
Please see description
In most of my scenarios, I specify filename in advance when record terminal session, sometimes the name is very long, and it's a bit cumbersome and not very convenient to specify the output name frequently when converting. It will be convenient that generated a default output filename based on the input filename ; )
Is it possible ?
Hi,
I just found out about this project, and it’s pretty cool! Awesome work.
I have been looking at tools for recording terminal sessions for a few months now and I’ve been playing around with marionebl’s svg-term-cli to get very small razor sharp animations. However I am encountering some bugs and the project does not look maintained anymore (last commit was in july 2019). So I have been looking at alternatives and agg stood out. However, it sounds like the goal is to only export to gif, not svg animations, so I was wondering if that could be considered as an extension for this project? I would like to give it a go, but I was wondering if there are any inherent limitations that might make it incompatible with the way agg is implemented.
Cheers
can I install agg via 'cargo install' instead of 'git clone then cargo build -r' instead? Thanks.
Describe the bug
Hi, thanks for creating such an awesome tool.
I apologize in advance if this is a user error, but I can't seem to figure it out. When recording a ▄ character in the terminal, the background/foreground render unexpectedly and unpredictably (there seems to be some kind of overlap in the colors where there shouldn't be).
The corresponding .cast
playback looks as I would expect it to. Here are some examples:
To Reproduce
Steps to reproduce the behavior:
agg
Expected behavior
No background/foreground overlap should occur
Versions:
Output with verbose flag:
[INFO agg] terminal size: 140x35
[INFO agg] selected font families: ["JetBrains Mono", "Fira Code", "DejaVu Sans Mono", "Liberation Mono", "DejaVu Sans"]
[INFO agg] selected theme: dracula
[INFO agg] gif dimensions: 1193x706
I generate the gif with agg
, then disable looping with gifsicle
.
Is it possible to disable looping from agg
, without running gifsicle
afterwards?
Have:
agg cool.cast cool-loop.gif
gifsicle --no-loopcount cool-loop.gif > cool.gif
Want:
agg --no-loop cool.cast cool.gif
Thank you!
When I use Chinese in terminal it looks fine like this
But when I render it as a gif using agg , the Chinese becomes weird
agg --renderer resvg --font-dir "${HOME}/.local/share/fonts/MesloLGS NF" --font-family "MesloLGS NF" demo.cast demo.gif
If I use fontdb
as renderer, then Chinese will not be displayed.
Convert to video?
Hello,
First of all, thanks for all your work, agg has been really useful for me.
I'm trying to create gifs with a larger font size, but I do not seem to be getting the expected result. If I create a gif with the default size with the command agg recording gif-file
and then another with agg --font-size 28 recording gif-file
I get two gifs of different resolutions (the one with the --font-size argument has higher resolution), but when opening both of them in full screen, the text appears in both sizes. I've tried both supported renderers and I get the same result.
Describe the bug
agg
failed on using default font or stuck when using custom font.
To Reproduce
Steps to reproduce the behavior:
agg demo.cast demo.gif
or agg demo.cast demo.gif --font-family "Cascadia Mono"
Error: no faces matching font families JetBrains Mono,Fira Code,SF Mono,Menlo,Consolas,DejaVu Sans Mono,Liberation Mono
or stuck if font provided into --font-family
is exist.Expected behavior
Convert asciicast file into a gif file.
Versions:
Additional context
-
Describe the bug
cargo install --git https://github.com/asciinema/agg
leads to
error: failed to parse manifest at `/Users/chattershuts/.cargo/git/checkouts/agg-d92013fdd4380564/39223d5/Cargo.toml`
Caused by:
feature `edition2021` is required
this Cargo does not support nightly features, but if you
switch to nightly channel you can add
`cargo-features = ["edition2021"]` to enable this feature
To Reproduce
cargo install --git https://github.com/asciinema/agg
Expected behavior
I expect the command to successfully install agg
Versions:
(Sidenote: very pleased to discover this official tool from the asciinema team to render recordings to video. Small file sizes, no notable compression artifacts, written in Rust, good job guys!)
Describe the bug
agg
seems to have trouble rendering some Nerd Font characters that otherwise render normally for me. Here's a comparison of GIF render vs. web player:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The character should render correctly in the GIF as well.
Versions:
Additional context
I used the Windows Terminal app.
As reported in #41 I'm not able to build agg on Debian 11 because the build system on Debian 11 (which is currently the latest stable) is to old for your repo.
For someone who is not familiar with rust eco system how can I build your software?
Or is there a pre-build deb-file for Debian 11?
Build and install rust/cargo from upstream is not recommended on any GNU/Linux distro. Hope there is a more elegant way. But if not maybe you should explain (or link) how to do this. e.g. https://doc.rust-lang.org/cargo/getting-started/installation.html ? Your README mention "rustup" which is unclear what it is. Looks like a Windows binary.
hello again 👋,
ran this cmd locally for the first this afternoon after creating the below cast.
https://asciinema.org/a/515723
i used the cmd supplied by the readme after creating the cast.
agg freecad.reset.repo.cast freecad.reset.repo.gif
i used the below cmd to create cast,
asciinema rec -i=2 ~/media/movies/my.recordings/asciicasts/freecad.ascii.recordings/freecad.reset.repo.cast
i use the -i=2
to hopefully only allow 2 seconds of "dead space", but i don't think this program agg
is reading the cast file properly and is not processing the "strip out dead space" between movement.
below is the gif that is created from running the above cmd
after creating that gif there is significant delay between commands run in the cast.
and can be seen / verified by importing / opening the gif in a video editor such as shotcut
looking at the above image / gif that was created with agg
the length of the file / timecode is ~ 4 minutes and 11 seconds.
that same asciicast is only ~ 1 minute and 20 seconds.
first off, thanks for spending the time to make this project. i'm sure i'll come back to it from time to time to make a gif that can be embedded into a github repo. that said github recently started supporting movie based file formats. the movie i believe has to be under 10MB or less. but would you have a recommendation for converting an asciicast to h264 video file format or converting the gif to a video file format?
thanks again for putting this together.
Hello,
First of all thanks for creating this tool, especially the new --font-dir
and --font-family
flags are a welcome improvement compared to asciicast2gif
. This allows the creation of GIFs with nerdfont icons.
Would you consider adding an installation note to your README for macOS users via Homebrew. Formula was added on 30/Aug/22.
Shall I do a PR ?
PS: ...and maybe consider adding the bump-homebrew-formula-action workflow to your release.yml
.
First off thank you so much for this! I am looking to add some animated demos to a presentation that I am giving this week and this will work super well!
It would be super cool if you could point agg
at a URL such as https://asciinema.org/a/123456 and have it convert it without having to manually download the .cast file. This would let you save your recordings to asciinema.org and then convert them to a gif locally with ease.
Describe the bug
Check asciinema/asciinema-player#52
To Reproduce
Steps to reproduce the behavior:
#!/bin/bash
printf "\n"
printf " _ __ __ \e[2m______ _ __ \e[0m\n"
printf " / | / /___ _________ ___ ____ _/ / \e[2m/ ____/___ _(_)___ / /_\e[0m\n"
printf " / |/ / __ \/ ___/ __ ´__ \/ __ ´/ / \e[2m/ /_ / __ ´/ / __ \/ __/\e[0m\n"
printf " / /| / /_/ / / / / / / / / /_/ / / \e[2m/ __/ / /_/ / / / / / /_ \e[0m\n"
printf "/_/ |_/\____/_/ /_/ /_/ /_/\__,_/_/ \e[2m/_/ \__,_/_/_/ /_/\__/ \e[0m\n"
printf "\n"
Expected behavior
The gif works same as asciinema player.
Versions:
When invoking agg --font-family "CaskaydiaCove Nerd Font" starship.cast starship.cast.gif
, I get Error: no faces matching font family CaskaydiaCove Nerd Font
"CaskaydiaCove Nerd Font" is, effectively, the Cascadia Console font - downloaded enriched as a nerd font from https://www.nerdfonts.com/font-downloads
This has been installed as a personal font on my KDE Plasma 5.25 desktop (Fedora 36); physically this font and its siblings live in ~/.fonts/c
, as
~/.fonts/c
❯ ll
total 151324
-rw-r--r-- 1 stefan stefan 2435640 Sep 26 09:40 Caskaydia_Cove_Nerd_Font_Complete_Bold_Italic.otf
-rw-r--r-- 1 stefan stefan 2624736 Sep 26 09:40 Caskaydia_Cove_Nerd_Font_Complete_Bold.otf
-rw-r--r-- 1 stefan stefan 2428652 Sep 26 09:40 Caskaydia_Cove_Nerd_Font_Complete_ExtraLight_Italic.otf
-rw-r--r-- 1 stefan stefan 2607260 Sep 26 09:40 Caskaydia_Cove_Nerd_Font_Complete_ExtraLight.otf
-rw-r--r-- 1 stefan stefan 2437340 Sep 26 09:40 Caskaydia_Cove_Nerd_Font_Complete_Italic.otf
Is this a case of these fonts being installed as personal fonts?
Version affected is
agg --version
agg 1.3.0
compiled from source (43977bf, 2022-09-17).
Cargo's suggested way right now is to do cargo install --path .
maybe updating the doc would be great for people who are using it.
no support to window change event or initial terminal size
Describe the bug
The Japanese kana are not rendering in the gif but they do in the .cast file.
To Reproduce
Steps to reproduce the behavior:
asciinema rec demo.cast
agg demo.cast demo.gif
Expected behavior
The Japanese letter should render.
Versions:
Additional context
Please find attach a zip with a .cast, .gif and the associated txt recorded.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.