Skip to main content
tessap14891579
Participant
September 11, 2018
Answered

From After Effects, how to export an animated gif without looping

  • September 11, 2018
  • 4 replies
  • 13229 views

Hello, I'm exporting a 20 second animation from After Effects using Media Encoder. It needs to be an animated gif file.

Ideally I want the animation to loop 3 times then remain on the last frame.

I've tried the technique of importing the completed animation as an MP4, layering it three times but this increases the file size.

The final gif can't be larger than 10mb.

Searched for a solution but most answers are geared to making the animation infinitely loop (should I be using the term 'cycle'?).

There must be some code I can put in place that asks the entire animation to play 3 times then stop on the final frame.

Please can anyone help?

    This topic has been closed for replies.
    Correct answer Roland Kahlenberg

    You'll need coding/programming to make this work and the code/language you use will depend on the platform where the GIF will be displayed. IOW, there is no way for AE-AME to render a GIF animation with a specified number of loops - this is done at the delivery stage via coding/programming.

    4 replies

    tessap14891579
    Participant
    September 11, 2018

    Just one more thing!!

    At the moment if I export the animation as a gif via Encoder the gif just iinfinitely loops can I get it to play just once and freeze on the last frame - it doesn't seem to work when I set this up using the split layer - freeze on last frame technique.

    Is that going back to the platform needs the code rather than the exported asset?

    Thanks!

    Mylenium
    Legend
    September 11, 2018

    The number of loops, frame durations and hold frames are all defined in the GIF file itself by ways of tags. none of that is supported in AME or AE. You really need to mangle this through another editor, even if you just open the AE-created GIF file in GIFgun or other such tools and re-save it.

    Mylenium

    Roland Kahlenberg
    Legend
    September 11, 2018

    Certain platforms, like Facebook; and I'm sure other popular Social Media platforms will strip these GIF tags/codes. For FB, any GIF below 40 seconds (if I recall the duration correctly), will loop automatically and the loop will occur for a system-defined number of times until it reaches a system-defined total duration. For a org's Website, those tags will of course work as tagged and deployed.

    Very Advanced After Effects Training | Adaptive & Responsive Toolkits | Intelligent Design Assets (IDAs) | MoGraph Design System DEV
    tessap14891579
    Participant
    September 11, 2018

    Hi both, thanks for you replies. It's not possible for me to create this in photoshop as the frames exceed 500.

    But it's good to know that I can't export a gif from AE (using media encoder) with specified loops - I had been experimenting with the Remapping, LoopOut(); expression but now I know this isn't going to work I'll stop pursuing that!

    Unfortunately it's not possible to add code to the platform this will sit. This is a very old CMS system so limited that I can't even place an MP4 asset which is why I've had to resort to an animated gif file no larger than 10mb.

    As I said the layering technique worked (with a freeze on last frame) but this made the file huge.

    Thanks for your help!

    Szalam
    Community Expert
    Community Expert
    September 11, 2018

    tessap14891579  wrote

    It's not possible for me to create this in photoshop as the frames exceed 500.

    Where do you see this limitation?

    Participant
    September 3, 2021

    I've noticed in the past that photoshop loads all your frames into ram when you're rendering and doesn't have a handler for overflow. So if you exceed your ram limit on an animation of length (say 500 frames) it just gives up on the render. So I don't think it's that 500 is an exact limit, just a limit on what tessap can render.

    Mylenium
    Legend
    September 11, 2018

    No, no code, no tricks. AE is simply the wrong tool for this. You need to use Photoshop's Animation features or for that matter any otehr halfway decent GIF-generation tool that allows to define the number of loops and hold frames.

    Mylenium

    Roland Kahlenberg
    Roland KahlenbergCorrect answer
    Legend
    September 11, 2018

    You'll need coding/programming to make this work and the code/language you use will depend on the platform where the GIF will be displayed. IOW, there is no way for AE-AME to render a GIF animation with a specified number of loops - this is done at the delivery stage via coding/programming.

    Very Advanced After Effects Training | Adaptive & Responsive Toolkits | Intelligent Design Assets (IDAs) | MoGraph Design System DEV