////// DScaler deinterlace type. /// public enum DScalerDeinterlaceType { ////// Weave. /// Weave = 1020, ////// Bob. /// Bob = 1021, ////// Two frame. /// TwoFrame = 1022, ////// Blended clipping. /// BlendedClipping = 1023, ////// Field bob. /// FieldBob = 1024, ////// DScaler plugin. /// DScalerPlugin = 1025 } ////// DScaler Deinterlace filter 1.2 interface. /// [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] [Guid("463D645C-48F7-11D4-8464-0008C782A257")] [ComImport, System.Security.SuppressUnmanagedCodeSecurity] public interface IDeinterlace { ////// Gets or sets deinterlace type. /// [DispId(1)] int DeinterlaceType { [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] get; [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] set; } ////// Gets or sets a value indicating whether odd field will be first. /// [DispId(2)] bool IsOddFieldFirst { [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] get; [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] set; } ////// Gets or sets DScaler plugin name. /// [DispId(3)] string DScalerPluginName { [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] get; [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] set; } }
2. Add OnFilterAdded event handler for SDK control. In our sample code, we use Video Capture SDK .Net.
private void VideoCapture1_OnFilterAdded(object sender, FilterEventArgs e) { if (e.Name.Contains("Deinterlace Filter")) { IDeinterlace deint = e.Filter as IDeinterlace; if (deint != null) { deint.DeinterlaceType = (int)DScalerDeinterlaceType.Bob; deint.IsOddFieldFirst = false; } } }
This event fired for each added filter. We're checking the filter name and getting the IDeinterlace filter interface. In our sample, we changing deinterlace method to Bob.
Before Start method call, you must add Deinterlace filter using the following code:
VideoCapture1.Video_Filters_Add(new CustomProcessingFilter("Deinterlace Filter"));