public void TestRunInNonBlocking() { ProcessHandler p = new ProcessHandler(@"C:\Windows\System32\tree.com", @"c:\"); p.StartInNonBlockingMode(); Thread.Sleep(100); ProcessHandler.ProcessOutput output = p.WaitForProcessToEnd(); Assert.IsNotNull(output); }
/// <summary> /// Capture video without compressing. you usually would like to compress the video after saving it. /// </summary> /// <param name="frameRate"></param> /// <param name="fileName">Should end with .mkv</param> internal void CaptureRawVideo(string fileName, float frameRate = 24) { KillFfmpegProcess(); if (null == fileName) { throw new ArgumentNullException("Arguments can't be null"); } File.Delete(fileName); ffmpegProcess = new ProcessHandler(ffmpegPath + @"ffmpeg.exe", String.Format(CAPUTRE_VIDEO_RAW, frameRate, fileName)); ffmpegProcess.StartInNonBlockingMode(); }
/// <summary> /// Stat capturing the video. /// /// This is a none blocking operation. /// </summary> /// <param name="frameRate">The framerate to capture the video</param> /// <param name="fileName">Name of the output file. should end with .mp4</param> internal void CaptureCompressedVideo(string fileName, float frameRate = 24) { if (null == fileName) { throw new ArgumentNullException("Arguments can't be null"); } KillFfmpegProcess(); File.Delete(fileName); ffmpegProcess = new ProcessHandler(ffmpegPath + @"ffmpeg.exe", String.Format(CAPTURE_VIDEO_WITH_COMPRESSION, frameRate, fileName)); ffmpegProcess.StartInNonBlockingMode(); }