public void RecordFileTestMethod() { var videoDevice = videoDeviceManager.GetVideoDeviceById(0); videoEncoder.SetVideoSource(videoDevice); var audioDevice = audioDeviceManager.GetAudioDeviceById(0); aacEncoder.SetAudioDataSource(audioDevice); Record record = new Record(videoEncoder, aacEncoder); Assert.IsTrue(record.StartRecord(@"test.mp4")); Thread.Sleep(3000); Assert.IsTrue(record.StopRecord()); }
public bool SetVideoDevice(IVideoDevice videoDevice) { if (_useVideoDevice == videoDevice) { return(true); } _useVideoDevice = videoDevice; return(_videoEncoder.SetVideoSource(_useVideoDevice)); }
public void CollectWindowImageAndRecordTest() { IWindowEnumerator windowEnumerator = new WindowEnumerator(); var windowList = windowEnumerator.GetWindowList(); IDesktopWindowCollector videoDevice = new DesktopWindowCollector(); videoDevice.SetWindowHandle(windowList.First().HWD); videoEncoder.SetVideoSource(videoDevice); var audioDevice = audioDeviceManager.GetAudioDeviceById(0); aacEncoder.SetAudioDataSource(audioDevice); Record record = new Record(videoEncoder, aacEncoder); record.StartRecord(@"windowcollecttest.mp4"); Thread.Sleep(3000); record.StopRecord(); }