marionebl / svg-term-cli

Share terminal sessions via SVG and CSS
MIT License
3.48k stars 116 forks source link

Setting the speed of an asciinema cast SVG? #36

Open dhimmel opened 5 years ago

dhimmel commented 5 years ago

We're using this utility to create animated SVGs of a terminal recording, as per https://github.com/greenelab/manubot/issues/63 and https://github.com/greenelab/manubot/pull/64.

Is it possible to change the speed (i.e. increase / decrease framerate) of the SVG export? I am looking for an equivalent of asciinema's speed parameter, e.g. https://asciinema.org/a/205085?speed=2.

marionebl commented 5 years ago

That is a great suggestion - currently this is not implemented but shouldn’t be to hard to change that.

We would need to

Want to lend a hand?

dhimmel commented 5 years ago

Hey @marionebl thanks for the straightforward explanation of how to implement this. I have little JS experience, but this seems like a good opportunity for me to learn if you're willing to review / help if I get stuck.

Before I get started, would you mind adding a LICENSE.md file (example) to the repo with the MIT License text? The MIT license terms require

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

marionebl commented 5 years ago

Before I get started, would you mind adding a LICENSE.md file (example) to the repo with the MIT License text? The MIT license terms require

@dhimmel Thanks for the reminder, added it via https://github.com/marionebl/svg-term-cli/commit/fcedbdb2dc5f8b21b8ff6017ab4ced7b3878e8d5.

[...] I have little JS experience, but this seems like a good opportunity for me to learn if you're willing to review / help if I get stuck.

I'm happy to help and unblock you during the process 👍

Benjamin-Lee commented 5 years ago

@dhimmel let me know if you need any help with this. I'm a javascript beginner as well but needed this feature today so I'm happy to contribute.

dhimmel commented 5 years ago

I was looking forward to trying this out, but just haven't had the time and it's been a few weeks... So I'd say go ahead and if you make the enhancement that's great, but if not maybe I'll find time in the future. Cheers

On Sun, Oct 28, 2018, 2:57 AM Benjamin Lee notifications@github.com wrote:

@dhimmel https://github.com/dhimmel let me know if you need any help with this. I'm a javascript beginner as well but needed this feature today so I'm happy to contribute.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/marionebl/svg-term-cli/issues/36#issuecomment-433681355, or mute the thread https://github.com/notifications/unsubscribe-auth/ABEOBx_8EpH8XRY2Hm7g2wYikEi_TV4Fks5upVVCgaJpZM4XMErn .

ssmirr commented 5 years ago

in svg-term: divide the animation-duration by the specified speed https://github.com/marionebl/svg-term/blob/d376d203cb331e34d152aeeb064eb0a430c164bf/src/index.tsx#L120-L125

@marionebl I tried your suggestions, but this ^ seems to only create animation from the first duration/playback-speed of the recording. Do you have other suggestions for this?

miraclx commented 4 years ago

As a workaround, you can re-record the cast

asciinema rec final -c "asciinema play recording --speed 2"

And thereafter, use svg-term to compile

svg-term --in final --out final.svg