Code Monkey home page Code Monkey logo

Comments (4)

hlolli avatar hlolli commented on August 23, 2024

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.

ku1ik avatar ku1ik commented on August 23, 2024

Is it possible that you link to example .cast file that helps to reproduce this?

from asciicast2gif.

hlolli avatar hlolli commented on August 23, 2024

https://s3.amazonaws.com/hlolli/demo.cast

from asciicast2gif.

ku1ik avatar ku1ik commented on August 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.