/// <summary>
 /// Constructs a new FFMPEG Process object with the provided settings
 /// </summary>
 /// <param name="settings">The process settings</param>
 public FFMPEGProcess(FFMPEGProcessSettings settings)
 {
     _settings = settings;
     _process = new Process();
     _isDisposed = false;
     _hasExecuted = false;
 }
        private static void IndexEntriesAtIndex(
            string videoFile,
            TimeSpan startTime,
            Ratio framerate,
            TimeSpan totalDuration,
            IndexDatabase database
            )
        {
            string outputDirectory = Path.GetRandomFileName();
            Ratio quarterFramerate = new Ratio(framerate.Numerator, framerate.Denominator * 4);
            var ffmpegProcessSettings = new FFMPEGProcessSettings(
                videoFile,
                outputDirectory,
                startTime,
                CalculateFramesToOutputFromFramerate(startTime, quarterFramerate, totalDuration),
                framerate,
                FFMPEGOutputFormat.Y4M
            );

            if (Directory.Exists(outputDirectory) == false)
            {
                Directory.CreateDirectory(outputDirectory);
            }

            using (var ffmpegProcess = new FFMPEGProcess(ffmpegProcessSettings))
            {
                ffmpegProcess.Execute();
                IndexFilesInDirectory(videoFile, outputDirectory, startTime, database, quarterFramerate);
                try
                {
                    Directory.Delete(outputDirectory, true);
                }
                catch (Exception e)
                {
                    Console.Error.WriteLine(string.Format("Could not clean up images: {0}", e.Message));
                }
            }
        }