Live data from Hacker News

High quality GIF with FFmpeg

blog.pkh.me

121–130 of 131 posts

Re: High quality GIF with FFmpeg

#121
post #110
post #100

Earlier quoted context omitted.

Aligned subdivisions are not that much of a problem actually. I've tested median cut that can cut at various angles and variants that cut out spheres, and it didn't make much difference. Choice of the box to cut and the location where you cut is more important. Wu's method is nice in this case because it exactly measures variance of sets after a split, while median cut just estimates. However, Wu's method needs looku…

> However, Wu's method needs lookup tables for the whole color (hyper)cube, You're talking about the 1991 method. The 1992 paper I cited explicitly claims as one of its advantages that it does not require lookup tables (and thus avoids the usual step of pre-quantizing down to 5 bit color to get a reasonably-sized table). Your two big wins sound an awful lot like "K-means". I'd believe they are responsible for the bul…

It is similar to K-means, but with exactly the crucial difference that clusters are not random, but picked by a guided subdivision algorithm.

Re: High quality GIF with FFmpeg

#123
post #64

ffmpeg 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

> ffmpeg is downright magical Actually, in my experience, ffmpeg is the linux-program that by far outshines any other program in... failing or crashing :/ I'm sorry to say this. And, unfortunately, there isn't any other open source program doing a better job in terms of file format support.

Let me guess: you are using Ubuntu?

Re: High quality GIF with FFmpeg

#124
post #79

Earlier quoted context omitted.

I just realised that imgur does not support webm. I thought it does. Thats kind of stupid. For other websites it'd be as simple as adding a mime type to the list of accepted uploads. Unfortunalty you are right, right now webm is still exotic.

I've seen WebMs on Imgur. When saved and opened to check the encoding some are VPx, while others are h.264 encoded in a WebM container. I can probably find some links later. As I see no option to upload video directly I'm wondering if it requires an account, or whether it was their new(ish) GIF conversion process (IIRC some look like original videos though).

You can't upload webms tough.

Re: High quality GIF with FFmpeg

#125
post #108
post #65

Earlier quoted context omitted.

Global support for h.264 video in the browser: over 90%. And on the desktop it's close to 100%. That's IMO just good enough.

GIF autoplays inline in the page. Video doesn't (it animates on tap w/ all other content obscured). (On the iPhone, anyway.) Makes it completely unsuitable for many uses of GIF. Would love to be wrong or out of date on this, so feel free to let me know if I am ;)

Aside: if you disagree with this philosophy and do not want GIFs to auto-play, there's a very handy Firefox extension to accomplish just that: https://addons.mozilla.org/en-US/firefox/addon/toggle-animat...

I find it makes reading the web a much more pleasant experience.

Re: High quality GIF with FFmpeg

#126
post #79

Earlier quoted context omitted.

That's not what I was referring to. Yes, technically videos are superior, no doubt. The nice thing about GIFs is though that they are treated like images by the browser and the OS. That makes them easier to handle by non-technical users (think imgur, Tumblr, etc.).

I just realised that imgur does not support webm. I thought it does. Thats kind of stupid. For other websites it'd be as simple as adding a mime type to the list of accepted uploads. Unfortunalty you are right, right now webm is still exotic.

WebM is dying – since Microsoft and Apple aren't implementing it, you're basically asking whether it's worth doubling your file storage to support a format available in maybe 60% of browsers versus one supported by 90%:

http://caniuse.com/#feat=webm http://caniuse.com/#feat=mpeg4

That's even more compelling when you remember that the only browser which had releases with support for WebM but not H.264 is Firefox and that's been phasing out for awhile: support for H.264 shipped in FF21 on Windows, FF26 on Linux and FF35 on OS X.

Unless you have a lot of Mac users who don't upgrade, it's probably not worth the hassle particularly since WebM doesn't compress as well as H.264. If VP9 ships that story could change if it delivers an advantage over H.265 compelling enough to get Microsoft or Apple to integrate it or the larger video sides to add it to their toolchain. For most places it'd have to be really compelling to be worth nearly doubling their storage costs.

Re: High quality GIF with FFmpeg

#127

Earlier quoted context omitted.

Debian unstable has official ffmpeg packages, and as soon as the next release completes, those packages will migrate to testing and future stable.

There are a number of useful codecs and filters that have non-free licenses. Debian packages will never have them enabled. Self compiles are the only way to get the ffmpeg kitchen sink.

Almost all of the questionably licensed and non-free codecs were removed from ffmpeg years ago. The only remaining bits left are those for AAC support via libfaac, and ffmpeg has its own reimplemented version of AAC that doesn't depend on libfaac.

You might be thinking of mplayer, which has extensive support for non-free codecs, such as the "w32codecs" bundle.

Re: High quality GIF with FFmpeg

#128
post #90
post #88

Earlier quoted context omitted.

Firefox ships their own decoder now, Cisco donated a license of the MPEG patents to Mozilla.

I have been told that's only used for webrtc. playing tags uses ffmpeg on linux or media foundation on windows.

>playing tags uses ffmpeg on linux

If only. It uses that broken pile of abstraction called GStreamer.

Re: High quality GIF with FFmpeg

#129

Earlier quoted context omitted.

Firefox on Android plays inline videos just fine. Sites like GFYcat work as expected, and loop appropriately.

Much to my annoyance. I desire to disable all autoplay of all inline videos across all browsers on my phone. Quite difficult to achieve.

I think this should definitely be an option. This is a really personal preference and there is no reason you should suffer through autoplay videos if you don't want to.

I would want it on, at least for some sites, like Gyfcat and Imgur because otherwise my phone slows down to a crawl, trying to load and render a GIF.

Re: High quality GIF with FFmpeg

#130
post #100
post #72

Earlier quoted context omitted.

Any method that makes axis-aligned subdivisions (which includes both standard median cut and octree), even in a space like HSV, is going to be pretty suboptimal. There's probably been more sophisticated things done since I looked at this in the 1990's, but Xiaolin Wu's 1992 approach [1] works quite a bit better than both (including the 1991 Wu v2 implementation of an octree method linked elsewhere in this thread). It…

Aligned subdivisions are not that much of a problem actually. I've tested median cut that can cut at various angles and variants that cut out spheres, and it didn't make much difference. Choice of the box to cut and the location where you cut is more important. Wu's method is nice in this case because it exactly measures variance of sets after a split, while median cut just estimates. However, Wu's method needs looku…

For apng2gif I modified Wu's method to use 64x64x64 cube (instead of original 32x32x32), and the results are much better. It doesn't require too much RAM, especially compared with what was available in 1992.
Post reply on HN