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)

Publicado por tony_wills tony_wills, 11 de abril de 2014, 10:53 AM

Comentários

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.

Publicado por tony_wills mais de 7 anos antes (Sinalizar)

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..

Publicado por russ87 quase 7 anos antes (Sinalizar)

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).

Publicado por tony_wills quase 7 anos antes (Sinalizar)

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?

Publicado por kaipatiki_naturew... quase 3 anos antes (Sinalizar)

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.

Publicado por tony_wills quase 3 anos antes (Sinalizar)

thanks

Publicado por kaipatiki_naturew... quase 3 anos antes (Sinalizar)

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!

Publicado por benarmstrong mais de 2 anos antes (Sinalizar)

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)

Publicado por tony_wills mais de 2 anos antes (Sinalizar)

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?

Publicado por benarmstrong mais de 2 anos antes (Sinalizar)

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).

Publicado por tony_wills mais de 2 anos antes (Sinalizar)

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....

Publicado por tony_wills mais de 2 anos antes (Sinalizar)

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.

Publicado por russ87 mais de 2 anos antes (Sinalizar)

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.

Publicado por benarmstrong mais de 2 anos antes (Sinalizar)

Yes that version is quite near the original quality.

Publicado por tony_wills mais de 2 anos antes (Sinalizar)

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

Publicado por benarmstrong mais de 2 anos antes (Sinalizar)

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.

Publicado por benarmstrong mais de 2 anos antes (Sinalizar)

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"

Publicado por diegoalmendras quase 2 anos antes (Sinalizar)

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:

Publicado por tony_wills quase 2 anos antes (Sinalizar)

Very effective, I enjoyed seeing the kakariki feeding!

Publicado por kaipatiki_naturew... quase 2 anos antes (Sinalizar)

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

Publicado por alexis_orion mais de 1 ano antes (Sinalizar)

Thanks Alexis

Publicado por tony_wills mais de 1 ano antes (Sinalizar)

use a non-default scaling algorithm in ffmpeg to improve the quality of your gifs!

short example without palette gen:
ffmpeg -i input.mov -vf "fps=12,scale=500:-1:flags=lanczos" output.gif

lanczos
better scaling filter, faster

sinc
best? scaling filter, slower

https://trac.ffmpeg.org/wiki/Scaling
https://superuser.com/questions/375718/which-resize-algorithm-to-choose-for-videos

Publicado por libele 11 meses antes (Sinalizar)

Thanks for the tips

Publicado por tony_wills 11 meses antes (Sinalizar)

Adicionar um Comentário

Iniciar Sessão ou Registar-se to add comments