예제 #1
0
    public static void ExtractSubtitles(string ffmpegBinary, string VideoFile,
                                        AutoResetEvent AbortEvent)
    {
        var posFile = GetPositionsFilePath(VideoFile);

        var runner = new ProcRunner(ffmpegBinary, "-y", "-i", VideoFile, posFile);

        runner.Start(AbortEvent);
    }
예제 #2
0
    public static void SplitFrames(
        string ffmpegBinary, string VideoFile, SplitProgress ProgressCB,
        AutoResetEvent AbortEvent,
        out uint NumFrames)
    {
        var ImagesDir     = GetImagesDir(VideoFile);
        var frameTemplate = Path.Combine(ImagesDir, "%04d.jpg");

        Directory.CreateDirectory(ImagesDir);

        var runner       = new ProcRunner(ffmpegBinary, "-i", VideoFile, frameTemplate);
        var outputParser = new FFMPEGOutputParser(ProgressCB);

        runner.StderrLineEvent += outputParser.ParseLine;
        runner.Start(AbortEvent);

        NumFrames = outputParser.LastFrame;
    }