Its always fun to make GIFs of your friends and upload them to gif sharing services (Tenor keyboard for example), on Linux this is quite easy task.
- Create a GIF file:
$ ffmpeg -i some_video.mov -ss 6 -t 2.4 -vf deshake -vf scale=320:-1 look.gif
What do these parameters mean?
-ssis start of the video
-vf deshakeis a filter that should stabilize your shaky hand a bit.
-vf scaleis filter that scales your filter to 320x, preserving the ratio.
Now lets make loop with
$ convert look.gif -coalesce -duplicate 1,-2-1 -quiet -layers OptimizePlus -loop 0 look_cycle.gif
This will add reversed gif to the end of the video. This is better for GIFs with short span capturing some simple movement where you can’t easily tell that it is happening in reverse.
See Patrol Cycles in Imagemagick docs.