14 ms·
Evolution of <img>: Gif without the GIF
- mmastrac 9y agoUnsurprisingly, Apple goes for the patent-encumbered video format [1]. I'm disappointed that Firefox never really had the opportunity to "win" the browser wars and push more user- and developer-friendly formats on the world. [1] http://scratchpad.wikia.com/wiki/MPEG_patent_lists#H.264_patents http://scratchpad.wikia.com/wiki/MPEG_patent_lists#H.264_pat... (the vast majority of the patents will expire by 2023, but 2027 is the last probable date that it will be encumbered)
- bpicolo 9y agoThis is to support sites like imgur, reddit that are essentially distributing GIFs as MP4s now. They didn't really determine the format that the community adopted
- finnn 9y agoimgur converts to the most widely supported formats. This is not a community issue.
- bpicolo 9y agoYeah, but mp4 saves on bandwidth and is buffered vs gifs. https://blog.imgur.com/2014/10/09/introducing-gifv/ https://blog.imgur.com/2014/10/09/introducing-gifv/ gifv is just rebranded mp4 more or less
- always_good 9y agoActually, .gifv is an html page with a <video> with both webm and mp4 sources.
- bpicolo 9y agoRight, this let's them repurpose the same mp4 files and give iOS users a better experience
- sli 9y agoOr at least try to. Imgur's mobile experience is lacking a lot.
- gsich 9y agoDesktop too. The absolute main feature of such a site is the absolute link to the picture. That is the most important thing you need after you uploaded an image. Yet imgur tries to hide it as much as possible, forcing you to use the "show url to image" stuff in browsers.
- always_good 9y agoIt's been some time since that was the main feature of imgur. For example, imgur redirects hotlinked images to its embedded view in some cases. One of those cases is when they decide that your domain is using them as a CDN, which they forbid.
- gsich 9y agoAnd since then the main purpose of imgur is lost. I rather upload screenshots to my own site. I don't hope they go down the Imageshack road...
- Houshalter 9y agoYou also can't save the video. At least not in firefox.
- jessriedel 9y agoI've never really understood this. I previously had figured that the popularity of GIFs on reddit had been about bandwidth and load times. In that past, video would be too slow for the rapid novelty stimulus reddit offered, while GIFs were lightening. But now every "GIF" people post is a just full movie, and it loads more slowly than YouTube or other websites that are smartly structured to handle video. Why do they do this?
- bpicolo 9y agohttps://blog.imgur.com/2014/10/09/introducing-gifv/ https://blog.imgur.com/2014/10/09/introducing-gifv/ has some of the details. It definitely makes sense technically. It should in most cases reduce file size, and also allows you to stream content in buffered so you don't need to wait for the whole thing to load for it to play. (Though I believe streaming in gifs is teeeechnically possible? I feel like I saw a demo one time that made a clock by streaming in gif frames)
- toomuchtodo 9y agohttps://hookrace.net/blog/time.gif/ https://hookrace.net/blog/time.gif/ https://news.ycombinator.com/item?id=14996715 https://news.ycombinator.com/item?id=14996715
- jessriedel 9y agoHey thanks, this is super useful! I still don't quite get it though. I understand that converting huge HD GIFs to a standard video format allows steaming and better compression, but why encourage people to upload it like this rather than just upload videos? The only explanation in the post is "the culture of the GIF now trumps the file format. With Project GIFV, Imgur is reimagining the looping GIF video with all the richness it deserves as a key piece of Internet culture." Is the idea just that people want soundless looping HD video, and they're accustomed to uploading GIFs, so Imgur is going to accommodate them by doing the conversions server-side? I guess this is an explanation, but it's a surprising one. For instance, it doesn't really fit well with the observation that people uploaded GIFs of content that was obviously native video and not connected to internet GIF culture, e.g., sports videos.
- deleted 9y ago[deleted]
- DCKing 9y agoTo be quite fair, the only reason the community adopted these is because it's the only format that works across all browsers. If Safari and IE had supported free video codecs they would have very likely supported that. By the way, MP4 is a completely open standard (open does not equate 'free') and is free to use for videos that are also freely distributed. Of course there are also free and open source implementations of the codec. Being patent encumbered sucks but in principle there should be no practical limitation for gifs at least.
- user5994461 9y agoThis makes no sense. mp4 is not a video format. mp4 is a container. It typically contains an audio stream and a video stream. The streams are encoded and the majority of the formats are patented with license fees.
- cbhl 9y agoISOBMFF is the new TIFF -- it can contain just about anything. Heck, Apple have started using it for images, too (that's what HEIF is).
- ornitorrincos 9y agowhile not really helping the base patent issues, cisco does offer binaries for the openh264 codec with all royalties paid for
- aqme28 9y agoThere are other formats than MP4 though (like webm). Imgur supports those.
- ckocagil 9y agoNo. This is because Apple is a part of MPEG-LA. Apple has never supported any effort to give the web an open, non-patent-encumbered video codec. Find the missing tech company: http://aomedia.org/about-us/ http://aomedia.org/about-us/
- my_ghola 9y agoWell GIF was encumbered by patents for 23 years [0]. Perhaps they were trying to recreate the same "feature". [0] https://www.gnu.org/philosophy/gif.html https://www.gnu.org/philosophy/gif.html
- 0x4a42 9y ago> Unsurprisingly, Apple goes for the patent-encumbered video format. At least this is in the continuity of the legacy GIF format.[1] </sarcasm> [1] https://en.wikipedia.org/wiki/GIF#Unisys_and_LZW_patent_enforcement https://en.wikipedia.org/wiki/GIF#Unisys_and_LZW_patent_enfo...
- Veratyr 9y agoThis I can deal with, everyone else has been supporting this for ages. The bigger question for me is whether Apple will support AV1 like the rest of the industry or skip over it like they did with VP9.
- innagadadavida 9y agoPatents help pay for research and keeps a lot of smart and hard working tech people employed. Stop bad mouthing it as though you are losing one of your God given rights. There are surely issues with greedy companies doing greedy things with it. But then there are issues with everything... like greedy Ad companies selling your profiles and collecting more data in the name of AI.
- tedmielczarek 9y agoSoftware patents are bad and should be abolished.
- ntaylor 9y ago> Patents help pay for research and keeps a lot of smart and hard working tech people employed. Maybe when used correctly. In the tech space, it seems like they hardly are, anymore.
- rhizome 9y ago"How dare you criticize X when there are starving children in the world!"
- erik_seaberg 9y agoA good patent brings us a more competitive solution to a problem than we otherwise would have had. A bad patent is a land grab, a punitive unearned tax on the entire problem, and those have been getting worse.
- ksec 9y agoNot sure why you are downvoted, ( may be because of the tone and languages used ). But people from the academics, and companies do spend a lot of money on R&D in video encoding. These patents are not those silly one click web purchase patents, there are lots of thoughts, experiment into it. I would have thought anyone who has been to Uni / College would know this, after all it is part of how University gets funding these days. The problem is price. What should these patents cost.
- epistasis 9y agoI'm curious, have people sent patches to WebKit to support this?
- niftich 9y agoInstead, Chrome "won" the browser wars and pushed a different, incompatible format -- VP8 -- which [1] they bought from a private company on the world; a format they quickly deployed across Google properties, but took years to document. Further, they claimed VP8 infringed no patents but refused to indemnify users against patent suits; the MPEG LA began forming a patent pool on behalf of companies that claimed to hold patents on the techniques in use in VP8 and the situation didn't clear up until 2013, when Google essentially paid the license fees for everyone and agreed to sublicense these out [2]. They continued evolving the bitstream with incompatible revisions, which haven't even been finalized [3]. Nonetheless, this VP9 is widely deployed in Google properties today. In the future, a consensus codec AV1 developed by a consortium of companies will be ready for public consumption; this codec descends from VP9 while incorporating significant enhancements from Cisco and Xiph.Org. The participant companies are numerous and include big chipmakers and content delivery networks, banding together to perpetuate a royalty-free video codec that mounts a competition against MPEG's efforts, whose rules don't exclude techniques that are patented. Until AV1 is ready and good, MPEG formats form a superior choice on technical merit, as well as rigor in documentation should you choose to make an independent implementation. [1] https://en.wikipedia.org/wiki/VP8 https://en.wikipedia.org/wiki/VP8 [2] https://techcrunch.com/2013/03/07/google-and-mpeg-la-sign-licensing-agreement-covering-googles-vp8-video-codec-clearing-the-way-for-wider-adoption/ https://techcrunch.com/2013/03/07/google-and-mpeg-la-sign-li... [3] https://www.webmproject.org/vp9/ https://www.webmproject.org/vp9/
- reggieband 9y agoTo be fair, VP9 and WebM both may as well be considered de-facto proprietary formats. Chrome is almost certainly the majority browser and youtube is likely to be the most used video platform. Sending video from youtube to Chrome is probably the main use-case for that protocol. I'm not even aware of any commercial video platforms that offer VP9 as anything more than a novelty option (although maybe Anvato will now that they are slowly being integrated further into the Google universe). Even DASH is years away from real wide-spread adoption. IMO, video formats will live and die based on hardware support. If your mobile device doesn't come with a AV1 hardware decoder that works with the majority of players out-of-the-box than chances are streaming services won't support it. Apple's advantage with HEVC adoption will be their hardware.
- mratzloff 9y agoH.264 has hardware support and is already supported by the video tag. It was a battle during the video tag debate on WHAT-WG, but the decision was made a long time ago.
- JCharante 9y agoDid it get hugged? The website isn't loading for me.
- detaro 9y agoI don't see why the "issues" with the <video> tag couldn't be fixed in the video tag? "Autoplay video is used for ads and thus controlled by browsers" (and <img> video won't have the same development?!) and "<video> can't be saved" (yes, if you use a JavaScript player that interferes with it, if you just link in a file through a <video> tag at least FF and Chrome do have a save option) seem especially nonsensical. I guess there is some semantic argument for "videos that should act like images", but I somehow doubt that'll happen nicely...
- eberkund 9y agoBut a GIF was never an image, it's like now they are saying okay we called this video an "animated image" which is somehow different from a video so therefore all videos are images and should go in the image tag.
- cflat 9y agothe biggest challenge I've run into is big/legacy CMSes that simply can't get the templates updated to use <video> instead of <img>. It's why we can't have nice things.
- libertine 9y agoWhen you have multiple videos - even without audio - the autoplay stops working. So it kind of never works like gifs.
- seanalltogether 9y ago> I don't see why the "issues" with the <video> tag couldn't be fixed in the video tag? You could make that argument for a lot of html tags. <address>, <section>, <figure>. Perhaps this is the safari teams opening argument for a new tag to be added to the spec.
- lojack 9y agoThose tags add semantic meaning. Putting video in your img tag as opposed to fixing the video tag does the opposite.
- koolba 9y agoThe article mentions removing the audio track. Is that required for this to work or would it play if it's included or is that just for efficiency? i.e. will Safari simply ignore it if it's included?
- cflat 9y agodon't need to remove the audio. it's muted by the browser. removing audio just saves bytes.
- floatingatoll 9y agoIncorrect. If an audio track is present, the mp4 does not qualify for autoplay unless other conditions are met. EDIT: Context is unclear about whether the parent's guidance is about <video> or <img>. No idea what <img> does. I sure hope it doesn't play due to the wasteful audio track, so that people are forced to do it right instead of lazy, though!
- cflat 9y agoin the context of <img> the audio track doesn't play anyway. dropping it ensures you save the bytes.
- floatingatoll 9y agoAn incomplete quote from the policy statement is below. I strongly encourage y'all to read the entire article, since there's more conditions than I'm pasting here, but these are the highlights that answer your question. https://webkit.org/blog/6784/new-video-policies-for-ios/ https://webkit.org/blog/6784/new-video-policies-for-ios/ "<video> elements will be allowed to autoplay without a user gesture if their source media contains no audio tracks." "<video muted> elements will also be allowed to autoplay without a user gesture." "If a <video> element gains an audio track or becomes un-muted without a user gesture, playback will pause."
- yeldarb 9y agoLink is dead. Is it also supported on mobile Safari?
- hbbio 9y agoAPNG is also a very good way to achieve that! No limits in the number of colors, better compression. No patents? All major browsers now support APNG, Chrome being the last in the bunch :) For example, we use it in our README screencast for https://github.com/wallix/awless https://github.com/wallix/awless
- mmastrac 9y agoI didn't realize support for this had improved, but it's still missing Edge: https://caniuse.com/#feat=apng https://caniuse.com/#feat=apng You could probably polyfill something in WebAssembly for it, however!
- chrisseaton 9y ago> better compression Better compression than MP4?
- Houshalter 9y agoFor certain kinds of content, possibly.
- donatj 9y agoIs the compression actually better? I just tried re-encoding some of my larger gif files with it and they all came out 2x the size.
- 9y ago
- retrac98 9y agoOh the irony of a site named "perf planet" going down under a little HN traffic.
- prathiks 9y agowas thinking the same high fi
- deleted 9y ago[deleted]
- ourcat 9y agoBut .mp4 is a video/... MIME type. Not an image/... We have <video>, so why not use that? What next? Utterly ridiculous, Apple.
- prathiks 9y agowhat other browsers are drinking this cool aid
- lordnaikon 9y agoStill no date as input type :(
- che_shirecat 9y agoLinked site is down - it's a pretty well-written writeup, archived here - https://web.archive.org/web/20171204164627/https://calendar.perfplanet.com/2017/animated-gif-without-the-gif/ https://web.archive.org/web/20171204164627/https://calendar.... EDIT: original author put this up on medium - https://medium.com/@colinbendell/evolution-of-img-gif-without-the-gif-8da25adcca15 https://medium.com/@colinbendell/evolution-of-img-gif-withou...
- cflat 9y agoMirror: https://medium.com/@colinbendell/evolution-of-img-gif-without-the-gif-8da25adcca15 https://medium.com/@colinbendell/evolution-of-img-gif-withou...
- Ajedi32 9y agoSite is down for me so I have no idea if they addressed this in the article or not, but what's wrong with the `<video>` tag? As a user, I greatly prefer that option since it lets me control playback (via the "show controls" menu option) whereas GIFs (and presumably also mp4 "images") don't.
- cflat 9y agothe biggest draw back is the browser preloader and general performance. For cinemagraphs & clips this will be great. Anytime you want to add audio or pause/control playback, this will be the wrong solution.
- Ajedi32 9y ago> the biggest draw back is the browser preloader and general performance So why can't we just fix that issue with the `<video>` tag? (Maybe with a `preload` attribute or something.) It just seems semantically incorrect to be putting videos in `<img>` tags (and yes, I realize this same argument applies to GIFs as well). > Anytime you want to add audio or pause/control playback, this will be the wrong solution I'm referring to me as a user showing controls even when the site has them hidden. Obviously as a developer I can always just choose to not use this feature and use a video tag instead.
- potch 9y agoI've floated the idea of allowing various video formats in <source> for the <picture> element. Would allow for the right codec to be selected, and would easily allow for a <img src="foo.gif"> as the final fallback. Might be worth pushing on more.
- cflat 9y agoDon't know if you need a spec change since this is technically now supported in Safari TP. (See the example) Really it's up to the browser to decide if it wants to use the media type or not.
- treve 9y agoThis seems super pointless. Their reasons: > 1. Browser performance is slow with <video> Maybe look into ways to make <video> fast? > 2. You can’t right click and save video I never had an issue with this... But if Safari does, perhaps they should have fixed that there? > 3. Autoplay abuse Mute the video or remove the audiotrack. If even this in the future gets prevented to autoplay, then I don't see how <img> tags wouldn't as well. After all, they're just becoming the same thing.
- SaltySolomon 9y ago1. The issue here is what browsers are expecting with a <video> tag, which is long-form content and that's what they are optimizing for. 2. Depends on the browser and the player that is used. 3. Well, the <img> tag is by default much more limited, hence it is less of interested to the ad companies and the browsers allow it more freedom. But yes I agree that this is a point the browser developers should improve upon.
- phyzome 9y agoFor #1, Safari could support a "shortform" hint on the video tag.
- pendar747 9y agoThis page crashes on chromium before you even have the opportunity to read half of the article. I wonder if there is a memory leak or it's just the GIF implementation in chromium.
- twhb 9y agoThe crux of the problem seems to be where we encode the information "this video should loop". We did it before in surrounding HTML structure. The proposal is to now do it different, slightly shorter, surrounding HTML structure. As far as I can see, there's no fundamental difference, just syntax sugar and a battleground reset. How do we get the video to loop when viewed directly? When set as the background? When saved as a file? These are use cases that .gif satisfies and videos don't, or only awkwardly and inconsistently. Also note that content is inherently suited or unsuited to looping. It's rarely useful to play a normal video on a loop, or a video meant to loop just once. All this points to one solution: a new file extension that means "a video meant to be played in a loop". The format of the file need not be any different from a video. Maybe ".mp4l", ".webml", etc.
- missblit 9y agoThat would have some downsides. You to browser behavior to url in a way that never been done before, it doesn't really account for mime types or content encoding, it isn't backwards compatible at all, it doesn't allow you to use one resource in both ways, and it relies on duplicating all extension names 2x for all video formats and times no one unrelated will make a video formats ending in 'l'. If we must change this some combination of css and/or js would probably work better. Like 'img { repeat: none; }' for example
- amelius 9y agoCan we please replace image and video formats by something more generic, e.g. bytecode+data? (We can put the bytecode of the encoder/decoder in some content-addressable remote storage, and pre-fetch/pre-optimize it when necessary.)
- chronial 9y agoVideos are usually decoded in hardware.
- amelius 9y agoYes, the solution to that is to make opcodes for the special instructions typically available in hardware, e.g. discrete cosine transforms; or a more coarse grained approach if necessary. Eventually, it will be up to platform owners to provide translations from the bytecode to the underlying hardware.
- bsimpson 9y agoIf you're interested in seeing this in Chrome, star https://crbug.com/791658 https://crbug.com/791658
- the8472 9y agoDoes it support transparency and 4:4:4 chroma? Otherwise it does not cover all gif use cases. Namely pixel art and sprites. Animated PNG is probably a better replacement for those.
- jwarren 9y agoI was appalled when I first started reading this. But in reality, it feels quite true to HTML. The HTML author is declaring to the browser the purpose of this asset. This one is to be viewed as an image. This other asset is to be viewed as a video. The encoding format shouldn't dictate the tag, the content and intent should. We've been okay with animated GIFs being images for long enough now that we've kind of opted into animated images being okay in general.
- chias 9y agoI hate that I can't find fault with this argument.
- romwell 9y agoOne of the reasons GIF's are popular is that it's a format with nearly universal support, with no codecs to fuss about. Anyone can see a GIF, and anyone can edit a GIF. The proposed "improvement" offers the key limitations of GIF without the key advantages, and lacks many features. Like, what about variable frame rate? Transparency? Not fuzzing out the pixels in pixel-art? The last one specifically: a great use-case for GIF is capturing screen animations (see https://www.cockos.com/licecap/ https://www.cockos.com/licecap/). Video codecs aren't optimized for this - you won't see the comparison for such GIF's on the linked webpage.
- wolrah 9y agoIt's not supposed to replace GIFs for the things they're actually good at, like your examples. It's supposed to replace the abuse of GIFs for things they're not good at, like long, high frame rate, and/or high color depth videos. The majority of the GIFs being produced today are not things the GIF format was designed to handle.
- deleted 9y ago[deleted]
- xvilka 9y agoWebP and APNG are both good formats instead of GIF. But the problem is that Chrome developers stubbornly do not want to add APNG support, while Firefox developers, also stubbornly, do not want to add WebP support. "Thanks" to both those teams we are forced to do such hacks...
- est 9y agoIE 5.5 supported <img dynsrc=""> back in the 90s.
- roh0sun 9y agoIt’s just HEIF. http://nokiatech.github.io/heif/technical.html http://nokiatech.github.io/heif/technical.html I think we should not deny its future proving goodnees.
- cflat 9y agomp4s aren't HEIF. but this feature is certainly pre-lude to Safari supporting HEIF in the browser.