Skip to content
This repository has been archived by the owner on Jun 16, 2020. It is now read-only.

How are animations themselves timed? #32

Closed
cookiengineer opened this issue Jul 4, 2018 · 2 comments
Closed

How are animations themselves timed? #32

cookiengineer opened this issue Jul 4, 2018 · 2 comments

Comments

@cookiengineer
Copy link

The title itself explains it.

I'm currently fiddling around with the SVG file in order to understand it better and to be able to manually save some space that I do not need (e.g. with detailed progress bars that can be accelerated).

Is there a way to tweak the "smoothness" of the details of e.g. a curl progress bar? I guess my SVG files get so big (> 2MB) because of those, as they seem to be in there with each sub-sub-percentage as a separate <text> element.

@nbedos
Copy link
Owner

nbedos commented Jul 4, 2018

The replay function takes a parameter named min_frame_duration which enforces a minimum duration for each frame. You could set it to say 0.100 seconds to reduce the number of frames and the size of the animation. This parameter can't be set on the command line though, you would have to modify the code.

def replay(records, from_pyte_char, override_theme, fallback_theme, min_frame_duration=0.001, last_frame_duration=1):

You might also want to check out the output of termtosvg record. It's the raw output of the recording with timing information (before it is aggregated by replay())

There is also a lot of duplicated information in the SVG animation itself. It does not help reduce the file size.

@cirocosta
Copy link

Hey @cookiengineer , as @nbedos pointed out, maybe it's indeed better to not go for that in the final svg output, but instead, in the middle (the cast file).

Wanting to tweak my recordings, I created asciinema-edit - it takes a cast (which termtosvg produces) and then performs a transformation that you might want.

For instance, in your case, you could open the cast with a terminal, remove the pieces you find either too repetitive and then later fix the timestamps with asciinema-edit quantize.

I hope it helps.

thx!

@nbedos nbedos closed this as completed Jul 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants