diff --git a/index.html b/index.html index ddc5216..b8e87d0 100644 --- a/index.html +++ b/index.html @@ -68,20 +68,20 @@ Change the above data-target field, the button text, and the below div class (th

Create GIF

Create high quality GIF

-

ffmpeg -ss HH:MM:SS -i input -filter_complex "fps=10,scale=500:-1:flags=lanczos,palettegen" -t 3 palette.png

-

ffmpeg -ss HH:MM:SS -i input -i palette.png -filter_complex "[0:v]fps=10,scale=500:-1:flags=lanczos[v],[v][1:v]paletteuse" -t 3 -loop 6 output

+

ffmpeg -ss HH:MM:SS -i input_file -filter_complex "fps=10,scale=500:-1:flags=lanczos,palettegen" -t 3 palette.png

+

ffmpeg -ss HH:MM:SS -i input_file -i palette.png -filter_complex "[0:v]fps=10,scale=500:-1:flags=lanczos[v],[v][1:v]paletteuse" -t 3 -loop 6 output_file

The first command will use the palettegen filter to create a custom palette, then the second command will create the GIF with the paletteuse filter. The result is a high quality GIF.

ffmpeg
starts the command
-ss HH:MM:SS
starting point of the gif. If a plain numerical value is used it will be interpreted as seconds
-
-i input file
path, name and extension of the input file
+
-i input_file
path, name and extension of the input file
-filter_complex "fps=frame rate,scale=width:height,palettegen"
a complex filtergraph using the fps filter to set frame rate, the scale filter to resize, and the palettegen filter to generate the palette. The scale value of -1 preserves the aspect ratio
-t 3
duration in seconds (here 3; can be specified also with a full timestamp, i.e. here 00:00:03)
-loop 6
number of times to loop the gif. A value of -1 will disable looping. Omitting -loop will use the default which will loop infinitely
-
output file
path, name and extension of the output file
+
output_file
path, name and extension of the output file

Simpler GIF creation

-

ffmpeg -ss HH:MM:SS -i input -vf "fps=10,scale=500:-1" -t 3 -loop 6 output

+

ffmpeg -ss HH:MM:SS -i input_file -vf "fps=10,scale=500:-1" -t 3 -loop 6 output_file

This is a quick and easy method. Dithering is more apparent than the above method using the palette* filters, but the file size will be smaller. Perfect for that "legacy" GIF look.