From my understanding, the gif loop count is dependent on the gif file itself, so I'm trying to figure out a C# way to always update a gif's loop count to ensure it always loops infinitely.
I've been trying to do this with Transloadit, but I haven't been able to adjust the loop count at all. I've tried setting it to infinite as well as a specific amount, like loop twice, just to see if I could change it but it always keeps the gif's original loop count.
Some things I've tried are:
- Using image/resize robot and adding
ImageMagickparams for setting a loop count - Using video/encode robot with
ffmpegparams for setting a loop count - Using image/resize robot to convert the gif into a gif (with and without
ImageMagickparams)
I know it's possible to adjust this directly with ImageMagick and ffmpeg but need to use Transloadit, as that's how we're managing S3 uploading. In case it helps, because we're using S3, I'm always referencing the import when trying these conversions.
Here's an example attempt of mine.
_steps.encode = new
{
use = "import",
result = true,
robot = "/video/encode",
ffmpeg_stack = "v3.3.3",
ffmpeg = new
{
f = "gif",
loop = 0
}
};
Hoping there's some Transloadit flag or pattern that I'm not aware of...
TIL
ffmpegupdated its loop keys, so though the documentation says to use-1for infinite loop, my version worked with0. So my example above ended up being the answer, I definitely tried it before but one last try ended up doing the trick lol ️