public bool Apply(VidGrab.VideoGrabber capture) { capture.AudioRecording = true; capture.AudioDeviceRendering = this.AudioDeviceRendering; if (!Config.Current.OutputSetting.UseAudioFromCamera) { capture.AudioDevice = capture.FindIndexInListByName(capture.AudioDevices, this.AudioDevice, false, true); capture.AudioRenderer = capture.FindIndexInListByName(capture.AudioRenderers, this.AudioOutputDevice, false, true); capture.AudioInput = capture.FindIndexInListByName(capture.AudioInputs, this.AudioDeviceLine, false, true); capture.AudioFormat = (VidGrab.TAudioFormat)capture.FindIndexInListByName(capture.AudioFormats, this.AudioFormat, false, true); capture.AudioInputLevel = 65535; // Maximo valor capture.AudioSource = VidGrab.TAudioSource.as_UseExternalAudio; if (capture.AudioDevice < 0) { string message = "No se encontró el dispositivo de grabación de audio"; Logger.Log.Info(message); MessageBox.Show(message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } } else { capture.AudioSource = VidGrab.TAudioSource.as_Default; } return(true); }
public bool Apply(VidGrab.VideoGrabber capture) { if (this.VideoSource == VideoSources.IpCamera) { if (string.IsNullOrEmpty(this.StreamUrl)) { string message = "No se puede iniciar la grabación porque no tiene configurado la URL de la camara IP."; Logger.Log.Info(message); MessageBox.Show(message, "Configuración", MessageBoxButtons.OK, MessageBoxIcon.Warning); return(false); } capture.VideoSource = VidGrab.TVideoSource.vs_IPCamera; capture.IPCameraURL = this.StreamUrl; if (!string.IsNullOrEmpty(this.Username)) { capture.SetAuthentication(VidGrab.TAuthenticationType.at_IPCamera, this.Username, this.Password); } } else { capture.VideoSource = VidGrab.TVideoSource.vs_VideoCaptureDevice; if (string.IsNullOrEmpty(this.VideoDevice)) { string message = "No se puede iniciar la grabación porque no tiene configurado un dispositivo de grabación."; Logger.Log.Info(message); MessageBox.Show(message, "Configuración", MessageBoxButtons.OK, MessageBoxIcon.Warning); return(false); } // Captura de audio y video capture.VideoDevice = capture.FindIndexInListByName(capture.VideoDevices, this.VideoDevice, false, true); if (capture.VideoDevice == -1) { MessageBox.Show("No se puede iniciar la grabación porque no tiene configurado un dispositivo de grabación.", "Configuración", MessageBoxButtons.OK, MessageBoxIcon.Warning); return(false); } capture.VideoSize = capture.FindIndexInListByName(capture.VideoSizes, this.VideoSize, false, true); capture.VideoSubtype = capture.FindIndexInListByName(capture.VideoSubtypes, this.VideoFormatSubType, false, true); if (!string.IsNullOrEmpty(this.VideoNorma)) { capture.AnalogVideoStandard = capture.FindIndexInListByName(capture.AnalogVideoStandards, this.VideoNorma, false, true); } } return(true); }
internal static bool ConfigureVideoCompressor(VidGrab.VideoGrabber capture, string compressor) { capture.VideoCompressor = capture.FindIndexInListByName(capture.VideoCompressors, compressor, false, true); if (capture.VideoCompressor == -1) { MessageBox.Show("No se encontro el compresor de video", "Video Encoder", MessageBoxButtons.OK, MessageBoxIcon.Warning); return(false); } return(true); }
internal static bool ConfigureAudioCompressor(VidGrab.VideoGrabber capture, string compressor) { capture.AudioCompressor = capture.FindIndexInListByName(capture.AudioCompressors, compressor, false, true); if (capture.AudioCompressor == -1) { MessageBox.Show("Para grabar solo audio en formato MP3 se requiere \"LAME Audio Encoder\"", "Audio Encoder", MessageBoxButtons.OK, MessageBoxIcon.Warning); return(false); } return(true); }