Please add comments

A quick "how to" for animated GIFs:
To convert a set of still images into an animation:
Using the free GIMP software, load all the frames by using "Open as Layers", crop each frame to a fixed size (use the "Dockable Dialog", "Layers " to view and select each frame individually). Save (or Export) the stack of frames as an animated GIF, choosing the "animation" option.

I think all naturewatch projects should have at least one journal entry, so that there is somewhere for people to communicate about the project. So here it is :-)

(click on the journal entry title to actually see the comment/discussion area)

Posted on April 11, 2014 10:53 AM by tony_wills tony_wills

Comments

It's a nice feature that this site animates the thumbnails as well as the full images, so that they show up animated in lists etc. , inaturalist.org doesn't do that.

Posted by tony_wills almost 10 years ago

It's a nice project you have here, I hope to add a bit of content if that's okay. I've just figured out a good way to convert my videos into GIFs but it's still a work in progress. I was just curious as to how you made the thumbnails into GIFs..

Posted by russ87 about 9 years ago

The animated thumbnails are a hangover from the original https://inaturalist.nz website that allowed animated icons. When https://inaturalist.nz became a window into inaturalist.org a lot of them were imported (a couple were lost). But the site now strips them down to the first frame on upload - I tried animated PNGs and other possibilities, but no go, the door is locked ;-).

Of course you are welcome to add whatever animations you have, and any tips etc on generating them. The main problem I found was keeping them down to a reasonable size (As a ballpark figure I think 10MB is ok, but 50MB is a bit excessive). I only found 2 animated observations already on inaturalist, but I don't think the creator is still active here and they haven't accepted the invites to the project (616847, and 619140).

Posted by tony_wills about 9 years ago

Hi Tony, I stumbled on this project today and wonder if it will be possible for me to create some obs from past and future bird and insect obs ..is there any update on simplest tech and size limit?

Posted by kaipatiki_naturew... about 5 years ago

Absolute size limit is 20MB per file, but often anything above 10 to 12MB fails to load. Simplest technique is probably use an online service that creates animated GIFs.

Posted by tony_wills about 5 years ago

thanks

Posted by kaipatiki_naturew... about 5 years ago

I found a command-line gif conversion from a video file can be done using ffmpeg with ffmpeg -f gif -i in.mov out.gif. I needed some additional options to meet iNat's size limits, as per the tutorial I link below. For my first one, I used -ss 5.0 to skip the first 5.0 seconds, and might've used, say, -t 2.5 to only convert a 2.5 second clip but didn't need it for this one, & finally -vf scale=320:240 to downscale the video to 320x240.

The result, my first such animation, was a turkey vulture for which I could not provide an ID-able still photo, but is nevertheless recognizable in the vid: 25647320. It's admittedly not a good quality source video, and with a little bit of extra effort, the conversion quality could be improved, but my goal was "just good enough to recognize without spending too much time on it" and I think I managed OK on that.

For the method described above, I followed this tutorial, only having to look up and add the scaling option myself: https://engineering.giphy.com/how-to-make-gifs-with-ffmpeg/

The exact command I ended up using was: ffmpeg -ss 5.0 -i 008.mov -vf scale=320:240 -f gif 008.gif

See comments below for the better command that eventually replaced this in the final version.

As the tutorial explains, the quality may not be great with this quick-and-dirty method, but I deemed it good enough for my purposes, & did not pursue the extra steps required to improve on quality, especially considering the already rather poor quality of the source video; I don't think I could possibly have made it much worse!

Posted by benarmstrong almost 5 years ago

I've used ffmpeg but had a hard time getting a decent pallette of colours if I recall. To cut down size you can clip the image to a letter-box proportions, ie long but not very high as most of the action is in that central region and GIFs don't demand particular aspect ratios or sizes. Also 10 frames per second is plenty for GIFs, so use only every nth frame (say every 5th frame). So I'd clip the video horizontally and vertically, and skip frames and see how big the result was, then work out how much to scale the result to get down to the size limits. (with ffmpeg you'd probably have to specify the output frame rate as otherwise skipping frames would speed it up)

Posted by tony_wills almost 5 years ago

Cool. It would be nice to see a better tutorial tailored to the needs of this project added to the Tutorials area of the forum & linked here. I'd love to contribute, but at this point, need some more experience using the tool before trying my hand at one. Re. the colour palette, the tutorial I linked from giphy had some suggestions. Have you tried anything like that?

Posted by benarmstrong almost 5 years ago

I think your final result was pretty good as you can see the flight motion quite well. I would expect you could probably get away with twice as big (eg 640x480 as it would only be about 14MB). I think you can get away with bigger images if you drag and drop them on an existing observation, rather than through the normal upload page which I think times out as tries to search for meta data in the big files (but still no bigger than 20mb).

Posted by tony_wills almost 5 years ago

I did try lots of suggested ffmpeg things but found the best that works for me is to split the (short!) video into separate frames then load them into Gimp as layers. I can then easily crop the frame and add a delay at the end, or delays to any frames. But it is a bit quirky and depends on the version of Gimp that you have. But it does give the best full colour results that I've obtained. The limitations are that I can't easily change the brightness/levels/contrast over all the frames, and if I do I usually pay for it by ending up with obvious colour banding. Also it is a pain to remove extra frames, so I need to only import the frames I want (eg select start and end, and skip frames etc).

Could write a tutorial, perhaps a wiki one where people can add their ideas....

Posted by tony_wills almost 5 years ago

I crop and shorten the video using WhatsApp's inbuilt editing tools and send the video to myself.
Then I use ffmpeg to scale it down to half the size and then convert it to a GIF.
I can also change speed and contrast/brightness etc using ffmpeg if needed.

Posted by russ87 almost 5 years ago

Thanks. Maybe I'll incorporate some of those suggestions (crop, other tweaks) in other conversions.

Meanwhile, I went back and looked more carefully at the giphy tutorial and realized it was late in the day & I was too impatient. After reading the whole thing through attentively about how to use -filter_complex to get better quality, as well as layering on the fps & scale filters (whoops, missed that on the first skim through!) it's not that hard to follow, and the results really are much better than my first, clumsy attempt:

ffmpeg -ss 5.0 -i 008.mov -filter_complex "[0:v] fps=12,scale=480:-1,split [a][b];[a] palettegen [p];[b][p] paletteuse" 008.gif

For one thing, the scale=480:-1 not only produces a nicer sized video, but also maintains the aspect ratio.

So I've gone back and replaced my poor first try with the improved version. I hope others find the above one-liner useful, which I feel is a good starting point, only needing tweaks on a case-by-case basis for special needs.

Posted by benarmstrong almost 5 years ago

Yes that version is quite near the original quality.

Posted by tony_wills almost 5 years ago

Yep. Quite pleased. Also yeah, I noticed the metadata timeout thing and discovered how to do it by adding media afterwards by accident.

Posted by benarmstrong almost 5 years ago

The tutorial covers one more palette optimisation at the end. If you're fussy about palette, you might find that gives you better results (& might be less painful than the gimp process, though I guess if you're in there to do other things that might still make more sense). I found the difference between my 008.gif and 008-2.gif imperceptible (not a big surprise, given how little information of importance the colour actually carries for this one). But to save time wading through the tutorial again, here's that command:

ffmpeg -ss 5.0 -i 008.mov -filter_complex "[0:v] fps=12,scale=480:-1,split [a][b];[a] palettegen=stats_mode=single [p];[b][p] paletteuse=new=1" 008-2.gif

The author says the tradeoff is the file may be bigger (but might be smaller, too!) In my case, it ended up negligibly smaller with this command. The difference here is that a more thorough palette generation is done here frame by frame -- unsurprising here that it netted me very little, since my scene has no abrupt changes in scene & colour composition.

I ended up not using the new file for my observation.

Posted by benarmstrong almost 5 years ago

hello to everybody, I make a lot of GIFs, I really love them, but a time ago a guy pointed out that making gif is basically not ok, this user said "Inat allow the publication of photo and audios to ID your observations, not so videos .. if it were otherwise, they would be within the observation options. GIFs can help in some cases, but they are not the most appropriate way to register your observations" also said this "if Inat does not allow the publication of videos, uploading animated gifs is to trick the system, so you can do it" .
Is it really counterproductive to make gif for iNat? I think it's an entertaining way to record moments when only a video can do it, but I have no real notion of its "possible effect"

Posted by diegoalmendras over 4 years ago

iNat is well aware that animated GIFs are used, iNat specifically allows them to display. Originally animated GIFs were allowed anywhere that images or icons were displayed (eg even for User profile icons), but they modified the code to just display the first frame in some situations. If iNat didn't tolerate them, they wouldn't be here. I don't think iNat has a specific objection to videos either, support for them has often been asked for, they just haven't found them to be a priority to implement (and they may have a cost with larger storage and bandwidth required).

Animated images can be very annoying though. If they are jerky, flashing or rapidly repeating, I find them annoying - I usually set them to endlessly repeat, but after a 5 second pause after the last frame.

Admittedly in most situations the animation doesn't help with identification, but there are a few like the following where a still image wouldn't show you enough to ID:

Posted by tony_wills over 4 years ago

Very effective, I enjoyed seeing the kakariki feeding!

Posted by kaipatiki_naturew... over 4 years ago

https://ezgif.com/ works well for me for making GIfs out of individual images, turning videos into GIF, changing size, etc.

Posted by alexis_orion almost 4 years ago

Thanks Alexis

Posted by tony_wills almost 4 years ago

Thanks for the tips

Posted by tony_wills over 3 years ago

just found out this treat! https://github.com/inaturalist/iNaturalistAndroid/issues/970
"The goal is to remove animated GIFs across the system"
:(

Posted by diegoalmendras almost 2 years ago

Yes the objections to GIFs are longstanding, and in fact there used to be more support for them (ie they could be used in more places), eg you could have an animated project banner (like this project ;-),but I think they filter them out these days. The comments about making it simpler to have one file format sound like dreaming up pseudo technical justification. Given the size and sophistication of the site, it would seem to be trivial to do a little file conversion where necessary :-)

Posted by tony_wills almost 2 years ago

Interesting discussion. I recently made and uploaded my first GIFs and joined this project, and have a related how to question, so thought it would work to ask it here. This discussion may also be interesting to people thinking about the pros and cons of different ways to make GIFs. I've worked with some video editing programs in the past but not related to GIFs. My current process is to take short iphone wildlife videos, transfer them to a computer, and use Microsoft Clipchamp to make them into GIFs. I liked that Clipchamp allows video length to be edited and has an optional slow motion setting. But, one downside that most online reviews also mention is that the video quality is reduced a lot when they become GIFs. I haven't done any calculation of file size, but am assuming that a short cellphone video could if using another program probably be converted into a GIF below the file size maximum without losing much if any video quality. My videos are also very brief, which should help.

Due to the reduced video quality issue, I've waited to make additional GIFs until learning if there's a way to start with a video and convert it to a GIF of the same or at least higher quality than Clipchamp can. I'd prefer to use a program or method with an optional slow motion setting. It would be even easier if iphone had a Clipchamp-like app. When I searched for free GIF programs to download or use on their websites, it was unclear whether they'd be any better than Clipchamp. I'd prefer to use a GIF-maker with reliable good reviews if possible. Any advice on this would be appreciated. As a related question, I'd also like to learn if using "Live" iphone photos, or the shutter setting that takes many photos in a burst, would work with Clipchamp or other GIF-makers, and to hear of any pros and cons in comparing the different methods to make GIFs.

Below are my best GIFs so far, which are bees:
The first is in either original video speed or slightly slowed speed (Xylocopa virginica virginica): https://www.inaturalist.org/observations/151434597
The second is in slow motion (Bombus impatiens): https://www.inaturalist.org/observations/151433811
Unfortunately, on the day I took the videos the plants the bees were on were blowing in the wind and I was using a macro lens, which made the videos look shaky. I'm also unsure why only one of the videos has black borders, unless Clipchamp saves any that use slow motion to display that way.

Posted by bdagley 9 months ago

The quality of those GIFs is quite nice, not showing the banding artifacts often present in GIFs due to a small colour palette. I can't be much help in suggesting alternatives as I still do things relatively manually - aiming for the largest picture dimensions that I can get within the file size constraints. Often doing things like only keeping every 10th frame of video and heavily cropping to get the whole action sequence portrayed. The most difficult aspect is often not the technical aspects, but trying to produce something aesthetically pleasing, and interesting and avoid being jumpy or mind jarringly repetitious ;-)

Posted by tony_wills 9 months ago

Those bee videos are great! Nice and clear, good colours, and really nice action shots - just enough of a clip to give you a sense of what's going on.

In my preferred video editor, OpenShot, running it through a stabilization filter is often the first step for me. I suspect ClipChamp may have something like that and presents a similar user experience to OpenShot (though I've never done a direct comparison) in that there's a bit of a learning curve to figure out how to use that, as well as making sure there are no remaining artefacts from the process (like wrong aspect ratio, black bars, etc.) It took me several tries with OpenShot before I got the hang of it. Also, sometimes I found the doc less helpful than finding blogs with tutorials elsewhere on the web.

As for in-phone tools, I couldn't say. Generally I find using a phone to do any kind of photo or video manipulation unpleasant compared to editing on a more capable desktop system with a large enough display to see what I'm doing.

As for the gif conversion itself, even with OpenShot at my disposal, I'm still using ffmpeg! That said, because of the shaky future for animated observations on iNat, I typically skip the gif making step, just clean up my vid in OpenShot, and then either take shots from my still camera or if they aren't available, frames out of the video and upload an ordinary observation with the full video uploaded to a 3rd party platform, linked in the description & project fields. It's not ideal because it depends on those 3rd-party links still being good years down the road, but so far it hasn't let me down yet. That said, the recent continuation of this thread has sparked my curiosity again, so one of these days I should figure out if OpenShot itself can do a decent job of the gif conversion. If I do, I'll be sure to report back here.

Posted by benarmstrong 9 months ago

Okay, I may continue to use Clipchamp for the time being. The GIF/video quality when using that method isn't that bad, although if anyone learns of a way to create a GIF from a phone video that retains most of the original level of video quality that would be a further improvement I'd be interested in learning about.

Anyway, I'm glad to have found this great project.

Posted by bdagley 9 months ago

And here's one more GIF, this one not shaking, made by taking a video using HP Camera with a Celestron usb microscope and converting to a GIF in Clipchamp. https://www.inaturalist.org/observations/172217753

Posted by bdagley 9 months ago

Add a Comment

Sign In or Sign Up to add comments