{"id":799326,"date":"2018-09-25T14:00:09","date_gmt":"2018-09-25T12:00:09","guid":{"rendered":"https:\/\/wp-rocket.me\/?p=799326"},"modified":"2021-04-14T17:21:21","modified_gmt":"2021-04-14T15:21:21","slug":"replacing-animated-gifs-with-html5-video-for-faster-page-speed","status":"publish","type":"post","link":"https:\/\/wp-rocket.me\/blog\/replacing-animated-gifs-with-html5-video-for-faster-page-speed\/","title":{"rendered":"Replacing Animated GIFs with HTML5 Video for Faster Page Speed"},"content":{"rendered":"<p>Animated GIFs, more than any other digital file format, have captured the hearts and minds of online users. But man, they\u2019re so damn hard to optimize!<br>I once spent an hour trying to tweak the quality, frame rate, and length of a GIF, ultimately giving up because I couldn\u2019t get the file below 2 MB without the GIF looking like a hot mess.<\/p><p>It\u2019s no wonder services like Giphy don\u2019t even use the GIF file format themselves. Instead, they use HTML5 videos that are often as much as 90% smaller in size. (And in my case, as you\u2019ll see below, 94% smaller in size.)<\/p><p>It might seem like a cop-out to use video in place of GIF on a website that promotes all things GIF, but when you compare a cat GIF that\u2019s 7 MB in size to the exact same animation in video format that\u2019s only 147 KB, well\u2026<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/giphy-3.gif\"><img loading=\"lazy\" decoding=\"async\" width=\"192\" height=\"231\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/giphy-3.gif\" alt=\"gif\" class=\"wp-image-799347\"\/><\/a><\/figure><\/div><p>In this post, I\u2019ll show you just how easy it is to convert GIFs to HTML5 video and achieve incredibly small file sizes for your site.<\/p><h2 class=\"wp-block-heading\">How GIFs Became Pseudo Videos in the First Place<\/h2><p>The GIF file format was never intended to be used for animation or video. In fact, it says so right there, in black and white, in the GIF89a specification published in 1990:<\/p><p>\u201c<em>The Graphics Interchange Format is not intended as a platform for animation, even though it can be done in a limited way.<\/em>\u201d<\/p><p>So how did we end up here, in this online world, where GIFs are the go-to format for animations?<\/p><p>GIFs were actually designed to hold multiple images in a single file, kind of like a ZIP file for images. And that\u2019s how they were used until Netscape 2.0 came along in 1995 and introduced the <a href=\"http:\/\/www.vurdalakov.net\/misc\/gif\/netscape-looping-application-extension\" target=\"_blank\" rel=\"noopener noreferrer\">looping extension<\/a> that set GIF animations free, bringing them to life.<\/p><p>Back in those days, the internet was under construction, and so was the GIF. There were <a href=\"https:\/\/knowyourmeme.com\/memes\/dancing-baby\" target=\"_blank\" rel=\"noopener noreferrer\">dancing babies<\/a> and <a href=\"https:\/\/knowyourmeme.com\/memes\/hampster-dance\" target=\"_blank\" rel=\"noopener noreferrer\">dancing hamsters<\/a>. GIFs were harmless fun because they were simple animations, often with few colors and frames, limiting their file size.<\/p><p>Fast forward to today\u201430 years after GIFs were invented\u2014and they\u2019ve have become an art form unto themselves. Reddit, Twitter and Tumblr helped popularized GIFs, making it easy for anyone to quickly share an animated GIF. And services like Giphy and Imgur have made it easier than ever to quickly find a GIF and share a reaction.<\/p><p>Reaction GIFs are now a form of expression. If you\u2019re like me, you\u2019ve probably replied to a comment on Slack using a GIF rather than words because often a GIF can convey a feeling\u2014or help carry an inside joke\u2014more so than words.<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/wiggle.gif\"><img loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"201\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/wiggle.gif\" alt=\"wiggle gif\" class=\"wp-image-799354\"\/><\/a><\/figure><\/div><p>Besides being fun to use, GIFs have several benefits:<\/p><ul class=\"wp-block-list\"><li>Universally supported by browsers<\/li><li>Universally understood. Everyone knows what GIF is<\/li><li>Easy-to-use and widely available tools for creating them<\/li><li>No patent or licensing concerns that apply to common video codecs<\/li><li>Easy to insert in sites using <code>img<\/code><\/li><li>Easy to share on social platforms<\/li><\/ul><h3 class=\"wp-block-heading\">GIF != Video<\/h3><p>GIFs in 2018 are no longer just a collection of simple images, as they were back in 1995. Often, animated GIFs are clips ripped from TV and movies\u2014basically, video saved in the wrong format.<\/p><p>Unlike actual, video formats, GIFs don\u2019t use any kind of video encoding or compression techniques. So a GIF that\u2019s only a few seconds long can quickly blow out to several megabytes in size, depending on the frame rate and quality.<\/p><p>On top of that GIFs lack the quality of video and have color limitations and slower frame rates.<\/p><p>But the biggest problem of all with GIFs is their file size. While JPEG and PNG files can be easily compressed, GIF animations are a nightmare to optimize because the more you compress them, the worse they look, making them less than ideal for use on modern websites.<\/p><h2 class=\"wp-block-heading\">The Case for Using HTML5 Video Instead of GIF<\/h2><p>Before HTML5, videos could only be played in browsers using plug-ins, like Flash. HTML5 turned video on its head, providing a standard way to show video on the web using the <code>&lt;video&gt;<\/code> tag.<\/p><p>While video can take more time to encode, HTML5 does offer a number of advantages compared to GIF:<\/p><ul class=\"wp-block-list\"><li>Easy to insert videos in sites using &lt;video&gt;<\/li><li>Small file size<\/li><li>Better performance<\/li><li>More colors and detail<\/li><\/ul><p>There are three supported HTML5 video formats: MP4, WebM, and Ogg. Of these three formats, MP4 is the most widely, with <a href=\"https:\/\/caniuse.com\/#search=mp4\" target=\"_blank\" rel=\"noopener noreferrer\">94% of browsers<\/a> using this video compression format.<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/mpeg4-caniuse.png\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"277\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/mpeg4-caniuse.png\" alt=\"mpeg4 video compression\" class=\"wp-image-799363\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/mpeg4-caniuse.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/mpeg4-caniuse-300x104.png 300w, https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/mpeg4-caniuse-768x266.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><\/figure><\/div><p><br>WebM, a video and audio format that Google has developed as a royalty-free codec, isn\u2019t far behind on 79% (see below). However, Apple doesn\u2019t support WebM and is <a href=\"https:\/\/appleinsider.com\/articles\/10\/05\/20\/steve_jobs_says_no_to_googles_vp8_webm_codec\" target=\"_blank\" rel=\"noopener noreferrer\">unlikely to do so any time soon<\/a>.<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/webm-support.png\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"316\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/webm-support.png\" alt=\"webm video format\" class=\"wp-image-799368\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/webm-support.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/webm-support-300x119.png 300w, https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/webm-support-768x303.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><\/figure><\/div><div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/ogg-support.png\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"297\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/ogg-support.png\" alt=\"ogg vorbis audio format\" class=\"wp-image-799374\" srcset=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/ogg-support.png 800w, https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/ogg-support-300x111.png 300w, https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/ogg-support-768x285.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><\/figure><\/div><p><br>Lastly, OGG is supported on 78% of browsers. But it, too, isn\u2019t available on Apple browsers.<br><\/p><h3 class=\"wp-block-heading\">HTML5 vs GIF<\/h3><p>So how does the quality of HTML5 video compare to GIF? As we\u2019ve explored so far, video formats are actually designed for video. So, obviously, they\u2019re going to handle moving images\u2014i.e. video and animation\u2014a heck of a lot better than GIF.<\/p><p>Check out this example of an animated GIF from Game of Thrones:<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/jon-original.gif\"><img loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"225\" src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/jon-original.gif\" alt=\"\" class=\"wp-image-799380\"\/><\/a><\/figure><\/div><p><b>It comes in as a whopping 2 MB in size.<\/b> It\u2019s huge for an animation that\u2019s barely 3 seconds in length.<\/p><p>Now, here\u2019s an MP4 video that I\u2019ve converted from the above GIF file:<\/p><figure class=\"wp-block-video\"><video autoplay controls loop src=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/got-video.mp4\"><\/video><\/figure><h2 class=\"wp-block-heading\">Converting Animated GIFs to HTML5 Video<\/h2><p>There are lots of ways you can convert GIF to video, including free online tools like <a href=\"https:\/\/ezgif.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">ezgif.com<\/a>, but in this tutorial, I want to show you how to use <a href=\"https:\/\/www.ffmpeg.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">FFmpeg<\/a>. This free open-source command-line tool handles video, audio, and other multimedia files and streams, and can also be used to convert animated GIFs into video formats, including MP4, WebM, and OGG.<\/p><p>If you already have FFmpeg installed, simply fire up the Terminal and run the <code>ffmpeg<\/code> command. It\u2019s it\u2019s installed, you\u2019ll see some diagnostic information. If it\u2019s not installed and you see an error message, you\u2019ll need to install it:<\/p><ul class=\"wp-block-list\"><li>For MacOS, you can install it via <a href=\"https:\/\/trac.ffmpeg.org\/wiki\/CompilationGuide\/macOS#ffmpegthroughHomebrew\" target=\"_blank\" rel=\"noopener noreferrer\">Homebrew<\/a>.<\/li><li>For Windows, use <a href=\"https:\/\/chocolatey.org\/packages\/ffmpeg\">Chocolatey<\/a><\/li><\/ul><p>Once installed, find a GIF you\u2019d like to convert into a video. For this example, I\u2019m going to convert a GIF into MP4, since MP4 is the most widely supported video format.<\/p><p>Open a Terminal window, change to the directory containing your GIF, and enter the following command:<\/p><p><code>ffmpeg -i input.gif output.mp4<br>\n<\/code><br>This is the most basic syntax for converting a GIF to MP4. The <code>-i<\/code> specifies the input (in this case, input.gif), and the output file is named afterward (in this case, output.mp4).<\/p><p>If you\u2019re following along with this guide, when you enter this command you should see a new file, output.mp4, magically appear in your directory.<\/p><p>FFmpeg comes with a ton of options, which you can use to finetune the video output. One such option is employing an encoding mode called Constant Rate Factor (CRF) when video quality is a high priority:<\/p><p><code>ffmpeg -i input.gif -b:v 0 -crf 25 output.mp4<br>\n<\/code><br>This command uses the <code>-b:v flag<\/code>, which would normally limit the output bitrate, but when used with CRF mode it must be set to 0. The <code>-crf<\/code> accepts a value between 0 and 51; the lower the value, the higher the quality and the larger file size.<\/p><p>Using this command, I ran the Game of Thrones GIF for a third time, and it output an MP4 file 111 KB in size with no noticeable drop in quality. <strong>That\u2019s a 94% reduction in size or 6% of the original file size.<\/strong><\/p><p>Another option worth experimenting with is <code>movflags<\/code>, which optimizes the structures of the MP4 file. Usually, MP4 files have all the metadata stored at the end of the file, and using <code>-movflags faststart<\/code> you can move it to the start for faster loading:<\/p><p><code>ffmpeg -i input.gif -movflags faststart output.mp4<\/code><\/p><p>There are loads more options for optimizing video output. Check out the <a href=\"https:\/\/ffmpeg.org\/ffmpeg-formats.html\" target=\"_blank\" rel=\"noopener noreferrer\">FFmpeg formats documentation<\/a> for more details.<\/p><h2 class=\"wp-block-heading\">Replacing GIFs with HTML5 Video<\/h2><p>Inserting a GIF into a webpage is super easy\u2014all you have to do is upload it as you would any image file. Fortunately, using the <code>&lt;video&gt;<\/code> tag is also straightforward. You just need to keep three things in mind:<\/p><ol class=\"wp-block-list\"><li>GIFs play automatically<\/li><li>GIFs loop continuously<\/li><li>GIFs don\u2019t have sound<\/li><\/ol><p>When you\u2019re adding a GIF to your site, you don\u2019t have to worry about these traits because. GIFs just\u2026 work. But when you\u2019re adding a video to your site that you want to behave like a GIF, you need to account for these behaviors.<\/p><p>In order to add a GIF to your site you would use HTML markup similar to this:<\/p><p><code>&lt; img src=\"cat.gif\" alt=\"\" width=\"400\" height=\"300\" \/&gt;<\/code><\/p><p>To insert a video, you would replace the above with this:<\/p><p><code>&lt; video autoplay loop muted playsinline &gt;<br>\n&lt; source src=\"cat.mp4\" type=\"video\/mp4\" &gt;<br>\n&lt;\/video&gt;<\/code><\/p><p>You\u2019ll notice a few attributes: <code>autoplay<\/code> tells the video to automatically plays, while <code>loop<\/code> ensures the videos loop continuously. The <code>muted<\/code> attribute turns off any sound but must also be present for videos to autoplay, even if they don\u2019t have audio. On iOS devices, <code>playsinline<\/code> is also required for autoplay to work.<\/p><div id=\"om-ulrdquoprwqcywqbbgci-holder\"><\/div>\n\t<script>(function (d, u, ac) {\n\t\t\tvar s = d.createElement('script')\n\t\t\ts.type = 'text\/javascript'\n\t\t\ts.src = 'https:\/\/a.omappapi.com\/app\/js\/api.min.js'\n\t\t\ts.async = true\n\t\t\ts.dataset.user = u\n\t\t\ts.dataset.campaign = ac\n\t\t\td.getElementsByTagName('head')[0].appendChild(s)\n\t\t})(document, 20440, 'ulrdquoprwqcywqbbgci')<\/script><h2 class=\"wp-block-heading\">Conclusion<\/h2><p>GIFs are super easy to add to any web page\u2014just upload and treat them like any other image. But they\u2019re a terrible format for displaying animation and video and are typically huge in size. When you\u2019re trying to optimize your site and improve its performance, GIFs will only drag down your page speed.<\/p><p>HTML5 video provides a streamlined way to add GIF-like animations to your site without bloat. Using the snippets above, you can convert GIFs to MP4 and output files that are just 6% of the original! And with no noticeable loss in quality.<\/p><p>If you want to know more about improving your web performance, <a href=\"https:\/\/wp-rocket.me\/google-core-web-vitals-wordpress\/\">check out our guide to Core Web Vitals for WordPress<\/a> and learn how to optimize them!<\/p>","protected":false},"excerpt":{"rendered":"<p>Animated GIFs, more than any other digital file format, have captured the hearts and minds of online users. But man, they\u2019re so damn hard to optimize!I once spent an hour trying to tweak the quality, frame rate, and length of a GIF, ultimately giving up because I couldn\u2019t get the file below 2 MB without [&hellip;]<\/p>\n","protected":false},"author":47285,"featured_media":799472,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"kia_subtitle":"","footnotes":""},"categories":[63],"tags":[],"class_list":["post-799326","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress-cache"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Replacing Animated GIFs with Videos for Faster Page Speed<\/title>\n<meta name=\"description\" content=\"Replacing GIFs with HTML5 video is a quick and easy way to speed up your site. Learn how to convert GIFS and use the tag in this tutorial.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wp-rocket.me\/blog\/replacing-animated-gifs-with-html5-video-for-faster-page-speed\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Replacing Animated GIFs with Videos for Faster Page Speed\" \/>\n<meta property=\"og:description\" content=\"Replacing GIFs with HTML5 video is a quick and easy way to speed up your site. Learn how to convert GIFS and use the tag in this tutorial.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wp-rocket.me\/blog\/replacing-animated-gifs-with-html5-video-for-faster-page-speed\/\" \/>\n<meta property=\"og:site_name\" content=\"WP Rocket\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/pages\/WP-Rocket\/631942253526829\" \/>\n<meta property=\"article:published_time\" content=\"2018-09-25T12:00:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-04-14T15:21:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/gif-video-feature-image.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1100\" \/>\n\t<meta property=\"og:image:height\" content=\"460\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Raelene Morey\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@wp_rocket\" \/>\n<meta name=\"twitter:site\" content=\"@wp_rocket\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Raelene Morey\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/wp-rocket.me\/blog\/replacing-animated-gifs-with-html5-video-for-faster-page-speed\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/wp-rocket.me\/blog\/replacing-animated-gifs-with-html5-video-for-faster-page-speed\/\"},\"author\":{\"name\":\"Raelene Morey\",\"@id\":\"https:\/\/wp-rocket.me\/#\/schema\/person\/916d553a975868ce90654f343fa25d73\"},\"headline\":\"Replacing Animated GIFs with HTML5 Video for Faster Page Speed\",\"datePublished\":\"2018-09-25T12:00:09+00:00\",\"dateModified\":\"2021-04-14T15:21:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/wp-rocket.me\/blog\/replacing-animated-gifs-with-html5-video-for-faster-page-speed\/\"},\"wordCount\":1626,\"commentCount\":5,\"publisher\":{\"@id\":\"https:\/\/wp-rocket.me\/#organization\"},\"image\":{\"@id\":\"https:\/\/wp-rocket.me\/blog\/replacing-animated-gifs-with-html5-video-for-faster-page-speed\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/gif-video-feature-image.png\",\"articleSection\":[\"Page speed and caching\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/wp-rocket.me\/blog\/replacing-animated-gifs-with-html5-video-for-faster-page-speed\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/wp-rocket.me\/blog\/replacing-animated-gifs-with-html5-video-for-faster-page-speed\/\",\"url\":\"https:\/\/wp-rocket.me\/blog\/replacing-animated-gifs-with-html5-video-for-faster-page-speed\/\",\"name\":\"Replacing Animated GIFs with Videos for Faster Page Speed\",\"isPartOf\":{\"@id\":\"https:\/\/wp-rocket.me\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/wp-rocket.me\/blog\/replacing-animated-gifs-with-html5-video-for-faster-page-speed\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/wp-rocket.me\/blog\/replacing-animated-gifs-with-html5-video-for-faster-page-speed\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/gif-video-feature-image.png\",\"datePublished\":\"2018-09-25T12:00:09+00:00\",\"dateModified\":\"2021-04-14T15:21:21+00:00\",\"description\":\"Replacing GIFs with HTML5 video is a quick and easy way to speed up your site. Learn how to convert GIFS and use the tag in this tutorial.\",\"breadcrumb\":{\"@id\":\"https:\/\/wp-rocket.me\/blog\/replacing-animated-gifs-with-html5-video-for-faster-page-speed\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/wp-rocket.me\/blog\/replacing-animated-gifs-with-html5-video-for-faster-page-speed\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wp-rocket.me\/blog\/replacing-animated-gifs-with-html5-video-for-faster-page-speed\/#primaryimage\",\"url\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/gif-video-feature-image.png\",\"contentUrl\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/gif-video-feature-image.png\",\"width\":1100,\"height\":460,\"caption\":\"replacing GIF with HTML5 video\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/wp-rocket.me\/blog\/replacing-animated-gifs-with-html5-video-for-faster-page-speed\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/wp-rocket.me\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Page speed and caching\",\"item\":\"https:\/\/wp-rocket.me\/blog\/wordpress-cache\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Replacing Animated GIFs with HTML5 Video for Faster Page Speed\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/wp-rocket.me\/#website\",\"url\":\"https:\/\/wp-rocket.me\/\",\"name\":\"WP Rocket\",\"description\":\"Plugin d&#039;optimisation de sites WordPress\",\"publisher\":{\"@id\":\"https:\/\/wp-rocket.me\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/wp-rocket.me\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/wp-rocket.me\/#organization\",\"name\":\"WP Rocket\",\"url\":\"https:\/\/wp-rocket.me\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wp-rocket.me\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/logo-wp-rocket-paypal-2.png\",\"contentUrl\":\"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/logo-wp-rocket-paypal-2.png\",\"width\":150,\"height\":41,\"caption\":\"WP Rocket\"},\"image\":{\"@id\":\"https:\/\/wp-rocket.me\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/pages\/WP-Rocket\/631942253526829\",\"https:\/\/x.com\/wp_rocket\",\"https:\/\/www.youtube.com\/channel\/UC1ozThXHd1IWIZ5wkshgp_Q\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/wp-rocket.me\/#\/schema\/person\/916d553a975868ce90654f343fa25d73\",\"name\":\"Raelene Morey\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wp-rocket.me\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/fa33964c6065acf9d0348d177213ec83?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/fa33964c6065acf9d0348d177213ec83?s=96&d=mm&r=g\",\"caption\":\"Raelene Morey\"},\"description\":\"Raelene Morey is the Co-Founder of Words By Birds, a digital writing agency that helps busy WordPress with writing articles, content strategies, lead magnets and other word-related things. A former journalist and editor, Raelene has been developing WordPress sites for over 10 years.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Replacing Animated GIFs with Videos for Faster Page Speed","description":"Replacing GIFs with HTML5 video is a quick and easy way to speed up your site. Learn how to convert GIFS and use the tag in this tutorial.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wp-rocket.me\/blog\/replacing-animated-gifs-with-html5-video-for-faster-page-speed\/","og_locale":"en_US","og_type":"article","og_title":"Replacing Animated GIFs with Videos for Faster Page Speed","og_description":"Replacing GIFs with HTML5 video is a quick and easy way to speed up your site. Learn how to convert GIFS and use the tag in this tutorial.","og_url":"https:\/\/wp-rocket.me\/blog\/replacing-animated-gifs-with-html5-video-for-faster-page-speed\/","og_site_name":"WP Rocket","article_publisher":"https:\/\/www.facebook.com\/pages\/WP-Rocket\/631942253526829","article_published_time":"2018-09-25T12:00:09+00:00","article_modified_time":"2021-04-14T15:21:21+00:00","og_image":[{"width":1100,"height":460,"url":"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/gif-video-feature-image.png","type":"image\/png"}],"author":"Raelene Morey","twitter_card":"summary_large_image","twitter_creator":"@wp_rocket","twitter_site":"@wp_rocket","twitter_misc":{"Written by":"Raelene Morey","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/wp-rocket.me\/blog\/replacing-animated-gifs-with-html5-video-for-faster-page-speed\/#article","isPartOf":{"@id":"https:\/\/wp-rocket.me\/blog\/replacing-animated-gifs-with-html5-video-for-faster-page-speed\/"},"author":{"name":"Raelene Morey","@id":"https:\/\/wp-rocket.me\/#\/schema\/person\/916d553a975868ce90654f343fa25d73"},"headline":"Replacing Animated GIFs with HTML5 Video for Faster Page Speed","datePublished":"2018-09-25T12:00:09+00:00","dateModified":"2021-04-14T15:21:21+00:00","mainEntityOfPage":{"@id":"https:\/\/wp-rocket.me\/blog\/replacing-animated-gifs-with-html5-video-for-faster-page-speed\/"},"wordCount":1626,"commentCount":5,"publisher":{"@id":"https:\/\/wp-rocket.me\/#organization"},"image":{"@id":"https:\/\/wp-rocket.me\/blog\/replacing-animated-gifs-with-html5-video-for-faster-page-speed\/#primaryimage"},"thumbnailUrl":"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/gif-video-feature-image.png","articleSection":["Page speed and caching"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/wp-rocket.me\/blog\/replacing-animated-gifs-with-html5-video-for-faster-page-speed\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/wp-rocket.me\/blog\/replacing-animated-gifs-with-html5-video-for-faster-page-speed\/","url":"https:\/\/wp-rocket.me\/blog\/replacing-animated-gifs-with-html5-video-for-faster-page-speed\/","name":"Replacing Animated GIFs with Videos for Faster Page Speed","isPartOf":{"@id":"https:\/\/wp-rocket.me\/#website"},"primaryImageOfPage":{"@id":"https:\/\/wp-rocket.me\/blog\/replacing-animated-gifs-with-html5-video-for-faster-page-speed\/#primaryimage"},"image":{"@id":"https:\/\/wp-rocket.me\/blog\/replacing-animated-gifs-with-html5-video-for-faster-page-speed\/#primaryimage"},"thumbnailUrl":"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/gif-video-feature-image.png","datePublished":"2018-09-25T12:00:09+00:00","dateModified":"2021-04-14T15:21:21+00:00","description":"Replacing GIFs with HTML5 video is a quick and easy way to speed up your site. Learn how to convert GIFS and use the tag in this tutorial.","breadcrumb":{"@id":"https:\/\/wp-rocket.me\/blog\/replacing-animated-gifs-with-html5-video-for-faster-page-speed\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wp-rocket.me\/blog\/replacing-animated-gifs-with-html5-video-for-faster-page-speed\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wp-rocket.me\/blog\/replacing-animated-gifs-with-html5-video-for-faster-page-speed\/#primaryimage","url":"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/gif-video-feature-image.png","contentUrl":"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/gif-video-feature-image.png","width":1100,"height":460,"caption":"replacing GIF with HTML5 video"},{"@type":"BreadcrumbList","@id":"https:\/\/wp-rocket.me\/blog\/replacing-animated-gifs-with-html5-video-for-faster-page-speed\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wp-rocket.me"},{"@type":"ListItem","position":2,"name":"Page speed and caching","item":"https:\/\/wp-rocket.me\/blog\/wordpress-cache\/"},{"@type":"ListItem","position":3,"name":"Replacing Animated GIFs with HTML5 Video for Faster Page Speed"}]},{"@type":"WebSite","@id":"https:\/\/wp-rocket.me\/#website","url":"https:\/\/wp-rocket.me\/","name":"WP Rocket","description":"Plugin d&#039;optimisation de sites WordPress","publisher":{"@id":"https:\/\/wp-rocket.me\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wp-rocket.me\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/wp-rocket.me\/#organization","name":"WP Rocket","url":"https:\/\/wp-rocket.me\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wp-rocket.me\/#\/schema\/logo\/image\/","url":"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/logo-wp-rocket-paypal-2.png","contentUrl":"https:\/\/wp-rocket.me\/wp-content\/uploads\/1\/logo-wp-rocket-paypal-2.png","width":150,"height":41,"caption":"WP Rocket"},"image":{"@id":"https:\/\/wp-rocket.me\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/pages\/WP-Rocket\/631942253526829","https:\/\/x.com\/wp_rocket","https:\/\/www.youtube.com\/channel\/UC1ozThXHd1IWIZ5wkshgp_Q"]},{"@type":"Person","@id":"https:\/\/wp-rocket.me\/#\/schema\/person\/916d553a975868ce90654f343fa25d73","name":"Raelene Morey","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wp-rocket.me\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/fa33964c6065acf9d0348d177213ec83?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/fa33964c6065acf9d0348d177213ec83?s=96&d=mm&r=g","caption":"Raelene Morey"},"description":"Raelene Morey is the Co-Founder of Words By Birds, a digital writing agency that helps busy WordPress with writing articles, content strategies, lead magnets and other word-related things. A former journalist and editor, Raelene has been developing WordPress sites for over 10 years."}]}},"_links":{"self":[{"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/posts\/799326"}],"collection":[{"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/users\/47285"}],"replies":[{"embeddable":true,"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/comments?post=799326"}],"version-history":[{"count":0,"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/posts\/799326\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/media\/799472"}],"wp:attachment":[{"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/media?parent=799326"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/categories?post=799326"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp-rocket.me\/wp-json\/wp\/v2\/tags?post=799326"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}