
AnimGIFs need a better codec - robin_reala
https://pornel.net/efficient-gifs
======
TheZenPsycho
as I've commented before, SVG fits pretty much all those criteria:

\- works inside an <img> tag

\- works in background: url()

\- supports both smil animation and css animation

\- supported back to IE10 (with css animations)

\- plays automatically in a loop with no play controls

\- can embed jpegs, pngs, videos as videostrips or diff images

\- can apply alpha transparency via a mask operation

\- flexible enough to apply a wide variety of compression techniques including
multiple update regions (where gif only supports one rect per frame)

\- Controllable via javascript (as long as you trade off putting it in an img
tag and use an object tag instead)

previous comments here:
[https://news.ycombinator.com/item?id=8038838](https://news.ycombinator.com/item?id=8038838)

all that's missing is widely available software to author SVG animations.

~~~
pornel
A major use-case is to efficiently play a clip from a video camera, so purely
vector animation or a sequence of frames from still images isn't good enough.

I've tested an SVG with an <svg:video> element
([http://www.w3.org/TR/SVGTiny12/multimedia.html#restrictedVid...](http://www.w3.org/TR/SVGTiny12/multimedia.html#restrictedVideoExample)),
but unfortunately it doesn't seem to be supported anywhere.

I've also tested an SVG playing video via HTML in a <foreignObject>. In
Firefox it does play when the SVG is opened as a standalone file, but not when
embedded in <img src>. So close :(

~~~
TheZenPsycho
sequence of still images from jpeg frames is still an improvement over gif for
that usecase. Plus, all the same optimisations (and more) that have been
available to gif for that use case are also available to SVG. Just not in any
authoring software.

------
NVI
[https://developer.mozilla.org/en-
US/docs/Web/HTML/Supported_...](https://developer.mozilla.org/en-
US/docs/Web/HTML/Supported_media_formats#Browser_compatibility)

There isn’t a single video format that is supported by all major browsers.

~~~
simoncion
Moot decided on webm for 4chan's anigif replacement. If more websites do the
same, MSFT and Apple will have their decision made for them.

We need to stop caring about the opinions of companies who aren't interested
in helping The Web.

~~~
xooyoozoo
"Helping The Web" in this case would be choosing the video format with the
broadest support base... which in this case is H264. The only holdouts are
Opera and a couple variants of Firefox. As a bonus, you'd get hardware
acceleration in almost all mobile devices and a good chunk of the desktop
market.

~~~
simoncion
Every time I've read the paperwork that came with a device that was able to
create H.264 files, the words in the paperwork prohibited me from creating
H.264 files with that device and using those files for commercial use. If I
wished to use those H.264 files in a commercial setting, I was required to
make a separate agreement with MPEG LA.

VP8 has no such restrictions. Google has said on multiple occasions that VP9's
licensing will be the same as VP8's. The VP8 and VP9 codec software is
released under a BSD license. The VP8 format specification released under a
perpetual, irrevocable royalty-free license. [0] Despite VP8 and VP9's
marginal inferiority to H.264 [1], they should be the default video format on
The Web.

WRT hardware acceleration, the Nexus 5 has hardware assist for encoding and
decoding VP8 [2]. Several Smart TV's decode VP9. [3] Given that manufacturers
won't have to kowtow to MPEG-LA, the number of devices with hardware assist
for VP8 and/or VP9 will continue to grow.

[0]
[http://www.webmproject.org/license/additional/](http://www.webmproject.org/license/additional/)

[1]
[http://carlodaffara.conecta.it/?p=420](http://carlodaffara.conecta.it/?p=420)

[2]
[https://plus.google.com/+WebRTCorg/posts/VXXwACq3wv6](https://plus.google.com/+WebRTCorg/posts/VXXwACq3wv6)

[3]
[https://en.wikipedia.org/wiki/List_of_4K_monitors,_TVs_and_p...](https://en.wikipedia.org/wiki/List_of_4K_monitors,_TVs_and_projectors#TVs)

------
germanforblack
You could also use <video src="/path/to/vid.mp4" muted loop autoplay>

~~~
pornel
That's what sites do currently, but it's still not quite there yet, because it
requires special markup and doesn't loop when you share the URL directly (I
hope the latter can be fixed easily:
[https://bugzilla.mozilla.org/show_bug.cgi?id=1041238](https://bugzilla.mozilla.org/show_bug.cgi?id=1041238)
[https://code.google.com/p/chromium/issues/detail?id=395413](https://code.google.com/p/chromium/issues/detail?id=395413)).

Annoyingly GIF isn't supported as a source in <video> either, which adds extra
complexity when you want to provide a proper fallback.

~~~
SimeVidas
I don’t think the markup for `<video autoplay muted loop>` is an issue. These
attributes exist for this use case.

That being said, video in CSS background is a legit feature request.

------
ZeroGravitas
This is one side if it, 4chan's webm is another, various 3rd party hosts,
shims and polyfills are in between.

I'd like to see Mozilla and Google capitalize on this to help spread royalty
free codecs

How does webm decoded in JavaScript compare with a gif for video? Is there a
subset (beyond removing all audio) that could speed thinks up?

~~~
derf_
> How does webm decoded in JavaScript compare with a gif for video? Is there a
> subset (beyond removing all audio) that could speed thinks up?

[https://wiki.xiph.org/Ogv.js](https://wiki.xiph.org/Ogv.js)

------
est
What's real need to be fixed is how to provide an easy copy-pastable way of
viral spreading like GIF.

GIF is popular simply because people can copy it around by 2 clicks. Copying
video files is PITA because bullshits like region restrictions, CDN providers,
dynamic URLs, etc.

~~~
scott_karana
That just the thing, though; video file formats _do not intrinsically have any
of those limitations_ , which is exactly why he wrote this article: it's a
false dichotomy.

Files are just files, and video ones are typically smaller.

Imagine, if you will, a GouTube where animated GIFs were rigorously checked
against existing copyrighted material, removed by DMCA requests, hosted around
the world. How would it be mechanically different than Youtube, except for
changes surrounding the Flash player?

Thusly, imagine Tumblr hosting WebM/H264 files instead of (or in addition to)
GIFs. Mechanically identical.

~~~
Aardwolf
On a GIF, you can right click and "save as". So a first step would be to have
all browser makers allow this for video files too.

~~~
scott_karana
When using the <video> element, you can do exactly that. So we'd probably be
in good shape. :)

(At least in Firefox, Chrome, and Safari. Try it out:
[http://www.w3.org/2010/05/video/mediaevents.html](http://www.w3.org/2010/05/video/mediaevents.html))

------
Titanbase
I don't have a problem with AnimGIFs. They work fine for their intended
purpose.

Interesting side note: I worked at Jasc Software 20 years ago in technical
support, helping people with Paint Shop Pro 7 and Animation Shop.

Animation Shop still works great for creating AnimGIFs and PSP7 still works
great for a complete 'vector+bitmap' graphics app. It's impressive that some
software is so resilient.

~~~
pornel
If by intended purpose you mean animations like smileys, then yeah, it's OK.

But if you look at imgur.com or Tumblr you'll find GIF is used mostly for
video clips and this results in multi-megabyte files with dreadful quality,
e.g. [http://ministryofgifs.org/](http://ministryofgifs.org/)

gfycat typically reports 15:1 compression improvement when converting to WebM.

~~~
Titanbase
Yeah, sometimes video formats are better, but for some purposes AnimGIFs are
fine.

How difficult it seems to pick a default codec for the web+mobile web?

EDIT: Looks like everyone is concerned with it being open source, but they
don't want to pay for it? Or they can pay for it and get a commercial license.
Either way, you should be forced to pay! XD

~~~
pjc50
We refused to pay the GIF royalties and we'll continue to do so for newer
formats.

------
clarry
Twitter is listening: [http://www.tedunangst.com/flak/post/sorry-this-gif-is-
not-av...](http://www.tedunangst.com/flak/post/sorry-this-gif-is-not-
available-in-your-browser)

------
ahoge
Some of this is covered by the WebP FAQ:

[https://developers.google.com/speed/webp/faq](https://developers.google.com/speed/webp/faq)

------
jccalhoun
"AnimGIFs?" Is this a term people really use?

~~~
SimeVidas
I was confused about that term for a few moments. We should have a standard
shorthand for animated GIF. How about aGIF or AGIF?

------
SquareWheel
I would be perfectly okay with browsers dropping support for the animated gif.
We've had better options for years.

