FFmpeg allows to create gif file from video. Number of loops (one to infinity) and delay between repeats can be specified in parameters. The easiest way to get gif from video is to use FFmpeg.Conversions.FromSnippet.ToGif() method.

string output = Path.Combine(Path.GetTempPath(), Guid.NewGuid() + ".gif");

IConversion conversion = await FFmpeg.Conversions.FromSnippet.ToGif(Resources.Mp4, output, 1, 1);
IConversionResult result = await conversion.Start();
/// <summary>
///     Convert image video stream to gif
/// </summary>
/// <param name="inputPath">Input path</param>
/// <param name="outputPath">Output path</param>
/// <param name="loop">Number of repeats</param>
/// <param name="delay">Delay between repeats (in seconds)</param>
/// <returns>Conversion result</returns>
IConversion ToGif(string inputPath, string outputPath, int loop, int delay = 0);