Convert Animated GIF to MP4

Animated GIFs are a larger image format and an inefficient way to serve traffic. It’s recommended to convert animated GIFS to MP4 for more optimized performance of your website and apps with the additional benefit of saving additional bytes. ​Akamai​ Image and Video Manager has the capability to convert your animated GIFs to MP4 on the fly saving you the cost and trouble of doing that within your library.

📘

You need both ​Akamai​ Image Manager images and ​Akamai​ Image Manager video line items on your contract to be able to successfully convert animated GIFs to MP4 on the fly using ​Akamai​ Image and Video Manager.

📘

The Sequencing of the Image and Video Manager rule and the Origin Server behavior rules is important!

Make sure that your Image and Video Manager rule is the last rule that modifies origin settings. Rules that apply the Origin Server behavior should not be applied after the Image and Video Manager rule (exception: Cloudlets origins configured with the Cloudlets Origin Group rule can be applied after).

How to

To convert animated GIF to MP4:

  1. Update your website so that it supports the aka-media source tag. See the example html page to learn how to do it. This is a tag developed by ​Akamai​ that helps you use the same source tags for image and video formats, therefore helping you render a media file as an image or a video.
  2. Add an Image and Video Manager rule (follow steps 1-5, and then):
    1. Insert Images rule
      1. Create a match condition with the criteria:
        1. File Extension
        2. is not one of
        3. gif
      2. Add the Image and Video Manager (Images) behavior.
    2. Insert Videos rule
      1. Create a match condition with the criteria:
        1. File Extension
        2. is one of
        3. gif
      2. Add the Image and Video Manager (Videos) behavior.
  3. Click Save.
  4. Activate your property on staging.
  5. Test your configuration.
  6. When you’re satisfied with your changes, activate your property on production and go live.

Limitations

The limits for the real-time animated GIF to MP4 conversion are:

  • 25MB input size
  • or 15s input duration.

If the sizes exceed these, the GIFs will be processed offline.

To learn about offline video processing limits, please see best practices for pristine videos