Simple batch scripts for making high quality compressed gifs from videos on Windows.
You need to have ffmpeg and gifski first.
Download the binary execuations from their official website.
You can find the binary from the any one of following links:
Download command-line binary instead of GUI application
- https://ffmpeg.org/download.html#repositories
- https://www.gyan.dev/ffmpeg/builds/ ----> ffmpeg-5.0.1-essentials_build.zip
- https://github.com/BtbN/FFmpeg-Builds/releases ----> ffmpeg-master-latest-win64-gpl.zip
You can find the binary from the any one of following links:
Download command-line binary instead of GUI application
- https://gif.ski/
- https://github.com/ImageOptim/gifski/releases ----> gifski-1.7.2.tar.xz
Drag a .bat
file that you want to make into add_bat_to_sendto_menu.bat
and name your shortcut.
WARNING: It will no longer work if you move the batch file to elsewhere.
vid4.mp4
Win
+R
and type Shell:sendto
, you'll see the SendTo
folder, and that it is.
You can do it on your own by creating a shortcut and moving it to the 'SendTo' folder.
Just drag your video file into vid2gif_prompt_mode.bat
and set the parameters by prompt.
vid2.mp4
Or vid2gif_600w_20fps_q90.bat
to make a gif with default params.
vid1.mp4
After adding the script to SendTo
folder, you should be able to see the shortcut on 'Send to' menu. (See Installation section)
vid5.mp4
vid3.mp4
The prompt mode will ask you parameters.
vid2gif_prompt_mode.bat <input>
The default conversion from video to gif with 600 width, 20 fps, 90 quality.
vid2gif_600w_20fps_q90.bat <input>
A high framerate but low quality preset.
vid2gif_600w_50fps_q80.bat <input>
A high framerate and quality preset.
vid2gif_600w_50fps_q90.bat <input>
FFmpeg to extract the image sequence and Gifski to make a high quality gif.
.\scripts\to_gif_gifski_cmd.bat <input> <output> <width> <fps> <aspect_ratio> <quality>
FFmpeg directly convert a video file to a gif.
.\scripts\to_gif_ffmpeg_cmd.bat <input> <output> <width> <fps> <aspect_ratio>
Name | Description |
---|---|
input | the filename of the source video. (e.g. myvideo.mp4 ) |
output | the filename of the output gif. (e.g. myGif.gif ) |
width | the width of the output gif. (default 600) |
fps | the framerate of the output gif. (default 20) |
aspect ratio | the aspect ratio of the output gif (e.g. 16/9 , 4/3 , 22/9 . The default value of -1 means not to change). |
quality | the compression quality of the gif [0 - 100] (See gifski page). |
The scripts can directly crop and pad the input video to a specific aspect ratio.
For example, if you have a video with a resolution of 1920x1080
, and you put it into the batch with the following parameters: 600 width, 20 fps, 4/3 aspect, 90 quality
, you will get a gif with a resolution of 600x450
.
There are some .bat
files in specifc_aspects
folder.