Live data from Hacker News

High quality GIF with FFmpeg

blog.pkh.me

41–50 of 131 posts

Re: High quality GIF with FFmpeg

#41

And 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 wish I had NSA-level overview of the internets to see how much bandwidth is wasted on poorly compressed file formats and protocols. Its weird we're talking about gif in the age of h.264 and png. So much for the "burn your gifs" patent protest from a few years ago.

Seems to me, social media sites like Facebook and Reddit have revitalized the gif for cheesy animations and memes. Its only fairly recently that hosts like imgur are converting them down to h.264 or webm for massive bandwidth savings.

We have an older guy here at work who thinks the alternative to flash is just hosting 20mb to 50mb gifs on our websites. I think people like this are still fairly common because they don't understand how terrible gifs are. Its funny the ways the web doesn't move forward sometimes.

Re: High quality GIF with FFmpeg

#42
post #39

Earlier quoted context omitted.

is it possible to have pixel-perfect animations (avoid compression artifacts completely) while using h.264 or VP8 and still get good filesize? 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]. [1] http://en.wikipedia.org/wiki/APNG

VP9 has lossless encoding support. http://base-n.de/webm/VP9lossless.html

apparently there's also hints of alpha channel, but basically no support for it outside of chrome's experimental flags:

http://updates.html5rocks.com/2013/07/Alpha-transparency-in-...

Re: High quality GIF with FFmpeg

#43

And 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

> GIF: 1 MB > Video: 73k Yes, but with some loss of quality http://imgur.com/1qkJYEA (not as much as I thought, though)

You can, say, nearly double the quality, get a 100kb file or so, and have it be much sharper. The settings he's using are fairly compressed. Generally, you should be able to go down to 1/10th the file size without too much of a quality drop.

Re: High quality GIF with FFmpeg

#44

Earlier quoted context omitted.

If only iOS (and Android?) allowed you to play inline videos the way you can on the desktop, and the way they play animated GIF's inline. Besides allowing us to adopt video throughout and save on bandwidth and have better video quality, this will be a huge productivity boost to developers: we can finally stop having the GIF vis JIF pronunciation debate.

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

"Works" with the android stock browser, however there the controls stay in the way. Same for Chrome. Does not work with opera mobile.

Re: High quality GIF with FFmpeg

#45

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

I used the http://www.deb-multimedia.org/ repository in a pinch for ffmpeg recently. Third party repo aside, what criticisms are there for this ffmpeg compared to a compiled copy?

Re: High quality GIF with FFmpeg

#46
post #18

Earlier quoted context omitted.

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.

I would like to go back in time to 1993 and make Tim Berners-Lee add video support to the element so that we could do things like this today: If this had happened no one would need to use GIFs. :(

Marc Adreessen came up with [1], not TimBL.

[1] http://1997.webhistory.org/www.lists/www-talk.1993q1/0182.ht...

Re: High quality GIF with FFmpeg

#47
post #38
post #34

Earlier quoted context omitted.

Can you show an example of an animation with more than 256 colors? As you said, the hack to get more than 256 colors is to redefine a sub rectangle with a new palette. But that's also the mechanism used to make animations. Are you able to get fluid playback with that? Note: I'm not talking about new frame being just a new sub rectangle, more about N sub rectangles for the same frame, then a delay event, then M sub re…

None that works with current browsers implantations, because they erroneous ignore no delay between frames and wait anyway. But that's a bug in the gif decoder, not a limitation of gif. OK, this is hairsplitting, but it illustrates how borken the state of gif is.

Maybe someone who cares about this should submit patches? All of the major browser engines are open-source.

Re: High quality GIF with FFmpeg

#48
post #47
post #38

Earlier quoted context omitted.

None that works with current browsers implantations, because they erroneous ignore no delay between frames and wait anyway. But that's a bug in the gif decoder, not a limitation of gif. OK, this is hairsplitting, but it illustrates how borken the state of gif is.

Maybe someone who cares about this should submit patches? All of the major browser engines are open-source.

This would probably cause regressions with other GIFs that neglect to specify a delay but are supposed to have one. It's hard to imagine this universal behavior is accidental. It's probably like everything else on the Web — a hack to keep things that shouldn't work from actually not working.

Re: High quality GIF with FFmpeg

#49

And 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 wish I had NSA-level overview of the internets to see how much bandwidth is wasted on poorly compressed file formats and protocols. Its weird we're talking about gif in the age of h.264 and png. So much for the "burn your gifs" patent protest from a few years ago. Seems to me, social media sites like Facebook and Reddit have revitalized the gif for cheesy animations and memes. Its only fairly recently that hosts li…

Imgur, popular on Reddit, actually recognized the problem and invented GIFV (which is HTML-wrapped mp4/webm)

http://imgur.com/blog/2014/10/09/introducing-gifv/

Unfortunately Facebook doesn't allow easy video embeds.

Re: High quality GIF with FFmpeg

#50

Earlier quoted context omitted.

Yes please. Let's leave GIF in the 20th Century, where it belongs.

If only iOS (and Android?) allowed you to play inline videos the way you can on the desktop, and the way they play animated GIF's inline. Besides allowing us to adopt video throughout and save on bandwidth and have better video quality, this will be a huge productivity boost to developers: we can finally stop having the GIF vis JIF pronunciation debate.

Unless somebody's producing ads, why would he insist on having the video "inline like on the desktop" on the small screen of the mobile phone?
Post reply on HN