Alternative to GIFs for animations

Ethan
09 Jun, 2017 06:23
Hi all,

I've always had problems with GIFs: they're lossy (up to 256 colors per file), which is especially noticeable whenever they're used for animations. I also have troubles getting them to fully play on Chrome and Firefox under circumstances I have yet to figure out. Here are two examples I have issues with: [LINK], [LINK]. Do note that this seems to be an issue with the browsers instead of AstroBin. They play fine on Edge and Internet Explorer.

However, I was usually fine with them because I assumed they were smaller and more efficient files when compared to alternatives like MP4 videos embedded in HTML5. However, it has come to my attention that the contrary is actually true. Here's an example I found: https://codepen.io/tombennet/pen/EKrezZ.

Not only is the size of the MP4 video smaller, but the overall animation is smoother and more vibrant. Anecdotally, I also find this to be true. I recently saved the exact same animation as a GIF and MP4 using Photoshop. The animated GIF is 916 KB, while the MP4 video is 541 KB and looks much cleaner.

As a result of my findings, I propose for us to have the ability to upload MP4 files as an alternative for animations. Also, I think if this was to be implemented, any audio tracks in the MP4s should be removed or not allowed to be uploaded, but that's my personal opinion.

-Ethan Chappel
McComas
09 Jun, 2017 14:41
I am all for this proposal as I have just started time lapse photography (put my first one here earlier this month( http://www.astrobin.com/298490/?nc=user)). I first made it as a wmv format then had to redo the video as a GIF in order to upload it here. To me it seemed to degrade some from the original. The software I use could have saved it in a MP4 format. I will go back to this a see if the MP4 looks better. As we all do here on this site, we want to post our best images.
GreatAttractor
17 Jun, 2017 17:39
I don't have problems with GIFs, as i only create mono (or colorized mono, i.e. still just 256 colors) animations, but I agree MP4 support would be nice. I did some testing and it's easy to create an e.g. H264-encoded MP4 (say, using FFMPEG) which preserves practically all the details, but is only 50% the size of an equivalent GIF.

Sadly, for solar animations (where the whole of frame undergoes small-scale changes) using YouTube or other video hosting services is hardly an option; they recompress the videos, which ruins fine details, introduces banding etc.
steven_usa
19 Jun, 2017 02:27
Great topic, I wanted to add that another nice feature that I wish animated videos had was a "frame indicator".    I've read about ways to do this with Photoshop – while not extremely hard, it does require Photoshop and a lot of layers and scripting to embed the currently frame indicator.    I then tried doing this manually with a tool like Nero Video (which can take the GIFs, easily add them to a sequence, then cut and paste a Text overlay – then you can get your resulting MP4, AVI, or a lot of other formats).   What seems like such an "easy thing" is actually kind of complicated, since it is basically embedded a kind of "water mark" (or transparent overlay of one video over another) on to the image product  (which I guess brings up another point: can AB place watermarks on animated "image" products?).    Anyway, manually added a frame marker to a corner of a sequence gets tedious when it is past 10-20 frames or so.   I don't have a quick recommendation on how to help automated this via a website, but I am just mentioning it as a "features request" that would provide a lot of convenience (to know both the sequence index, and amount of time between sequences, to then know an offset amount of time)

NOTE: one of my own a GIF animation of an asteroid that I had uploaded is at http://www.astrobin.com/284138
(this sequence represents over an hour of real time, even though the sequence only takes a few seconds)
Thirteen
22 Jun, 2017 16:05
As a feature request, mp4 support would be great.    smile
gulinux
28 Aug, 2017 18:53
Agreed, probably mp4 is the best way now to show animations!
WeBMartians
05 Feb, 2018 20:38
I agree that MP4 capability would be desirable (I intend to target time lapse imaging too). However, I must add some notes:
  • Which MP4?
  • Matroska, MKV, AVCHD? YouTube accepts a variety of formats, including .MOV, .MP4, and (listed distinctly from .MP4) .MPEG4. Vimeo is more restrictive but does accept most MP4 formats.
  • HTML5 introduced the <audio> and <video> tags to make browser play of media files that much easier:
  • the server stores the file, just as it would an image, and the browser does all of the heavy lifting.
  • Security issues are not likely. There exist "Common Vulnerabilities and Exposures" notices for both GIF89a and for a variety of MP4 formats
  •    … but not many. Concern has been expressed that as browser developers struggle to implement <audio> and <video>, vulnerabilities will appear; something that has been resolved with the much more mature code for GIF89a.
  • GIF89a explicitly limits any one file to 2GB while certain MP4 files can be much larger.
  • Even today, 2GB is a large file, and the incidence of 2G+ MP4 files is exceedingly rare.
Regarding the questions of colors and file sizes, the color limitations of GIF89a are more due to history than capability. I present this information in the hopes that it might ease work-arounds in the absence of MP4 support.

GIF89a can, indeed, convey a full gamut of hues, however, most of the available tools for generating .GIF files do not incorporate the appropriate facilities. The same is true for compression and smooth animation.
  • There's nothing in the GIF89a specifications that prevents encoding 32bit or even 64bit pixels, and, believe it or not, the same is true for audio. The difficulty is that almost no browser supports GIF pixels other than as 1, 2, 4, or 8bit indices; I know of no support whatsoever for GIF audio.
  • You can accomplish the presentation of full gamut color by successive frames, each with a different palette. What happens is that as each frame is rendered, it augments the previous frames' images. Yes, like encoding larger pixels, this capability is not easily exploited by the average author.
  • Here's something you can do with current tools to improve animation: be very careful with frame duration. GIF89a supports durations as short as 10ms; that's 100f/s. Because each frame may code a different duration, the result is that a GIF file is a form of variable frame rate movie, something only now just beginning to appear in new media standards. A somewhat hard to acquire application (Microsoft GIF Animator) has a nice interface for this; a variety of currently promoted apps have animation duration facility.
  • A similar trick is available for compression: transparency, between different frames forming a single image, may be exploited to reduce file size. Combined with color reduction (the best I can recommend is Gift Export and, also, an obsolete application, MGI PhotoSuite), transparency can yield remarkably small files.
  • Difficulties playing GIFs under Chrome or Firefox are mostly due to technical anomalies having nothing to do with GIF itself; although I note that Chrome is Google-sourced and Google has been notably reluctant to allow GIF playback from its Google Sites service.
Summary:
  • Color work-arounds are available. MGI PhotoSuite is an option even though it is ancient. It reduces color admirably, even to 4bit pixels. Also, it incorporates an easy-to-use transparency capability. I've heard good noises about Wondershare's Filmora.
  • MS GIF Animator provides a nice means to control frame duration; installation, especially under Windows 10, is going to be a hernia, though. The Gift Export package is something worth considering, and the Filmora editor is worthy of attention.
 
Register or login to create to post a reply.