#SaveGif doesn't count the second correctly

7 messages · Page 1 of 1 (latest)

ancient musk
#

Hi everyone.
I'm trying to save an animation as a gif and found a problem. I've made a simple example. It seems that the seconds are not correctly counting when saveGif is used. https://editor.p5js.org/Erjaeger42/sketches/MBui2-Sqm I'm writing a number every second. On the preview, it's working perfectly. When exported as a gif, I only have 4 values for a duration of 10sec instead of 10. I haven't found anything related to this problem. I don't know if it's from my implementation or not.

ancient musk
#

I'm on Mac and I'm using Arc as browser, I tried with chrome but same problem

#

Also happens on windows so not related to that

agile field
#

Seems like a bug, the framerate seems to change during recording of the GIF

agile field
#

Ok, after some testing, found out that saveGIF() purposefully runs the animation "faster", so it can capture the required number of frames/seconds, and in the resulting GIF, this is rectified in the final output, as it is run slower than it looks while rendering. However, this breaks any temporal events (setTimeout, setInterval, etc. - which won't run in the faster speed), so only frame based time calculations will be preserved in the output