Emgu.CV.CvInvoke.cvCreateVideoWriter C# (CSharp) Метод

cvCreateVideoWriter() публичный статический Метод

Creates video writer structure.
public static cvCreateVideoWriter ( String filename, int fourcc, double fps, System frameSize, bool isColor ) : IntPtr
filename String Name of the output video file.
fourcc int 4-character code of codec used to compress the frames. For example, CV_FOURCC('P','I','M','1') is MPEG-1 codec, CV_FOURCC('M','J','P','G') is motion-jpeg codec etc.
fps double Framerate of the created video stream.
frameSize System Size of video frames.
isColor bool If it is true, the encoder will expect and encode color frames, otherwise it will work with grayscale frames
Результат IntPtr
        public static IntPtr cvCreateVideoWriter(String filename,
          int fourcc,
          double fps,
          System.Drawing.Size frameSize,
          bool isColor)
        {
            return cvCreateVideoWriter(filename, fourcc, fps, frameSize, isColor ? 1 : 0);
        }

Same methods

CvInvoke::cvCreateVideoWriter ( [ filename, int fourcc, double fps, System frameSize, int isColor ) : IntPtr

Usage Example

Пример #1
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</param>
 /// <param name="fps">frame rate per second</param>
 /// <param name="width">the width of the frame</param>
 /// <param name="height">the height of the frame</param>
 /// <param name="isColor">true if this is a color video, false otherwise</param>
 public VideoWriter(String fileName, int compressionCode, int fps, int width, int height, bool isColor)
 {
     _ptr = CvInvoke.cvCreateVideoWriter(fileName, compressionCode, fps, new System.Drawing.Size(width, height), isColor);
     if (_ptr == IntPtr.Zero)
     {
         throw new NullReferenceException("Unable to create VideoWriter. Make sure you have the specific codec installed");
     }
 }
CvInvoke