void StopJob() { // Has the Job already been created ? if (_job != null) { // Yes // Is it capturing ? //if (_job.IsCapturing) if (_bStartedRecording) { // Yes // Stop Capturing btnStartStopRecording.PerformClick(); } _job.StopEncoding(); // Remove the Device Source and destroy the job _job.RemoveDeviceSource(_deviceSource); // Destroy the device source _deviceSource.PreviewWindow = null; _deviceSource = null; } }
public void endVideoCapture() { job.StopEncoding(); job.RemoveDeviceSource(liveSource); //liveSource.Dispose(); //liveSource = null; //job.Dispose(); }
//zatrzymanie podglÄ…u internal void Stop() { // Has the Job already been created ? if (_job != null) { _job.StopEncoding(); _job.RemoveDeviceSource(_deviceSource); _deviceSource.PreviewWindow = null; _deviceSource = null; } }
private string VideoCapture(Collection <EncoderDevice> Vdevices) { // Starts new job for preview window LiveJob _job = new LiveJob(); // Create a new device source. We use the first audio and video devices on the system LiveDeviceSource _deviceSource = _job.AddDeviceSource(Vdevices[0], null); // Make this source the active one _job.ActivateSource(_deviceSource); FileArchivePublishFormat fileOut = new FileArchivePublishFormat(); // Sets file path and name string path = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures); string output = String.Format(@"{0}\Constellation{1:yyyyMMdd_hhmmss}", path, DateTime.Now); fileOut.OutputFileName = string.Format("{0}.wmv", output); // Adds the format to the job. You can add additional formats // as well such as Publishing streams or broadcasting from a port _job.PublishFormats.Add(fileOut); // Starts encoding _job.StartEncoding(); Thread.Sleep(3000); _job.StopEncoding(); _job.RemoveDeviceSource(_deviceSource); return(output); }