> ## Content Index
> Fetch the complete content index at: https://itsfoss.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# How to Convert Video to GIF in Linux [Terminal and GUI Methods]
- URL: https://itsfoss.com/convert-video-gif-linux/
- Published: 2020-08-09T11:22:05.000Z
- Updated: 2020-08-10T08:38:26.000Z
- Author: Dimitrios
- Tags: #Import 2022-12-26 08:27

Animated GIFs are everywhere on the internet. From blog posts to social media, GIFs can be used in a humorous as well as explanatory way. 

Even on It’s FOSS, we use GIFs to show a certain step in action. It is better than still images and shorter than loading a video.

In this tutorial, I will show you how to convert a video clip to GIF. I’ll discuss both:

- Command line way to convert video to GIF
- GUI tool for converting video to GIF

## Method 1: Create GIF from Video using ffmpeg in command line

![Convert Video To Gif In Linux](https://itsfoss.com/content/images/wordpress/2020/08/Convert-Video-to-gif-in-linux.jpg)

[FFmpeg](https://ffmpeg.org/?ref=itsfoss.com) is a video and audio converter that can also grab from a live audio/video source. It can also resize video on the fly without compromising the quality.

FFmpeg is a powerful tool and can be used for various scenarios, if you are curious here is the [official documentation](https://ffmpeg.org/ffmpeg.html?ref=itsfoss.com). We also have a good [collection of ffmpge usage examples](https://itsfoss.com/ffmpeg/).

In this example, I will use the [Linux Mint 20](https://www.youtube.com/watch?v=7knHfN-NUZk&ref=itsfoss.com) new feature presentation video. I [downloaded the video from YouTube using youtube-dl](https://itsfoss.com/download-youtube-linux/) and then I [trimmed](https://itsfoss.com/video-trimmer/) the video to get the first 5 seconds.

Make sure to install ffmpeg using your distribution’s package manager:

```
sudo apt install ffmpeg
```

Once you have selected the video that you want to convert, open your terminal and change directory where your video is saved. Below is a general principle, where input is the actual name of the video, following by the video format and the name that you want your gif to be.

**The output name can be something totally different to the input name**, but I tend to use something similar, as it helps to identify it when you have a folder full of files.

```
ffmpeg -i input_video_file output.gif
```

![use ffmpeg to convert videos to gif](https://itsfoss.com/content/images/wordpress/2020/07/1-e1596944469134.png)

Press the enter key to execute the command and your gif will be ready shortly.

![Converting video to gif using ffmpeg command line tool in Linux](https://itsfoss.com/content/images/wordpress/2020/07/2-1.png)

You should find the GIF file in the same folder as your video file unless you specified some other path for the output file).

![Video converted to GIF](https://itsfoss.com/content/images/wordpress/2020/07/3-2.png)

## Method 2: Converting video to GIF using Gifcurry GUI application

[Gifcurry](https://github.com/lettier/gifcurry?ref=itsfoss.com) is an open-source, easy-to-use app GIF maker app.

It uses ffmpeg and [imagemagick](https://imagemagick.org/index.php?ref=itsfoss.com) to process video and convert to GIF. It can be used both in command-line and the graphical user interface, although this tutorial will only cover the GUI part.

It can be installed using [snap](https://itsfoss.com/use-snap-packages-ubuntu-16-04/) and other package managers, but I recommend using the [AppImage](https://github.com/lettier/gifcurry/releases/tag/6.0.0.0?ref=itsfoss.com) because I found some issue with other packages. 

Before you attempt to open gifcurry, you need to make sure that the required dependencies are already installed.

- [GTK+ >= 3.10](https://www.gtk.org/docs/installations/linux/?ref=itsfoss.com)
- [FFmpeg >= 2.8.15](https://www.ffmpeg.org/download.html?ref=itsfoss.com)
- [GStreamer >= 1.0](https://gstreamer.freedesktop.org/download/?ref=itsfoss.com)
  - [GStreamer Plugins](https://gstreamer.freedesktop.org/modules/?ref=itsfoss.com)
- [ImageMagick >= 6](http://www.imagemagick.org/script/download.php?ref=itsfoss.com)

### Open and use gifcurry

To make an Appimage executable is very straight forward and you grant the permission at the file properties as following:

![Run Gifcurry tool](https://itsfoss.com/content/images/wordpress/2020/07/4-1.png)

When you open Gifcurry you will be prompted to navigate to the file that you want to convert and at this example I will use again the initial video. As ffmpeg, Gifcurry is not limited to purely converting videos to gif and vice versa. Some of the features are listed.

### A few other Gifcurry Features

- **Add text to gif**
- **Choose starting time**
- **Set duration**
- **Adjust gif width**
- **Adjust Quality**

![Using Gifcurry to convert video to Gif in Linux](https://itsfoss.com/content/images/wordpress/2020/07/5-1.png)

At the last step, you have to choose the file name, the file format and click save.

![Using Gifcurry to convert video to Gif in Linux](https://itsfoss.com/content/images/wordpress/2020/07/6-3.png)

The final result is here:

![Gifcurry](https://itsfoss.com/content/images/wordpress/2020/07/gifcurry.gif)

### Conclusion

If you are [recording your screen in Linux](https://itsfoss.com/best-linux-screen-recorders/), you may use [Peek](https://github.com/phw/peek?ref=itsfoss.com) to record it a gif instead of a video instead of converting the video to gif later.

Either you choose the command line or the graphical user interface, your job will get done lightning fast both ways. 

Let me know which way you prefer and feel free to request any further explanation at the comments section.