Exemplo n.º 1
0
 internal static extern IntPtr cveVideoWriterCreate2(
     IntPtr filename,
     CvEnum.CaptureType apiPreference,
     int fourcc,
     double fps,
     ref System.Drawing.Size frameSize,
     [MarshalAs(CvInvoke.BoolMarshalType)]
     bool isColor);
Exemplo n.º 2
0
        /// <summary>
        /// Create a video writer using the specific information
        /// </summary>
        /// <param name="fileName">The name of the video file to be written to </param>
        /// <param name="compressionCode">Compression code. Usually computed using CvInvoke.CV_FOURCC.
        /// On windows use -1 to open a codec selection dialog.
        /// On Linux, use CvInvoke.CV_FOURCC('I', 'Y', 'U', 'V') for default codec for the specific file name.
        /// </param>
        /// <param name="fps">frame rate per second</param>
        /// <param name="size">the size of the frame</param>
        /// <param name="isColor">true if this is a color video, false otherwise</param>
        /// <param name="apiPreference">Allows to specify API backends to use.</param>
        public VideoWriter(String fileName, CvEnum.CaptureType apiPreference, int compressionCode, double fps, System.Drawing.Size size, bool isColor)
        {
            using (CvString s = new CvString(fileName))
                _ptr = CvInvoke.cveVideoWriterCreate2(s, apiPreference, compressionCode, fps, ref size, isColor);

            if (_ptr == IntPtr.Zero)
            {
                throw new NullReferenceException("Unable to create VideoWriter. Make sure you have the specific codec installed");
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Create a capture using the specific camera
 /// </summary>
 /// <param name="captureType">The capture type</param>
 public VideoCapture(CvEnum.CaptureType captureType)
     : this((int)captureType)
 {
 }