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 by tony_wills tony_wills, April 11, 2014 10:53

Comments

Thumb

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 over 5 years ago (Flag)
Thumb

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 almost 5 years ago (Flag)
Thumb

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 almost 5 years ago (Flag)
Thumb

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... 10 months ago (Flag)
Thumb

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 10 months ago (Flag)
Thumb

thanks

Posted by kaipatiki_naturew... 10 months ago (Flag)
Thumb

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 5 months ago (Flag)
Thumb

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 5 months ago (Flag)
Thumb

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 5 months ago (Flag)
Thumb

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 5 months ago (Flag)
Thumb

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 5 months ago (Flag)
Thumb

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 5 months ago (Flag)
Thumb

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 5 months ago (Flag)
Thumb

Yes that version is quite near the original quality.

Posted by tony_wills 5 months ago (Flag)
Thumb

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 5 months ago (Flag)
Thumb

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 5 months ago (Flag)

Add a Comment

Sign In or Sign Up to add comments

Is this inappropriate, spam, or offensive? Add a Flag