This is pretty awesome. I'm a big fan of both SVG animations and terminal recorders, so this is right up my alley. I previously built a small library called svganimator for creating smooth animations between static SVG images [1], used generated SVG animations to help design the Wayback Machine loading animation [2], and also put together a fairly comprehensive comparison of terminal recording solutions [3]. I'll need to update the comparisons to include termtosvg, I can't wait to try it out and see what the file sizes look like.
As others have mentioned, the major issue with SVG animations is that Microsoft doesn't plan to ever include support for them in Edge. This means that you either need to create fallbacks specifically for Microsoft browsers, or to disregard that portion of the market on your website. It's a real shame because SVG/SMIL allows you to create high quality animations which require a fraction of the bandwidth that would be necessary for comparable GIF or video files. [1] - https://github.com/sangaline/svganimator [2] - https://intoli.com/blog/designing-the-wayback-machine-loadin... [3] - https://intoli.com/blog/terminal-recorders/
Edge doesn't have an infinite budget, and they say they've tried to prioritize based on how common the standards are found used in the wild and how active the requests on UserVoice are. Doesn't look like there is even currently a tracked UserVoice for it:
It is on UserVoice [1], and it has over two thousand votes there. They've marked that as "sorry, no plans," and they've marked previous issues as "by design" [2]. They use Chrome announcing plans to deprecate SVG animations as their primary justification, but Chrome backtracked on those plans after realizing that there were important use cases that mattered to the community [3].
> In the 15 months since we announced our intention to deprecate and eventually remove SMIL, we’ve heard a variety of opinions from members of the community. We value all of your feedback, and it's clear that there are use cases serviced by SMIL that just don’t have high-fidelity replacements yet. As a result, we’ve decided to suspend our intent to deprecate and take smaller steps toward other options. I understand that they don't have an infinite budget, but it really seems like they made their mind up here years ago and haven't been interested in listening in the community since then. It's also a bit circular to "prioritize based on how common the standards are found used in the wild" when they're single-handedly responsible for preventing developers from using SVG animations "in the wild" in the first place. [1] - https://wpdev.uservoice.com/forums/257854-microsoft-edge-dev... [2] - https://developer.microsoft.com/en-us/microsoft-edge/platfor... [3] - https://groups.google.com/a/chromium.org/forum/#!msg/blink-d...
Honestly, if you're recording terminal sessions, it's probably fine to not support Edge. I doubt any significant portion of your audience is going to be using it, and even if they do, they're going to be perfectly understanding when you say "sorry, Edge doesn't support SVG animations, use a different browser".
Shitty of Microsoft, though. If they aren't going to support it, it's not going to be widely deployed. I expect better of the new and improved Microsoft.
OP here. Sadly, SVG file size is not as small as I'd want it to be. The main problem is that a few attributes (x, y and lengthAdjust) have to be repeated on each text tag to position each character at the right place. I can't use CSS for this since those attributes are not styling attributes.
Using SVG definitions efficiently to avoid duplication is also not as easy as I thought it would be. I have a few ideas on how to reduce file size, this is the next improvement I'm planning to work on. For the examples shown at [1], file size ranges from 56kB to 252kB, the worst case scenario being lots of single characters with different colors. [1] https://github.com/nbedos/termtosvg/blob/master/examples/exa...
I'd rather stick to plain SVG for the animation part, in case ECMAScript is stripped from the SVG for security reasons. ECMAScript might be worth adding for additional features though (play/pause, progress bar, frame seeking...)
My first thought was "this seems neat", and my second thought was: how hard would it be to write a small js script to play back "script"[s] output? Or, to take script output, convert it to some pre-tags and add js animation on top of that...
I suppose the main barrier would be lack of recorded timing information in script logs, so either pre-procesding or pause for input (say 50ms/keystroke + 200ms pr return/line-feed) and/or output (say 50ms pr line feed). Although, now I see there's a -t option for a timing file. So would seem one should be able to take logs from script, and produce svg, gif, png, webm, mp4... js output. [s] http://man7.org/linux/man-pages/man1/script.1.html
I did that in another way: write a demo script, and make it execute in another terminal. Snippet on GitLab [1].
Simply call it with "shell-demo DEMO_SCRIPT", and follow the instructions. Demo scripts examples are given aside the snippet. [1]: https://gitlab.com/snippets/1730340
Excellence! The README reads:
"I really like the clean look of SVG animations and I also wanted to see how this solution would hold out against other attempts at terminal recording such as asciinema."
But how does it compare? Is the size smaller, is it more efficient?
Animated SVG animations (really just an svg element + animated css) are significantly smaller, more efficient, and crisper than equivalent GIF animations. I wrote about the difference between the two here: https://hackernoon.com/presenting-your-code-beautifully-fdba...
As I explained in the above article, this is already possible with asciinema + svg-term-cli (https://github.com/marionebl/svg-term-cli). The one downside with animated SVGs is that they're not as compatible to be included anywhere as GIFs since they're really just html snippets.
Editing the HTML attribute to width=2000% is pretty sweet however because it's a vector. I'm guessing if the example wasn't in an image tag I could select the text too?
If you click on the example image to view it in a new tab, you can select the text there. It could be improved, afaict you can only select a single line of text at a time and if you select the current line being typed then the selection is cleared when that line is modified.
video codecs are not the right tool for this job. Consider subpixel-AA for fonts, partially transparent backgrounds, 4:4:4 instead of 4:2:0 and the ability to zoom as you mentioned.
Block artifacts are really annoying when you try to read something on screen recordings. And svg texts can be made selectable when not loaded as images, so you could copy straight from the recording.
This is great for many of the same reasons that asciinema is great -- smooth animation and selectable text. The resulting svg is orders of magnitude smaller than a gif would be.
How hard would it be to add some sort of pause button to aid in selecting from the capture? Also, it appears you can only select when you are viewing the image directly, not when it is embedded via an tag. Is that fixable? I guess maybe an
It would be good to adjust the failure mode so that if SMIL is not supported then at least a meaningful frame (probably the last, though scrolling makes it difficult to decide!) is shown, rather than just a blank rectangle.
Jesus, it's 2018 and they still can't even figure out how to implement animated PNGs? Real browsers had this 10 years ago. What the hell is wrong with Microsoft? Are they really just so incompetent, or is there a more insidious business reason why they don't want more animated formats on the web?
Is complexity a reasonable excuse for one of the world’s largest corporations to forego a feature in their flagship browser that every other browser has implemented?
Comments (79) 20 threads
As others have mentioned, the major issue with SVG animations is that Microsoft doesn't plan to ever include support for them in Edge. This means that you either need to create fallbacks specifically for Microsoft browsers, or to disregard that portion of the market on your website. It's a real shame because SVG/SMIL allows you to create high quality animations which require a fraction of the bandwidth that would be necessary for comparable GIF or video files.
[1] - https://github.com/sangaline/svganimator
[2] - https://intoli.com/blog/designing-the-wayback-machine-loadin...
[3] - https://intoli.com/blog/terminal-recorders/
And here I thought the Edge team left behind the mistakes of IE.
https://developer.microsoft.com/en-us/microsoft-edge/platfor...
[0] https://developer.microsoft.com/en-us/microsoft-edge/platfor...
> In the 15 months since we announced our intention to deprecate and eventually remove SMIL, we’ve heard a variety of opinions from members of the community. We value all of your feedback, and it's clear that there are use cases serviced by SMIL that just don’t have high-fidelity replacements yet. As a result, we’ve decided to suspend our intent to deprecate and take smaller steps toward other options.
I understand that they don't have an infinite budget, but it really seems like they made their mind up here years ago and haven't been interested in listening in the community since then. It's also a bit circular to "prioritize based on how common the standards are found used in the wild" when they're single-handedly responsible for preventing developers from using SVG animations "in the wild" in the first place.
[1] - https://wpdev.uservoice.com/forums/257854-microsoft-edge-dev...
[2] - https://developer.microsoft.com/en-us/microsoft-edge/platfor...
[3] - https://groups.google.com/a/chromium.org/forum/#!msg/blink-d...
Continue this thread — 1 reply
Shitty of Microsoft, though. If they aren't going to support it, it's not going to be widely deployed. I expect better of the new and improved Microsoft.
Continue this thread — 9 replies
Continue this thread — 1 reply
They've got no authority to do that. There is no trademark on 'web' that they could enforce.
Using SVG definitions efficiently to avoid duplication is also not as easy as I thought it would be.
I have a few ideas on how to reduce file size, this is the next improvement I'm planning to work on.
For the examples shown at [1], file size ranges from 56kB to 252kB, the worst case scenario being lots of single characters with different colors.
[1] https://github.com/nbedos/termtosvg/blob/master/examples/exa...
Continue this thread — 1 reply
https://jsfiddle.net/2kc6tqy1/2/
I suppose the main barrier would be lack of recorded timing information in script logs, so either pre-procesding or pause for input (say 50ms/keystroke + 200ms pr return/line-feed) and/or output (say 50ms pr line feed).
Although, now I see there's a -t option for a timing file.
So would seem one should be able to take logs from script, and produce svg, gif, png, webm, mp4... js output.
[s] http://man7.org/linux/man-pages/man1/script.1.html
Simply call it with "shell-demo DEMO_SCRIPT", and follow the instructions.
Demo scripts examples are given aside the snippet.
[1]: https://gitlab.com/snippets/1730340
But how does it compare? Is the size smaller, is it more efficient?
As I explained in the above article, this is already possible with asciinema + svg-term-cli (https://github.com/marionebl/svg-term-cli).
The one downside with animated SVGs is that they're not as compatible to be included anywhere as GIFs since they're really just html snippets.
Being an `asciinema + svg-term-cli` user myself, what are the arguments for moving to `termtosvg`?
Thanks!
Editing the HTML attribute to width=2000% is pretty sweet however because it's a vector.
I'm guessing if the example wasn't in an image tag I could select the text too?
Block artifacts are really annoying when you try to read something on screen recordings.
And svg texts can be made selectable when not loaded as images, so you could copy straight from the recording.
How hard would it be to add some sort of pause button to aid in selecting from the capture? Also, it appears you can only select when you are viewing the image directly, not when it is embedded via an tag. Is that fixable? I guess maybe an
It would be good to adjust the failure mode so that if SMIL is not supported then at least a meaningful frame (probably the last, though scrolling makes it difficult to decide!) is shown, rather than just a blank rectangle.
All comments shown.
Couldn't load more comments. Check your connection and try again.