Live data from Hacker News

Twitter's GIF hack

blog.embed.ly

111–120 of 160 posts

Re: Twitter's GIF hack

#112
post #12

This is not true: "A GIF is literally a sequence of independent images squeezed into the same file. An mp4 video can take advantage of all kinds of fancy compression techniques like keyframes and forward-predictive frames." That's not why the mp4 is smaller. A GIF is not [just] independent images, you can have each frame reuse pixels from previous frames. The mp4 is smaller because lossy jpeg compression is used on e…

It's not just lossless/lossy. GIF is also rather primitive; you can store a delta from frame to frame, but the delta has to include every pixel that changed. A lossless animated format invented today wouldn't have that restriction, it would support things like pixel motion (which e.g. H.264 has).

Some years ago there were multiple efforts to produce animated PNGs. There was MNG (Multiple-image Network Graphics, which could contain both PNG and something called JNG) in 2001, and more recently, APNG (Animated PNG) in 2008. The problem here is the spotty support for these formats. AFAIK MNG is effectively dead. I thought APNG was as well (with Firefox being the only browser to support it), but interestingly, the Wikipedia page claims that Safari 8.0 (the upcoming version in OS X 10.10 and iOS 8) supports it. Chrome, Opera, and IE don't, but there is a Canvas-based library for rendering APNG which could presumably be used to polyfill support if you wanted to experiment with APNG.

In any case, the point here is that something like APNG probably has much better compression than GIF while still being lossless (I haven't done any actual comparisons here, but the PNG format itself has support for a lot of fancy compression stuff that GIF doesn't).

---

Reading a bit more, I'm actually really surprised to see that Safari 8.0 apparently supports APNG. It seems that the PNG Group officially rejected APNG back in 2007, which means that libpng will never support APNG.

Re: Twitter's GIF hack

#113
post #88

Correct me if I'm wrong, but wasn't the whole reason gifs started proliferating on the net because people wanted to share short video loops, but didn't want to embed flash or video which may not load or play correctly in a user's browser? And now we are championing the conversion of those gifs back into video? Seems like a strange round-about way of doing things. I forsee a future where all video clips on the net hav…

welcome to the future: http://www.netanimations.net/skeltw2.gif

Re: Twitter's GIF hack

#115
post #104
post #97

Earlier quoted context omitted.

I don't think gifs' recent surge in popularity has anything to do with technical issues like browser compatibility. They became popular because of artistic/aesthetic value and web culture. These features all differentiate gifs from 2010-mainstream forms of embedded video like Youtube: - starts playing automatically - loops seamlessly - never has sound - no logos or buttons like "share" and "embed" - no scrubber bar o…

I think your list of features is spot on, but I don't think their mainstream popularity had much to do with artistic expression. I'd include one other big feature: - They are dead simple to save (or link to) and drop into your own page/blog/comment. and claim that GIFs are just really easy to share and view. They've offered a better experience both for post and viewing a short soundless clip than could be provided by…

How about the fact that there is zero advertising. IMO this is the number one piece of friction for videos (mainly YT) and the users don't want them for especially quick moments (a la Vine).

Re: Twitter's GIF hack

#116
post #31
post #17

Earlier quoted context omitted.

I suspect some implementation issues rather than a GFY attitude, it doesn't work on FF or Chrome on OSX 10.9. Safari works though.

I'm looking at it right now in Chrome on Mavericks. Are you sure you checked with the right browser?

I'm using Chrome 35 on Mavericks and I also get the message. Clicking through to Twitter will display the video.

Re: Twitter's GIF hack

#117
GIFs indeed are bad for video (quality, size, no control, no sound, etc.) but in order for that to be really true, the site must allow embedding videos using the video tag (i.e. videos which people upload in proper video formats). Does Twitter allow it?

Re: Twitter's GIF hack

#118
post #100

Earlier quoted context omitted.

Okay, so take my question and s/HTML/hierarchical file systems/ or s/HTML/C/ or make any other substitution. Why ditch something just because it's old?

Well, there's a reason for the second half of my comment. GIF isn't bad because it's old, it's bad and old, and it's unreasonable to expect it to continue to be supported because that's a nasty combination. If something sucks but is still the standard technique in recent years then it's reasonable to think it should be supported. Similarly, if something is old but great, it's reasonable to think it should be supporte…

GIF itself is not so bad, for its intended purpose and time, but the animated GIF bit is a serious hack that was a bad idea from the start.

Re: Twitter's GIF hack

#119
post #12

This is not true: "A GIF is literally a sequence of independent images squeezed into the same file. An mp4 video can take advantage of all kinds of fancy compression techniques like keyframes and forward-predictive frames." That's not why the mp4 is smaller. A GIF is not [just] independent images, you can have each frame reuse pixels from previous frames. The mp4 is smaller because lossy jpeg compression is used on e…

I was able to halve size of GIFs with lossy LZW compression:

https://pornel.net/lossygif

With a good palette (which most software is terrible at) and proper delta frames (without artificial differences created by blindly applied diffusion) GIFs can be 1/4th of the size you get from an average GIF maker.

Still, it's a terrible video codec.

I think trauma caused by awful plugins like RealPlayer and QuickTime made people stuck thinking that "animated images" and "proper video" are completely different things. But with native video support in browsers IMHO there should be no divide between and GIF at all. It's the same thing, except the latter wastes more bandwidth, needs more memory or CPU (to enable seeking, used when you switch tabs) and can't be hardware-accelerated.

Re: Twitter's GIF hack

#120
post #88

Correct me if I'm wrong, but wasn't the whole reason gifs started proliferating on the net because people wanted to share short video loops, but didn't want to embed flash or video which may not load or play correctly in a user's browser? And now we are championing the conversion of those gifs back into video? Seems like a strange round-about way of doing things. I forsee a future where all video clips on the net hav…

The guy is baiting in his first couple of paragraphs. By the end of the article, he reveals that he approves of Twitter's decision. Indeed, the automatic conversion from GIF to HTML 5 is well underway with sites like gfycat, which is getting integrated into major extensions like RES if it's not there already (RES [finally] merged the code to support this last night). HTML 5 video is greatly superior to GIF; the files are many times smaller and you can pause and/or control the loop, and normal video players are equipped to handle them, which makes platform integration easier (Android's browser famously didn't play GIFs due to memory constraints in the browser's early implementations).
Post reply on HN