Comments (4)
I was able to escape the heap limit with -e NODE_OPTIONS='--max_old_space_size=4096'
in the docker command, that led me step closer
docker run --rm -v $PWD:/data -e NODE_OPTIONS='--max_old_space_size=4096' asciinema/asciicast2gif -s 1.0 -t solarized-dark demo.cast demo.gif
==> Loading demo.cast...
==> Spawning PhantomJS renderer...
==> Generating frame screenshots...
==> Combining 4338 screenshots into GIF file...
/app/main.js:697
Qe)}function ep(a){try{var b=a[0];return b.h?b.h(a):b.call(null,a)}catch(c){if(c instanceof Object)throw b=c,Yo(a[6]),b;throw c;}}function fp(a,b,c){c=Zo(c,dp(function(c){a[2]=c;a[1]=b;return ep(a)}));return r(c)?(a[2]=Nb(c),a[1]=b,dj):null}function gp(a,b){a=a[6];null!=b&&a.Dc(null,b,dp(function(){return function(){return null}}(a)));Yo(a);return a}
^
Error: spawnSync /bin/sh E2BIG
at exports._errnoException (util.js:1020:11)
at spawnSync (child_process.js:451:20)
at Object.execSync (child_process.js:507:13)
at Dp (/app/main.js:708:246)
at /app/main.js:713:178
at Function.b (/app/main.js:709:287)
at ep (/app/main.js:697:48)
at /app/main.js:697:193
at /app/main.js:689:264
at Immediate.Po (/app/main.js:685:331)
from asciicast2gif.
Is it possible that you link to example .cast file that helps to reproduce this?
from asciicast2gif.
https://s3.amazonaws.com/hlolli/demo.cast
from asciicast2gif.
Wow, this asciicast file is 80 MB, I'd say it's on a heavy side :)
I don't think asciicast2gif will manage. There's just too many frames and the current implementation requires all of it to fit into memory (image concat done by imagemagick's convert
).
However I just released asciicast2gif's successor - https://github.com/asciinema/agg . It's meant to handle any asciicast you throw at it very fast with minimal memory usage. You should try it out (asciicast2gif is no longer maintained).
I generated gif from your demo with agg, took 1 minute:
marcin@puter ~/tmp> agg -v --fps-cap=15 --speed=3 issue-53.{cast,gif}
[2022-08-14T14:33:10Z INFO agg] terminal size: 174x38
[2022-08-14T14:33:10Z INFO agg] selected font family: JetBrains Mono
[2022-08-14T14:33:10Z INFO agg] selected theme: dracula
[2022-08-14T14:33:10Z INFO agg] gif dimensions: 1478x764
1412 / 1412 [=========================================================] 100.00 % 23.61/s
[2022-08-14T14:34:09Z INFO agg] rendering finished in 59.800545s
The generated gif file was huge - 212 MB. So I ran it through gifsicle:
marcin@puter ~/tmp> gifsicle --lossy=80 -k 64 -O3 -Okeep-empty issue-53.gif -o issue-53-opt.gif
gifsicle: warning: huge GIF, conserving memory (processing may take a while)
This one took 10 minutes or so (didn't count), and produced 117 MB gif.
Either way, this type of animation is an extreme case asciinema will never be a good fit for.
from asciicast2gif.
Related Issues (20)
- Produced GIF freezes when played HOT 1
- Object has no method 'execSync' HOT 2
- [FR] Add option to specify working/tmp directory HOT 2
- Docker executable cannot read a file (ENOENT) HOT 4
- [FR] change temp dir (improve documentation) HOT 2
- Cache resources exhausted when converting to gif HOT 3
- Fails with ERR_STREAM_DESTROYED HOT 1
- Option to add a delay to the last frame HOT 1
- TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string HOT 6
- Certian grey text won't show HOT 1
- Fails with error write EPIPE on local file HOT 17
- [why?] HOT 7
- wsl install erro HOT 1
- Add margins to generated GIFs HOT 1
- [bug] Error: certificate has expired HOT 4
- FontFaceOnload error HOT 1
- <input-json-path-or-url> HOT 1
- cnpm install asciicast2gif error HOT 2
- cant display chinese HOT 1
- asciinema2gif: convert-im6.q16: cache resources exhausted HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asciicast2gif.