public static void Generate(IVidja vidja, string outputFilename = "vidja.mp4", int startAt = 0) { _outputFilename = outputFilename; _startAt = startAt; _vidja = vidja; CheckForFfMpegExe(); if (OutputIsAGif(outputFilename)) { // The default gif palette used by FFMpeg makes mediocre gifs // but it can accept a custom palette which FFMpeg can also generate (which is nice) // First we run all the frames through FFMpeg to generate this palette which is simply a png saved in the temp directory ExtractPalette(); // Then create the gif using that palette. // TODO cache the generated frames from above CreateGifAnimation(); DeletePalette(); } else { CreateAnimation(); } }