Beispiel #1
0
        private static void extractVideo(string fileName)
        {
            //get output dir (same as file name and in the same folder as video)
            var fileInfo = new FileInfo(fileName);
            var fileNameNoExt = fileInfo.Name.Replace(fileInfo.Extension, String.Empty);
            string outputDir = Path.Combine(fileInfo.DirectoryName, fileNameNoExt);

            //open video
            var reader = new FileCapture(fileName);
            reader.Open();

            Console.WriteLine("Extracting video frames - {0}...", fileNameNoExt);

            var videoExtractor = new VideoExtractor(reader, outputDir, "{0}.jpg");
            videoExtractor.Start((percentage) =>
            {
                Console.Write("\r Completed: {0} %", (int)(percentage * 100));
            });

            Console.WriteLine();
        }
        private static void extractVideo(string fileName)
        {
            //get output dir (same as file name and in the same folder as video)
            var    fileInfo      = new FileInfo(fileName);
            var    fileNameNoExt = fileInfo.Name.Replace(fileInfo.Extension, String.Empty);
            string outputDir     = Path.Combine(fileInfo.DirectoryName, fileNameNoExt);

            //open video
            var reader = new FileCapture(fileName);

            reader.Open();

            Console.WriteLine("Extracting video frames - {0}...", fileNameNoExt);

            var videoExtractor = new VideoExtractor(reader, outputDir, 95, "{0}.jpg");

            videoExtractor.Start((percentage) =>
            {
                Console.Write("\r Completed: {0} %", (int)(percentage * 100));
            });

            Console.WriteLine();
        }