Of course, if you're viewing the WebM video on an unsupported browser, it sadly won't work for you.Create an animated gif from a video source using ffmpeg, imagemagick and gifsicle To demonstrate the visual quality of both videos, i've added them below, with the WebM video first and the MPEG4 video second. When converting the Fogel GIF that I used earlier in the article to WebM and MPEG4 using the above commands, I get a WebM file size of 59 KB and and MPEG4 file size of 105 KB.
You need to evaluate quality by watching the outputted video. However, since we're using different encoders between both WebM and MPEG4 conversions, the -crf values are not comparable. Notice how the -crf value passed to the MPEG4 command is lower than that of the value passed to the WebM command, which might make you think you're getting a higher quality video with MPEG4. A lower number corresponds with a higher quality video, but also a larger file size. crf 25 -> Specify the video quality to be used. b:v 0 -> Specify a bitrate of 0 to enable "Constant Rate Factor" mode for the MPEG4 encoder. i input-name.gif -> Specify the input file. Unfortunately, WebM video browser support isn't as good as that of MPEG4.ฤก ffmpeg -i input-name.gif -b:v 0 -crf 25 output.mp4 WebM has been around since 2010 and has a slight advantage over MPEG4 in that it can achieve equal quality video at a smaller file size compared to MPEG4. As shown above, Twitter uses MPEG4 videos to replace GIFs. MPEG4 is the format that's been around for the longest since around 1999 and enjoys great browser support. There are 2 video formats that are popular choices for videos on the web: WebM and MPEG4. Even better, Cloudinary can automatically convert GIFs to WebM and/or MPEG4 videos which will result in even more savings in file size compared to the lossy GIF compression. Because they are using Cloudinary, the Dev Community could take advantage of Cloudinary's ability to use lossy compression to compress any uploaded GIF assets and reduce the file size by around 50% without losing too much quality. One other thing that I've noticed with the Dev Community is that they are using Cloudinary as a CDN for their image and video assets (notice the URL of the GIF source in the HTML element). Support for the loading attribute on img elements at the time of writing ( See current support here).
#Ffmpeg gif no compression download#
By reducing the amount of data a user needs to download to view content, they are able to load assets faster as well as use less mobile data (which can be very expensive, especially for us Canadians). This is something very important for Twitter, where users may encounter many GIFs while scrolling their timeline (which translates to more data being downloaded on a user's phone). Actually, when you post a GIF on Twitter, Twitter converts the GIF into a video, which dramatically reduces the file size. Video files are much smaller than GIFs and they are more easily decoded in the browsers compared to GIFs. However, there is a better alternative to using GIFs and that alternative is to use videos instead. GIFs are not optimized to be used on the web: their file size is very large and decoding GIFs in the browser is not a very performant operation. With that being said, GIFs are not good for the web. They are used on Twitter as a way to react to something, they are used in blog posts to make them more interesting, and they are used for the majority of conversations amongst coworkers on Slack (or maybe that's just me?). GIFs are an omnipresent part of the internet.