How to make a GIF using FFmpeg for FREE!

Subscribers:
1,860
Published on ● Video Link: https://www.youtube.com/watch?v=-c9Ij7rQS50



Duration: 9:24
411 views
0


FFmpeg is not that easy to use on it's own. It's lack of a graphical interface makes it very unfriendly to most normal users who don't have an understanding of the command line and how to write code.
But since I'd already put forth the effort and wrote a simple batch file to create GIFs on my own, I figured I'd share it and see if it helped anybody else trying to figure out FFmpeg's esoteric language.

Here's the complete script I used in the video with one minor edit (replacing "frames?" with ms, these are actually regular decimal values but I couldn't think of a better way to represent them). Just copy and paste this script into a regular .txt file and rename the extension from .txt to .bat, and drop it in a folder with your video, then double click it to run it:

ECHO off
IF NOT DEFINED vtype SET "vtype=mp4"
set /p vtype="Enter file type of original file (default mp4): "

FOR /F "tokens=*" %%G IN ('dir /b *.%vtype%') DO ffmpeg -i "%%G" -filter_complex "[0:v] palettegen" "%%~nG.png"

set /p starttime="Enter Start Time(hh:mm:ss.ms)(press Enter for the very beginning): "
IF NOT DEFINED starttime SET "starttime=0"
set /p duration="Enter Duration(hh:mm:ss.ms)(Press Enter for entire clip): "
IF NOT DEFINED duration SET "duration=0"
set framerate=12
set /p framerate="Enter the frames per second to capture (default %framerate%fps): "
set xscale=640
set /p xscale="Enter the resolution width (default %xscale% pixels): "
set yscale=-1
set /p yscale="Enter the resolution height (default %yscale%, determined by aspect ratio): "

FOR /F "tokens=*" %%G IN ('dir /b *.%vtype%') DO ffmpeg -ss %starttime% -t %duration% -i "%%G" -i "%%~nG.png" -filter_complex "[0:v] fps=%framerate%, scale=%xscale%:%yscale%, paletteuse" "%%~nG.gif"






Music used in this video:

Song: Markvard - Forever (Vlog No Copyright Music)
Music provided by Vlog No Copyright Music.
Video Link: https://youtu.be/GUPb5DcMMVQ
#NoCopyrightMusic #VlogMusic #VlogNoCopyrightMusic

Song: LiQYWYD - Good Time
Listen to this track on SoundCloud:
https://soundcloud.com/liqwyd/good-time
Music by LiQWYD:
http://www.soundcloud.com/liqwyd
http://www.bit.ly/liqwyd-youtube
http://www.instagram.com/liqwyd
http://www.spoti.fi/2RPd66h
http://www.apple.co/2TZtpeG
http://www.patreon.com/LiQWYD


Song: SUNDANCE_Music - Perséphone
on Facebook : https://www.facebook.com/pages/Persép...
on soundcloud : https://soundcloud.com/persphon3
on Youtube: https://youtu.be/1oV8z3bjLBQ







Tags:
ffmpeg
free
GIF
jif
bat
batch
cmd
dos
code
create
meme
edit
convert
video
to gif
how to
instructions
memes
make
gif
how to make a gif