asciinema / agg

asciinema gif generator
Apache License 2.0
1.12k stars 38 forks source link

Window Change Event #67

Closed yarona1993 closed 5 months ago

yarona1993 commented 5 months ago

no support to window change event or initial terminal size

ku1ik commented 5 months ago

There's support for overriding the initial terminal size: --cols + --rows options.

Regarding dynamic resizing throughout the recording: this is tricky because we can't dynamically change the GIF dimensions. With a fixed canvas size we'd need to perform scaling of each frame, which would likely produce text of low quality (either squashed or stretched/blurry), unless we change the rendering approach. In my opinion this is not worth the effort and therefore supporting dynamic resize is not planned.

Adamkadaban commented 4 months ago

For people looking for workarounds to this like I was:

While agg and asciinema play do not support resizing, asciinema-server does.

You can host your own server (and modify upload sizes etc.) and then just screen-record the output. The self-hosted website doesn't support changing speeds, so you can instead manually modify the speed in the file like this

Make sure to adjust your screen-recording fps to what is desired, especially if you plan to slow down your recording in post-processing

It's very hacky, but it works.

ku1ik commented 3 months ago

The self-hosted website doesn't support changing speeds

Indeed, there's no setting for speed, but it's such a simple and valuable thing. Not sure how I missed this. Will implement this soon.

However, you can append ?speed=N to the recording URL, like this: https://asciinema.org/a/645958?speed=4

More on this here: https://docs.asciinema.org/manual/server/sharing/#speed

ku1ik commented 3 months ago

Correction: I totally forgot but the speed setting is already there. It's there in the self-hosted version since v20240203.

KJ7LNW commented 2 weeks ago

With a fixed canvas size we'd need to perform scaling of each frame, which would likely produce text of low quality (either squashed or stretched/blurry)

+1, but no need to scale:

I think agg should scan the file for max row-x-col size, and just shrink if the terminal is smaller than the maximum. No scaling of the image, just unused space in the framebuffer when the terminal is smaller.

Re-open?