Microsoft媒体编码器屏幕截图,保存正在录制的视频的特定部分

时间:2019-05-25 06:02:35

标签: c# windows-media-encoder

我正在使用Windows Media编码器在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.
    }                                

0 个答案:

没有答案