Asciinema CLI 3.0 rewritten in Rust, adds live streaming, upgrades file format

259 pointsposted 6 hours ago
by ku1ik

54 Comments

x187463

4 hours ago

Asciinema is awesome. I use it to capture all of the demos for TerminalTextEffects. Their Asciinema GIF Generator tool (AGG) produces high quality terminal recording GIFs by processing the asciicast file. This is the best solution I've found for producing short terminal recordings that can be shared in a README/docs as seen in the TerminalTextEffects repo/docs.

Using the raw file output and/or termsvg type solutions do not work for TTE due to the huge amount of data being written to stdout.

https://docs.asciinema.org/manual/agg/

https://github.com/ChrisBuilds/terminaltexteffects

echelon

4 hours ago

I just wanted to say this is absolutely gorgeous. I don't know if I have a use for this, but I love it and please keep doing this. It's mesmerizing and beautiful.

TTE reminds me of Compiz window manager from eons ago, the thing that got me to ditch Windows for Linux, except for the terminal.

Is there a way you can add something like TTE to tmux or vim as a screen saver or something that would trigger occasionally but not all the time? Do you pipe it? Make aliases?

How do you typically use it? What was your intent when you first wrote it, and what do you use it for now?

Keep it up!

jcul

3 hours ago

t-rec is another great tool, which can record any window and produce a video or a gif.

Not quite the same thing, but sometimes I find it easier if I just want to share a gif of a terminal.

ku1ik

4 hours ago

asciinema.org is currently being hugged to death! The btop stream is from one of the servers, currently reporting 95% CPU usage: https://asciinema.org/s/olesiD03BIFH6Yz1

But it's chugging along!

asciinema server is Elixir/Phoenix, runs on BEAM, and even with lots of connections and high CPU usage it serves request fine. Power of the BEAM. Phew.

Currently it runs on just 2 VMs, 2 GB of RAM each, so I will probably need to scale it up very soon anyway :)

ku1ik

17 minutes ago

Just scaled it up, seems pretty stable and responsive again.

darkamaul

3 hours ago

In an age where everything is about clouds, it’s pretty amazing to see a high-profile service like this running smoothly on just a couple of 2 GB VMs. That’s less RAM than a mid-range laptop, and those machines struggle to run a modern browser.

imiric

an hour ago

Modern hardware in conjunction with smart software choices can be very capable, but it's pretty negligent to run a service people depend on with such limited resources.

Sure, not every site needs to run on a highly-available elastic cluster of nodes, but the alternative mindset of actively rejecting this architecture is arguably even more harmful.

A healthy deployment should be able to scale up and down easily, if not automatically. I wouldn't want to be woken up at 3am because prod1 needs a CPU/RAM/disk increase and a reboot, and the users wouldn't like that either.

phaer

an hour ago

Sounds preferable compared to be woken up at 5 am by your cloud providers billing alert.

mayli

an hour ago

That btop stream is lagging hard now, and jumping between full cpu and idle 0%.

Is the service crashing and restarting?

ku1ik

22 minutes ago

I was adding more VMs and restarting load balancer. Should be good now.

Yoric

3 hours ago

Long live the BEAM!

imiric

an hour ago

Tip: you might want to decrease the btop refresh rate. It's likely that at 100ms a considerable amount of CPU time is taken up by btop itself.

ku1ik

43 minutes ago

The CPU usage was single digit (%) with no viewers (but other requests being served) with btop at 100ms, so that's not adding a lot. But thanks!

lostmsu

3 hours ago

Thanks for the great service! Is there a way to mirror the streams? Like a Wikipedia dump?

kincl

2 hours ago

The Asciinema clients have now gone from Python to Golang back to Python now to Rust

https://docs.asciinema.org/history/

https://blog.asciinema.org/post/and-now-for-something-comple...

imiric

2 hours ago

That's... interesting.

Most of the gripes about Go could've been apparent before a single line was written, with just some preliminary research. The packaging issues are valid for 2016, even though they are now resolved with Go modules.

Then the rewrites in ClojureScript, Elixir, and now Rust... Sheesh. All this tells me is that the authors are trend chasers rather than solid engineers, which erodes any trust I had in this project.

nicoburns

2 hours ago

> All this tells me is that the authors are trend chasers rather than solid engineers, which erodes any trust I had in this project.

Eh. I think my takeaway would be more that this is the authors passion / side project that they use to test and learn new languages.

ku1ik

42 minutes ago

> I think my takeaway would be more that this is the authors passion / side project that they use to test and learn new languages.

That's precisely it :) I believe I’ve finally found the ones that work well both for me and the project.

tanelpoder

5 hours ago

Asciinema is one of the best products/tools I’ve ever used. I mean the auth/upload CLI flow is so straight to the point and easy to use, despite having to cross a few layers (yep I know other CLIs have something similar, it’s just that Asciinema has never “gotten in my way” when doing something with it)

alkh

4 hours ago

This is great, congrats for such a huge accomplishment!

My only wish is if asciinema natively supported saving into svg or gif. This would allow you to easily add it to markdown files without the need to install side apps to convert the output to those formats.

jsheard

4 hours ago

> introducing terminal live streaming

Now we just need someone to develop ASCII-art vtuber avatars which overlay on top of the terminal.

ericdotlee

5 hours ago

My favorite elixir project of all time now written in Rust.

Love to see it.

Have you guys added the ability to cleanse / watch command strings for sensitive items like secrets, keys etc? Seems easier than ever with advances in lightweight LLMs.

ku1ik

4 hours ago

The CLI has been rewritten in Rust. The server is still Elixir/Phoenix - perfect for this feature.

jen20

5 hours ago

> My favorite elixir project of all time now written in Rust.

It was written in Python before, no?

PufPufPuf

4 hours ago

Yes, it's right there in the article.

jen20

4 hours ago

Indeed - it was an invitation to the original commenter to clarify what they thought Elixir had to do with it...

nixosbestos

5 hours ago

> Have you guys added the ability to cleanse / watch command strings for sensitive items like secrets, keys etc? Seems easier than ever with advances in lightweight LLMs.

Please this has to be satire, right?

rererereferred

4 hours ago

Some games have this feature called "streamer mode", where some text that would normally be on screen is removed, like username or party codes. Makes sense for a terminal to do the same for other sensitive data.

kevincox

4 hours ago

Would actually be nice to standardize an environment variable for this. Obviously not something that you should rely upon when running random tools but can be a nice failsafe.

data-ottawa

4 hours ago

It would be nice to censor my username from the prompt without changing my shell prompt.

No idea if it does this already though.

1718627440

3 hours ago

The file format is just plain text, you can use sed to change the username.

telotortium

5 hours ago

Why would it be satire? Seems like a real use case

ksherlock

3 hours ago

s/mysekretpassword/••••••••••••••••/g

What about that should involve a large language model?

QuantumNomad_

5 hours ago

I’ve sometimes heard Twitch streamers mention that they use two computers for streaming. One is the computer you are seeing on stream, and the other computer is running OBS and using a HDMI capture device.

With this new live streaming feature in Asciinema, I could imagine that a small subset of programming streamers could skip buying a HDMI capture device. Specially the kind of developer who works exclusively in the terminal. This small group of people could now stream their terminal from the dev machine to the OBS machine using Asciinema 3, instead of capturing HDMI output.

haunter

4 hours ago

That shouldn’t really matter for asciicinema streaming which 0 effect on any kind of performance.

The 2 device setup for game streaming was born because of the heavy CPU usage of x264 encoding. So you could have a PC for the game only while the streamig PC takes the encoding load.

But even then nowadays a lot of people moved on from that since you can use your GPU for encoding (Nvidia NVENC) which almost has 0% overhead and providing the same or slightly worse quality. Really OBS x264 should be only used for offline video recording say for a Youtube video

roganartu

4 hours ago

Another feature of this is that if your primary PC crashes, which happens sometimes especially with some games, your stream doesn’t go down too. This is more important for streams with more viewers and longer runtimes, as restarting the stream drops all the AFK viewers who may still be contributing ad revenue (or just boosting active viewer count which has other flow on benefits too).

You can see this effect in long streamathons/subathons as twitch automatically kills long streams so you’ll see multiday streams get cut up either manually by streamers or automatically by twitch every 24h or so, and the viewer count drops significantly and takes quite some time (many hours) to recover.

magicalhippo

4 hours ago

YouTube recompresses everything anyway so I found the higher quality you upload the better the result, especially for complex stuff like high-paced gameplay.

And at very high bitrates nvenc quality is just fine. It's mostly at the lower bitrates x264 really shines.

Of course for livestreaming there are different constraints.

0x457

4 hours ago

Twitch streamers do that because they are streaming GPU intensive workload (video game) that would compete with streaming software for GPU resources.

It also prevents driver crash caused by a video game to crash a stream.

QuantumNomad_

4 hours ago

Yeah that makes sense. I was thinking that the two computer setup was also something they did to keep their streaming stuff completely separate from the rest of their life, to not accidentally doxx themselves on-stream and to not accidentally execute malware on the same host they do their email and banking etc on.

rmccue

3 hours ago

Additionally, running on a different computer allows for eg adjusting scenes in OBS or moderating Twitch, without losing focus from the running app/game.

throawayonthe

4 hours ago

i think the setup you describe is used primarily to offload video encoding to a second pc, not something programming streamers (not running graphically intensive games) probably need not concern themselves with it

wolttam

3 hours ago

Oh I think I will be having some fun with the streaming capability. Sweet!

simlevesque

5 hours ago

The live btop demo is really cool !

Congrats on shipping.

AbuAssar

4 hours ago

Asciinema was previously written in python

fitsumbelay

4 hours ago

whoa the live streaming is a game changing game changer no Twitch content pun intended (tho possibly maybe it was ...)

renewiltord

4 hours ago

Wow nice release. Particularly impressive is the demo live stream of btop!

xyst

4 hours ago

The power of rust and proper architecture allows an underpowered 2 vCPU VM to stream contents to hundreds of people.

anamexis

3 hours ago

I think that would be the power of Elixir and the BEAM.

el_don_almighty

5 hours ago

I, for one, look forward to our new RUST overlords...