How to Create a GIF from a Video File Using VLC and GIMP

Make GIFs With GIMP and VLC

No matter how you pronounce GIF, you can’t deny that GIFs are a major force in Internet humor. They’re exceptionally useful on the Web because they allow you to use a lightweight form of animation that can bring some life to your content without the performance cost that comes with videos.

While everyone online has enjoyed a GIF, very few know how easy it is to make one. You can easily take a video, cut out a clip, and convert it to a GIF with the help of two free open-source programs – VLC and GIMP.

Install GIMP and VLC

Before you can do anything, you’re going to need to install both VLC and GIMP. They’re both free and easily accessible for both Windows and Linux.

Windows

You can readily download VLC and GIMP for Windows directly from their developers. Grab VLC from videolan.org, and pick up GIMP at gimp.org. You’re also going to need FFMPEG, another open-source program, to break up your video into frames. You can get that one from its developers, too. Download all three and install them. These installers are extremely simple and straightforward. As an added bonus, these are actually free software, not freeware, so you won’t get bloatware nonsense in the installers.

Linux

On Linux you can install VLC, FFMPEG and GIMP through your package manager, if you don’t already have them.

Ubuntu/Debian

Fedora

Arch Linux

Create a Clip with VLC

You definitely don’t want to make a GIF out of a full-length video. Before you can actually get to work making the GIF, you’re going to need to cut down your video file to just the size you need for the GIF. VLC has a couple of ways to cut a video down, but this one is the most direct.

Enable Advanced Controls

Enable Advanced Controls VLC

VLC has built-in recording capabilities that you can harness to create your clip from an existing video. The first step here is to enable the recording controls. On the main menu across the top of VLC, click on “View.” A drop-down will open to reveal the available options. Check the box next to “Advanced Controls.” The controls will appear at the bottom of the VLC window above the normal VLC controls.

Find Your Start Point

Open the video that you want to extract your clip from. Use the slider to seek through the video, and locate the start point of your clip. Place the slider right were you want it to begin recording.

Record Your Clip

Record With VLC

Once you’re where you want to begin, click the big red circle button in the new advanced controls to begin recording. Allow the video to play to where you want your clip to end. Then, press the “Record” button again to stop it.

Your clip will be located in either “C:\Users\Username\Videos” or “~/Videos” for Windows and Linux respectively. Sometimes Linux will place it in your “/home” directory, too. The video will begin with “vlc-record” followed by the date.

Separate the Frames

GIMP doesn’t work directly with video files, so you’re going to need to convert your clip into its frames. That’s where FFMPEG comes in. FFMPEG can convert all sorts of multimedia, but in this case it’ll break your clip into individual frames.

Open your file browser, and browse to the location where your video file is. Create a new folder called “frames” in that directory.

Now, open a terminal window in that directory. In Windows and most Linux desktop environments, you can right-click in the window to get a menu that allows you to open a terminal window there.

FFMPEG Separating Frames

In that window type the following command to use FFMPEG to break up your clip.

FFMPEG Frame Output

It might take a few minutes, but FFMPEG will break your file down to its frames at a rate of 15 frames-per-second, and place the resulting images in the “frames” folder that you created.

Turn the Clip into a GIF with GIMP

You’re finally ready to open GIMP and start putting together your GIF. This part is actually very simple, but you can add to it as much as you want.

Import Your Frames

GIMP Import as Layers

Open GIMP. Click on “File,” then “Open as Layers.” Browse to the folder where you directed the frames to output from FFMPEG. Select all of the frame images. You can use Ctrl + Click or Shift + Click to select more at the same time. When you have them all, confirm with the “Open” button.

GIMP will create a new project and place each of your frame images as its own layer. These layers will be used to recreate the video as an animation when you export to a GIF.

Edit Your Frames

This section is entirely optional. If you just want to make a GIF of the clip, with no alterations, you don’t really need to do anything here. This section just covers, briefly, what to do when you do want to add something like text to your image.

Edit Frames In GIMP

Think of your layers as pages in a flipbook. Anything that you add to one will appear in that frame of the GIF. In order to add text or something similar across multiple frames, you need to duplicate that text and merge it into each frame.

The same is true if you’d like to add animation or anything else. Remember that GIMP will treat each layer as a frame in the animation, so everything that you add needs to be merged into an existing layer.

Save the GIF

Convert To Index Colors

Before you can export your GIF, you’re going to need to convert it from RGB to Indexed. It works better for GIFs, and it’ll give you an opportunity to reduce your file size. Go to “Image,” then “Mode” and switch from RGB to Indexed. Set a maximum color palette to 127.

Next, make sure that your layers are in the correct order. If they aren’t, you can reverse the order by going to “Layer,” then “Stack,” and reversing the order.

Optimize the image even more by going to “Filters” and selecting “Animation.” Then, optimize for GIF.

Export Your GIF

Finally, you’re ready to export your GIF. You can find the “Export As” option under “File” in the menu. Name it what you like.

Congrats! You have a working GIF created straight from your video file. You can, of course, repeat this process with nearly any video file and make all sorts of GIFs from anywhere.

13 comments

  1.  Avdshare Video Converter can Convert any video file from any source and in any video format, MP4, AVI, MOV, WMV, MKV, etc to GIF image or to animated GIF for your personal use.

  2. Am I missing something here? I keep getting ‘video.mp4: no such file or directory’

    1. Never mind! I know what I was doing wrong!

      1. I am having the same problem, what am I doing wrong?

        1. I needed to change the directory in command prompt first. I used the command ‘cd C:\Users\UserName\ParentFolderName\FolderName’ to direct ffmpeg to the right folder and it worked fine after I did that. Maybe you could try that and see if it works?

        2. Please let me know how you get on!

          1. And the redirect command I do separately, or do i just add the respective directory specifics (drive, folder names) into the command described above, before the file name of the clip?
            Sorry, if that’s a stupid question, just double-checking as, admittedly, I never used command prompts until now, so I’m still getting the hang of the basics tbh. On that note, I’m not going to mess up my system or such if I get this wrong, am I? o,O

        3. Hi!
          No, it’s fine, it was my first time using command prompts as well! I was worried I could mess up my system too, but if you type in a wrong command or one it doesn’t recognise, it’ll just return a message saying that it’s not a recognised command. I don’t think we’re going to break our computers doing this, phew!

          I used the change directory command first:

          cd C:\Users\UserName\ParentFolderName\FolderName

          and when you hit enter it should change from

          C:\Users\UserName>

          to

          C:\Users\UserName\ParentFolderName\FolderName>

          Then I just used the command

          ffmpeg -i video.mp4 -r 15 frames/image-%3d.png

          to get the frames out of the video, and it started to work!

          I hope this makes sense and I hope it helps!

          1. Thanks for the quick reply and the step by step explanation. :)
            I just tried, and sadly it still doesn’t work. Specifically, the changing the directory doesn’t work. Returned an error message about an invalid argument in regards to the set location?
            Plus, I think I already am in the right directory, as I opened PowerShell directly in the folder where I saved the clip and when I open it, it already has the directory line it should, the disc through to the video folder.

            Do command prompts recognize caps and spaces in file names? ‘Cause I actually didn’t use VLC to trim the video, I just used my video editing software so I could trim the clip more easily (I found using the slider in the VLC player to find the starting point a little inconvenient). Though, I wouldn’t think that using a different program to create the clip would really affect the process as long as I change the example video file name to the one of my actual video file.
            But I’ve tried every variation of the file name I could think of – no capital first letter, replacing the space with a ‘_’, no space at all… Still returns the “No such file or directory” message, though specifically, when I type in the exact file name as it shows up in the folder the error only refers to the first part of the two word file name.

  3. Ah yes! I remember I had that problem too. I would rename the actual video clip and replace the spaces with dashes or remove them entirely eg from ‘file name.mp4’ to ‘file-name.mp4’ or ‘filename.mp4’ and then use the new file name in the command. I don’t think it recognises spaces in file names, so if you’re already in the right directory then hopefully this should work! Also, no, I don’t using a different program to create your video clip would affect it.
    (I hope you see this Kat, it wouldn’t let me reply to your last comment!)

    1. Yep, saw your reply – mainly as I also check back directly here on the site instead of just relying on email notifications for stuff.
      I had that thought of renaming the clip as well, and just tried it by replacing the space with a dash, and that works! :)
      Thanks for the help!

      1. Glad I could help!

  4. Using two separate programs and the terminal is not what most people would call “easy”.

Leave a Comment

Yeah! You've decided to leave a comment. That's fantastic! Check out our comment policy here. Let's have a personal and meaningful conversation.