I use this shell script for generating gifs out of .mov files: https://gist.github.com/artursapek/5b3d15ecac5ff75593c4 I can probably improve it further by using some of what's in this article, but it's already faster and better than any online tool I've found.
> (convert -delay 5 -loop 0 $tmp_dir/ffout*.png $2) >& /dev/null So using ImageMagick for this... How is this memory wise BTW? (all frames are in memory at once or not?)
High quality GIF with FFmpeg
21–30 of 131 posts
Re: High quality GIF with FFmpeg
#22ffmpeg is downright magical - just don't get caught using the one in the Ubuntu/Debian repositories. Compile your own ffmpeg if you have any need to do serious work; the Libav fork just isn't as capable. The reasons are obvious if you look into the development philosophies of the two projects. https://github.com/mpv-player/mpv/wiki/FFmpeg-versus-Libav
I think that ffmpeg is returning in Ubuntu 15 http://www.webupd8.org/2014/11/ffmpeg-returns-to-official-ub...
Re: High quality GIF with FFmpeg
#23I use this shell script for generating gifs out of .mov files: https://gist.github.com/artursapek/5b3d15ecac5ff75593c4 I can probably improve it further by using some of what's in this article, but it's already faster and better than any online tool I've found.
You can pipe the frames from FFmpeg to convert to avoid temporary files. http://superuser.com/a/730389
Re: High quality GIF with FFmpeg
#24And to complete the circle, run the gif through Gfycat and check out the mindblowing bandwidth savings: http://gfycat.com/IllustriousHairyGermanpinscher GIF: 1 MB Video: 73k
> Video: 73k
Yes, but with some loss of quality http://imgur.com/1qkJYEA
(not as much as I thought, though)
Re: High quality GIF with FFmpeg
#25And to complete the circle, run the gif through Gfycat and check out the mindblowing bandwidth savings: http://gfycat.com/IllustriousHairyGermanpinscher GIF: 1 MB Video: 73k
Yes please. Let's leave GIF in the 20th Century, where it belongs.
also, what about alpha transparency? video formats do not have this. GIF is shitty for video clips, but it's not without uses. it just needs to be replaced by APNG [1].
Re: High quality GIF with FFmpeg
#26So it'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'd want to avoid it if possible. In any case, you can see the difference a better quantizer makes here: http://www.leptonica.com/color-quantization.html
here's how my quantizer does: full-color, undithered, floyed-dithered: http://imgur.com/a/lrLTd#0 repo: https://github.com/leeoniya/RgbQuant.js demos: http://o-0.me/RgbQuant/ this image is actually a pretty poor example of quantization, it's too easy. full color gradients give a much better indicator of behavior, quality and performance. if you really are interested in different algorithms, check this out: http://www…
Re: High quality GIF with FFmpeg
#27Since this project does exactly that, I took a second look and found a discussion on that specific use case [3]. It didn't quite clarify things, but it looks like it _might_ be legal to use FFmpeg in an app.
[1] https://github.com/OpenWatch/FFmpegWrapper [2] https://www.ffmpeg.org/legal.html [3] https://trac.ffmpeg.org/ticket/1229
Re: High quality GIF with FFmpeg
#28And to complete the circle, run the gif through Gfycat and check out the mindblowing bandwidth savings: http://gfycat.com/IllustriousHairyGermanpinscher GIF: 1 MB Video: 73k
I like to imagine going back in time to 2005-06 and telling myself "You know what's going to come back in a big way? Animated GIFs!" I wouldn't believe myself whatsoever.
If this had happened no one would need to use GIFs. :(Re: High quality GIF with FFmpeg
#29Earlier quoted context omitted.
here's how my quantizer does: full-color, undithered, floyed-dithered: http://imgur.com/a/lrLTd#0 repo: https://github.com/leeoniya/RgbQuant.js demos: http://o-0.me/RgbQuant/ this image is actually a pretty poor example of quantization, it's too easy. full color gradients give a much better indicator of behavior, quality and performance. if you really are interested in different algorithms, check this out: http://www…
That is pretty amazing, thanks for sharing. I am interested in different quantization methods, if only for screenshot usage ( I am working on a remote control product, and the quantization used to be quite poor before I added in octree ). Of course, most of my code is in C# but I can at least take a look at the algorithms, and if they are MIT licensed, I can see what it would take to convert them.
Re: High quality GIF with FFmpeg
#30Earlier quoted context omitted.
That is pretty amazing, thanks for sharing. I am interested in different quantization methods, if only for screenshot usage ( I am working on a remote control product, and the quantization used to be quite poor before I added in octree ). Of course, most of my code is in C# but I can at least take a look at the algorithms, and if they are MIT licensed, I can see what it would take to convert them.
nQuant is a quantizer in C#, Apache licensed http://nquant.codeplex.com/
I'm actually in the process of porting it to js using typed arrays and possibly WebGL/GLSL. You can compile it pretty easily to asm.js for max pure-js perf via Emscripten, but I don't know how clean its API/interface will be and if it will leak globals based on how the code is structured [1]