TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

High quality GIF with FFmpeg

482 pointsby uxabout 10 years ago

16 comments

dangerlibraryabout 10 years ago
ffmpeg is downright magical - just don&#x27;t get caught using the one in the Ubuntu&#x2F;Debian repositories. Compile your own ffmpeg if you have any need to do serious work; the Libav fork just isn&#x27;t as capable. The reasons are obvious if you look into the development philosophies of the two projects.<p><a href="https://github.com/mpv-player/mpv/wiki/FFmpeg-versus-Libav" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mpv-player&#x2F;mpv&#x2F;wiki&#x2F;FFmpeg-versus-Libav</a>
评论 #9213386 未加载
评论 #9214751 未加载
评论 #9214608 未加载
评论 #9214296 未加载
评论 #9213993 未加载
quotedmycodeabout 10 years ago
So it&#x27;s using a simple Median Cut quantization... which is okay, but you can get great results using an octree quantizer, and without dithering. Dithering kills your compression savings in GIF so you&#x27;d want to avoid it if possible. In any case, you can see the difference a better quantizer makes here:<p><a href="http://www.leptonica.com/color-quantization.html" rel="nofollow">http:&#x2F;&#x2F;www.leptonica.com&#x2F;color-quantization.html</a>
评论 #9215040 未加载
评论 #9213599 未加载
评论 #9215762 未加载
评论 #9214581 未加载
评论 #9213671 未加载
1risabout 10 years ago
&gt;As you probably know, GIF is limited to a palette of 256 colors.<p>No, it&#x27;s not. OK, the current, wrong, implementations do limit it to 256 colors, but that&#x27;s not a limitation of gif. Mulitple frames without a delay allow multiple pallets and multiple times 265 colors.<p>But this limitation is just another reason not to use it.<p>Can I use Webm?<p><a href="http://caniuse.com/#feat=webm" rel="nofollow">http:&#x2F;&#x2F;caniuse.com&#x2F;#feat=webm</a><p>Yes, you can, and you should. Or h.264:<p><a href="http://caniuse.com/#feat=mpeg4" rel="nofollow">http:&#x2F;&#x2F;caniuse.com&#x2F;#feat=mpeg4</a>
评论 #9214075 未加载
评论 #9214744 未加载
评论 #9214191 未加载
评论 #9216881 未加载
artursapekabout 10 years ago
I use this shell script for generating gifs out of .mov files: <a href="https://gist.github.com/artursapek/5b3d15ecac5ff75593c4" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;artursapek&#x2F;5b3d15ecac5ff75593c4</a><p>I can probably improve it further by using some of what&#x27;s in this article, but it&#x27;s already faster and better than any online tool I&#x27;ve found.
评论 #9213425 未加载
评论 #9213616 未加载
FranOntanayaabout 10 years ago
ffmpeg doesn&#x27;t get nearly enough credit. As long as you can grok the various settings, it makes you feel like McGyver with a paperclip. We work often with media from unusual sources, and after the first &quot;can we do this with ffmpeg&quot; filter there&#x27;s very little left to handle.
Pephersabout 10 years ago
This is pretty cool. I use GIFs for marketing for my SaaS startup[1] because it has the best support for autoplaying across devices, but the file sizes are a bit high (690 KB and 270KB for screencasts of a few minutes each). I use licecap[2] for recording and Gifsicle for optimizing, but perhaps I should give ffmpeg a go and compare the results.<p>[1] <a href="https://zapla.co" rel="nofollow">https:&#x2F;&#x2F;zapla.co</a><p>[2] <a href="http://www.cockos.com/licecap/" rel="nofollow">http:&#x2F;&#x2F;www.cockos.com&#x2F;licecap&#x2F;</a>
theophrastusabout 10 years ago
This is an interesting discussion, thank you. It would be great to see it compared with the parallel ImageMagick methods: <a href="http://www.imagemagick.org/Usage/anim_opt/" rel="nofollow">http:&#x2F;&#x2F;www.imagemagick.org&#x2F;Usage&#x2F;anim_opt&#x2F;</a>
评论 #9213664 未加载
syocabout 10 years ago
There is no reason to create new content in .gif and not webm as of now. FFmpeg is really nice though.
评论 #9215088 未加载
mplewisabout 10 years ago
I wanted to use FFmpeg in an iOS app, but I ran into licensing issues—the FFmpeg wrapper [1] and FFmpeg itself [2] are both LGPL 2.1, which I didn&#x27;t think you could use in an iOS app.<p>Since this project does exactly that, I took a second look and found a discussion on that specific use case [3]. It didn&#x27;t quite clarify things, but it looks like it _might_ be legal to use FFmpeg in an app.<p>[1] <a href="https://github.com/OpenWatch/FFmpegWrapper" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;OpenWatch&#x2F;FFmpegWrapper</a> [2] <a href="https://www.ffmpeg.org/legal.html" rel="nofollow">https:&#x2F;&#x2F;www.ffmpeg.org&#x2F;legal.html</a> [3] <a href="https://trac.ffmpeg.org/ticket/1229" rel="nofollow">https:&#x2F;&#x2F;trac.ffmpeg.org&#x2F;ticket&#x2F;1229</a>
评论 #9214101 未加载
neeeeabout 10 years ago
Gifsicle is very good at making highly optimized GIFs, but slightly more cumbersome as you have to convert each frame to a separate image first.<p><a href="http://www.lcdf.org/gifsicle/" rel="nofollow">http:&#x2F;&#x2F;www.lcdf.org&#x2F;gifsicle&#x2F;</a>
oakwhizabout 10 years ago
What would be really cool is if ffmpeg&#x2F;avconv gained the ability to create lossy LZW GIFs, like in this tool:<p><a href="https://github.com/pornel/giflossy" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;pornel&#x2F;giflossy</a>
sorenjanabout 10 years ago
Nice article and good job implementing it. I would have preferred a small explanation of the filter graph option (-lavfi), but I guess that&#x27;s outside the scope of the post.
评论 #9214038 未加载
lnanek2about 10 years ago
The improved screenshots do look quite improved, with less screen door effect. Nice.
simasabout 10 years ago
Very nice of you to share this with the community! Examples are just awesome.
pkhamreabout 10 years ago
I like your domain.
imaginenoreabout 10 years ago
And to complete the circle, run the gif through Gfycat and check out the mindblowing bandwidth savings:<p><a href="http://gfycat.com/IllustriousHairyGermanpinscher" rel="nofollow">http:&#x2F;&#x2F;gfycat.com&#x2F;IllustriousHairyGermanpinscher</a><p>GIF: 1 MB<p>Video: 73k
评论 #9214213 未加载
评论 #9213438 未加载
评论 #9213492 未加载
评论 #9213679 未加载
评论 #9213797 未加载
评论 #9215662 未加载