Class VideoWriter
Represents a frame writer for a video file stream.
Namespace: OpenCV.Net
Assembly: OpenCV.Net.dll
Syntax
public sealed class VideoWriter : SafeHandleZeroOrMinusOneIsInvalid
Constructors
| Improve this Doc View SourceVideoWriter(String, Int32, Double, Size)
Initializes a new instance of the VideoWriter class with the specified
fileName, codec and format parameters.
Declaration
public VideoWriter(string fileName, int fourCC, double fps, Size frameSize)
Parameters
| Type | Name | Description |
|---|---|---|
| String | fileName | Name of the output video file. |
| Int32 | fourCC | 4-character code of codec used to compress the frames. |
| Double | fps | Framerate of the created video stream. |
| Size | frameSize | Size of the video frames. |
VideoWriter(String, Int32, Double, Size, Boolean)
Initializes a new instance of the VideoWriter class with the specified
fileName, codec and format parameters.
Declaration
public VideoWriter(string fileName, int fourCC, double fps, Size frameSize, bool isColor)
Parameters
| Type | Name | Description |
|---|---|---|
| String | fileName | Name of the output video file. |
| Int32 | fourCC | 4-character code of codec used to compress the frames. |
| Double | fps | Framerate of the created video stream. |
| Size | frameSize | Size of the video frames. |
| Boolean | isColor | If true, the encoder will expect and encode color frames, otherwise it will work with grayscale frames (the flag is currently supported on Windows only). |
Methods
| Improve this Doc View SourceFourCC(Char, Char, Char, Char)
Creates the integer representation of a 4-character codec code.
Declaration
public static int FourCC(char c1, char c2, char c3, char c4)
Parameters
| Type | Name | Description |
|---|---|---|
| Char | c1 | The first character of the codec code. |
| Char | c2 | The second character of the codec code. |
| Char | c3 | The third character of the codec code. |
| Char | c4 | The fourth character of the codec code. |
Returns
| Type | Description |
|---|---|
| Int32 | The integer representation of the codec code. |
ReleaseHandle()
Executes the code required to free the native VideoWriter handle.
Declaration
protected override bool ReleaseHandle()
Returns
| Type | Description |
|---|---|
| Boolean | true if the handle is released successfully; otherwise, in the event of a catastrophic failure, false. |
WriteFrame(IplImage)
Writes a frame to a video file.
Declaration
public bool WriteFrame(IplImage image)
Parameters
| Type | Name | Description |
|---|---|---|
| IplImage | image | The written frame. |
Returns
| Type | Description |
|---|---|
| Boolean | True if the frame was written successfully; false, otherwise. |