![]() I usually convert into both WebM and MP4. Visit MDN to learn more about web-video codecs.īased on, most modern browsers support the WebM format. WebM with VP8/VP9 codec: relatively new format compared to MP4/H.264.It offers good balance options between quality and file size. MP4 video encoded with H.264 codes: widely supported video format well-suited for the Web.Here is the list of ones supported by modern browsers: This way, you skip the conversion process if the tool you used to create an animation gives enough flexibility to adjust video parameters. Rendering your animation directly into video formats is always better than converting a GIF into a video. In a nutshell, it comes down to a few different steps based on your input material. Knowing the advantages of using video instead of GIF, let’s see how to swap them. How to replace a GIF animation with a video? Using tag without a poster attribute won’t make the video file a candidate for increasing LCP, whereas elements are always considered when calculating LCP. Since the introduction of HTML5, tag has been a standardized way to use videos on the Web.īack in the day, this was achieved using things like Flash Player, which required dedicated software installed onto the client’s machine. In comparison, modern formats employ more efficient lossy compression techniques and video codecs that can achieve higher quality at smaller file sizes. GIFs tend to have larger file sizes than modern formats because they use a lossless compression method, which preserves every frame as a full image, resulting in redundancy and larger files. On the other hand, with video, you can preserve many more colors and details, depending on the codec, bitrate, and compression. This results in a noticeable quality loss, especially with gradient-like color fades. Leaving some hacks aside, GIF is an 8-bit format, meaning it can encode up to 256 colors. On top of that, GIFs have been around since the first stages of the Web and have proven to work, so why use video instead of a GIF? Color resolution/depth Why is video more suitable than GIF?įrom my perception, since the early 00s, there has been a general feeling that video is usually a heavier asset than GIF (especially since GIF is an image format). Worth noting that images and videos are not render-blocking, but loading a heavy asset still may impact the page performance, narrowing the bandwidth and potentially prolonging the loading of other page content. If it takes too long to load, it may decrease the page performance by increasing Largest Contentful Paint, one of the Core Web Vitals metrics. In addition, images, videos, or GIFs that play presentational roles usually occupy a significant amount of the viewport space, and a particular visual may be the largest element within the page viewport. It is even more important for users on limited mobile data plans or accessing web resources on slower public WiFi or 3G connections. To provide optimal performance, any visual medium on websites or any other client-server application should balance visual quality and file size (i.e., compression). Media on the Web: performance expectations If we go to DevTools and check the GIF animation source file URL at first glance, we can see an actual video file without sound and playback controls.īut why? In this article, we’ll review why video is usually a better choice than GIF and how to convert GIF files into videos to put onto web pages. Let’s take one of the most popular GIF-hosting websites, Giphy. The trend has been prominent in social networks and other content- or message-driven apps. ![]() It is common among modern websites and applications to use videos instead of GIFs. Published on October 12, 2023, in Engineering Everything Insights Engineering News Product Culture Compliance Improving animated GIF performance with HTML5 video ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |