It's not hard, just install the FFmpeg Ubuntu 16.04 desktop side, install the ImageMagick, and the tools are available (same for other Linux distributions).
FFmpeg is an open source audio, visual converter, using FFmpeg we can easily convert and record audio and video files, and ImageMagick is a create, edit and merge bitmap images of an open source software.
Convert Video to GIF
Let's start with a simple, first look at how the video directly converted to GIF motion diagram. As previously stated, first install FFmpeg and ImageMagick (these two tools are available in Ubuntu official source, can be installed directly):
Apt Install ffmpeg ImageMagick
Tip: After the release of Ubuntu 16.04, the official has suggested using apt to replace the old Apt-get command, Ubuntu 16.04 new features and improvements can be seen before the article.
To convert the video to GIF use only the FFmpeg command, in the following format:
Ffmpeg-ss 00:00:20-i input.mp4-to 10-r 10-vf scale=200:-1
-SS represents the starting point
-I followed by the video file to be manipulated
-to indicates the end point of a file
-R frame rate, you can increase this value output better quality GIF files
-VF graphics filter, GIF zoom size
Parameters can be adjusted according to their own needs, after the completion of the video successfully converted to GIF.
Merging multiple GIF files
If you want to combine multiple gifs into a single file, you can simply save the merged files to the same folder, and then execute the following command:
Convert-delay 120-loop 0 *.gif output.gif
Create a GIF motion diagram from a JPG image sequence
If you have a static JPG image sequence, you can easily generate animated gifs in Linux without having to use artifacts such as Photoshop in Windows. First put all JPG in the same folder, and then execute the following command in the terminal:
Convert-delay 120-loop 0 *.jpg linux.gif
-delay 120 indicates the speed of GIF animation
-loop 0 represents an infinite loop