0

我正在使用 Windows 媒体编码器在 C# 中编写屏幕捕获程序。在录制屏幕时,我想在单击 btn 时将当前视频的最后 30 秒保存在单独的视频中。编码器中是否有允许我这样做的功能?

我附上了我目前正在使用的代码。找不到有关媒体编码器的任何文档...

void startRecording() {
    System.Drawing.Size workingArea = SystemInformation.WorkingArea.Size;
    Rectangle captureRec = new Rectangle(0, 0, workingArea.Width -(workingArea.Width % 4), workingArea.Height - (workingArea.Height % 4));
    job.CaptureRectangle = captureRec;
    job.ShowFlashingBoundary = true;
    job.ShowCountdown = true;
    job.CaptureMouseCursor = true;
    job.AddAudioDeviceSource(AudioDevices());
    job.OutputPath = @"C:\Users\Moe36\Desktop\Screen Recorder";
    job.Start();
}

void saveLast30Sec() {
    //Save last 30sec of the currently recorded video as a separate video file.
    }                                
4

0 回答 0