WenheLI / p5.gif

P5.js gif helper
MIT License
38 stars 4 forks source link

Custom framerate? #7

Open shiffman opened 5 years ago

shiffman commented 5 years ago

The frame rate I don't believe is changing if I pass in a custom value in config, I am trying:

  recorder = p5Gif.capture({framerate: 60});

But the GIF appears to stick with the 10 FPS default?

Full code: https://editor.p5js.org/codingtrain/sketches/WfEih8mL7

fffiloni commented 5 years ago

I found a way to overwrite settings : After you initialized the recorder, set custom settings like this

recorder = p5Gif.capture();

 recorder.settings.width = 200;
 recorder.settings.height = 200;
 recorder.settings.framerate = 12;

This will work, until changes are made by the developers

WenheLI commented 5 years ago

Actually, we currently forbid the framerate going beyond 20 fps. It is a concern of the run-time performance. If the fps is large, the time for saving gif will be quite long. We will see if we can tune up the fps restriction.

WenheLI commented 5 years ago

@shiffman @fffiloni Thanks for your help. The custom framerate problem has been solved. I limited the upper framerate to 30 right now. Do you think it is still small? We originally thought a large framerate will make the browser crash.

fffiloni commented 5 years ago

Hello !

It seems that the custom framerate is still not changing. In the recorder.settings.framerate we see it has changed, but then the gif that is created do not take this number.

My gif, once downloaded, are always at the same rate : 10.

Thanks for your help !

fffiloni commented 5 years ago

maybe it is something involved with the delayvalue on the gif export ?

fffiloni commented 5 years ago

i moved my last question into a new issue : #16 because i think its a new features request ;)