diff --git a/index.html b/index.html index 235dae4..1e75af5 100644 --- a/index.html +++ b/index.html @@ -817,11 +817,20 @@
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
-
-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
+
-filter_complex "fps=frame rate,scale=width:height,palettegen"
a complex filtergraph.
+ Firstly, the fps filter sets the frame rate.
+ Then the scale filter resizes the image. You can specify both the width and the height, or specify a value for one and use a scale value of -1 for the other to preserve the aspect ratio. (For example, 500:-1 would create a GIF 500 pixels wide and with a height proportional to the original video). In the first script above, :flags:lanczos specifies that the Lanczos rescaling algorithm will be used to resize the image.
+ Lastly, the palettegen filter generates the palette.
-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
+

The second command has a slightly different filtergraph, which breaks down as follows:

+
+
-filter_complex "[0:v]fps=10,scale=500:-1:flags=lanczos[v],[v][1:v]paletteuse"
+ [0:v]fps=10,scale=500:-1:flags=lanczos[v]: applies the fps and scale filters described above to the first input file (the video).
+ [v][1:v]paletteuse": applies the paletteuse filter, setting the second input file (the palette) as the reference file.
+

Simpler GIF creation

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.