C# Class OpenCvSharp.VideoWriter

AVI Video File Writer
Inheritance: OpenCvSharp.DisposableCvObject
显示文件 Open project: shimat/opencvsharp Class Usage Examples

Public Methods

Method Description
FourCC ( char c1, char c2, char c3, char c4 ) : int

Concatenates 4 chars to a fourcc code. This static method constructs the fourcc code of the codec to be used in the constructor VideoWriter::VideoWriter or VideoWriter::open.

FourCC ( string code ) : int

Concatenates 4 chars to a fourcc code. This static method constructs the fourcc code of the codec to be used in the constructor VideoWriter::VideoWriter or VideoWriter::open.

IsOpened ( ) : bool

Returns true if video writer has been successfully initialized.

Open ( string fileName, FourCC fourcc, double fps, Size frameSize, bool isColor = true ) : void

Creates video writer structure.

Open ( string fileName, int fourcc, double fps, Size frameSize, bool isColor = true ) : void

Creates video writer structure.

Open ( string fileName, string fourcc, double fps, Size frameSize, bool isColor = true ) : void

Creates video writer structure.

Release ( ) : void

VideoWriter ( ) : System

VideoWriter ( string fileName, FourCC fourcc, double fps, Size frameSize, bool isColor = true ) : System

Creates video writer structure.

VideoWriter ( string fileName, int fourcc, double fps, Size frameSize, bool isColor = true ) : System

Creates video writer structure.

VideoWriter ( string fileName, string fourcc, double fps, Size frameSize, bool isColor = true ) : System

Creates video writer structure.

Write ( OpenCvSharp.Mat image ) : void

Writes/appends one frame to video file.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Clean up any resources being used.

Private Methods

Method Description
VideoWriter ( IntPtr ptr ) : System

Initializes from native pointer

Method Details

Dispose() protected method

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. ///
return void

FourCC() public static method

Concatenates 4 chars to a fourcc code. This static method constructs the fourcc code of the codec to be used in the constructor VideoWriter::VideoWriter or VideoWriter::open.
public static FourCC ( char c1, char c2, char c3, char c4 ) : int
c1 char
c2 char
c3 char
c4 char
return int

FourCC() public static method

Concatenates 4 chars to a fourcc code. This static method constructs the fourcc code of the codec to be used in the constructor VideoWriter::VideoWriter or VideoWriter::open.
public static FourCC ( string code ) : int
code string
return int

IsOpened() public method

Returns true if video writer has been successfully initialized.
public IsOpened ( ) : bool
return bool

Open() public method

Creates video writer structure.
public Open ( string fileName, FourCC fourcc, double fps, Size frameSize, bool isColor = true ) : void
fileName string Name of the output video file.
fourcc FourCC 4-character code of codec used to compress the frames. For example, "PIM1" is MPEG-1 codec, "MJPG" is motion-jpeg codec etc. /// Under Win32 it is possible to pass null in order to choose compression method and additional compression parameters from dialog.
fps double Framerate of the created video stream.
frameSize Size 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 (the flag is currently supported on Windows only).
return void

Open() public method

Creates video writer structure.
public Open ( string fileName, int fourcc, double fps, Size frameSize, bool isColor = true ) : void
fileName string Name of the output video file.
fourcc int 4-character code of codec used to compress the frames. For example, "PIM1" is MPEG-1 codec, "MJPG" is motion-jpeg codec etc. /// Under Win32 it is possible to pass null in order to choose compression method and additional compression parameters from dialog.
fps double Framerate of the created video stream.
frameSize Size 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 (the flag is currently supported on Windows only).
return void

Open() public method

Creates video writer structure.
public Open ( string fileName, string fourcc, double fps, Size frameSize, bool isColor = true ) : void
fileName string Name of the output video file.
fourcc string 4-character code of codec used to compress the frames. For example, "PIM1" is MPEG-1 codec, "MJPG" is motion-jpeg codec etc. /// Under Win32 it is possible to pass null in order to choose compression method and additional compression parameters from dialog.
fps double Framerate of the created video stream.
frameSize Size 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 (the flag is currently supported on Windows only).
return void

Release() public method

public Release ( ) : void
return void

VideoWriter() public method

public VideoWriter ( ) : System
return System

VideoWriter() public method

Creates video writer structure.
public VideoWriter ( string fileName, FourCC fourcc, double fps, Size frameSize, bool isColor = true ) : System
fileName string Name of the output video file.
fourcc FourCC 4-character code of codec used to compress the frames. For example, "PIM1" is MPEG-1 codec, "MJPG" is motion-jpeg codec etc. /// Under Win32 it is possible to pass null in order to choose compression method and additional compression parameters from dialog.
fps double Framerate of the created video stream.
frameSize Size 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 (the flag is currently supported on Windows only).
return System

VideoWriter() public method

Creates video writer structure.
public VideoWriter ( string fileName, int fourcc, double fps, Size frameSize, bool isColor = true ) : System
fileName string Name of the output video file.
fourcc int 4-character code of codec used to compress the frames. For example, "PIM1" is MPEG-1 codec, "MJPG" is motion-jpeg codec etc. /// Under Win32 it is possible to pass null in order to choose compression method and additional compression parameters from dialog.
fps double Framerate of the created video stream.
frameSize Size 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 (the flag is currently supported on Windows only).
return System

VideoWriter() public method

Creates video writer structure.
public VideoWriter ( string fileName, string fourcc, double fps, Size frameSize, bool isColor = true ) : System
fileName string Name of the output video file.
fourcc string 4-character code of codec used to compress the frames. For example, "PIM1" is MPEG-1 codec, "MJPG" is motion-jpeg codec etc. /// Under Win32 it is possible to pass null in order to choose compression method and additional compression parameters from dialog.
fps double Framerate of the created video stream.
frameSize Size 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 (the flag is currently supported on Windows only).
return System

Write() public method

Writes/appends one frame to video file.
public Write ( OpenCvSharp.Mat image ) : void
image OpenCvSharp.Mat the written frame.
return void