Table of Contents

Constructor VideoWriter

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

VideoWriter()

public VideoWriter()

VideoWriter(string, FourCC, double, Size, bool)

Creates video writer structure.

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

Parameters

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

Frame rate 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).

VideoWriter(string, VideoCaptureAPIs, FourCC, double, Size, bool)

Creates video writer structure.

public VideoWriter(string fileName, VideoCaptureAPIs apiPreference, FourCC fourcc, double fps, Size frameSize, bool isColor = true)

Parameters

fileName string

Name of the output video file.

apiPreference VideoCaptureAPIs

allows to specify API backends to use. Can be used to enforce a specific reader implementation if multiple are available: e.g. cv::CAP_FFMPEG or cv::CAP_GSTREAMER.

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

Frame rate 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).

VideoWriter(string, FourCC, double, Size, int[])

Creates video writer structure.

public VideoWriter(string fileName, FourCC fourcc, double fps, Size frameSize, int[] prms)

Parameters

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

Frame rate of the created video stream.

frameSize Size

Size of video frames.

prms int[]

The params parameter allows to specify extra encoder parameters encoded as pairs (paramId_1, paramValue_1, paramId_2, paramValue_2, ... .) see cv::VideoWriterProperties

VideoWriter(string, FourCC, double, Size, VideoWriterPara)

Creates video writer structure.

public VideoWriter(string fileName, FourCC fourcc, double fps, Size frameSize, VideoWriterPara prms)

Parameters

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

Frame rate of the created video stream.

frameSize Size

Size of video frames.

prms VideoWriterPara

Parameters of VideoWriter for hardware acceleration

VideoWriter(string, VideoCaptureAPIs, FourCC, double, Size, int[])

Creates video writer structure.

public VideoWriter(string fileName, VideoCaptureAPIs apiPreference, FourCC fourcc, double fps, Size frameSize, int[] prms)

Parameters

fileName string

Name of the output video file.

apiPreference VideoCaptureAPIs

allows to specify API backends to use. Can be used to enforce a specific reader implementation if multiple are available: e.g. cv::CAP_FFMPEG or cv::CAP_GSTREAMER.

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

Frame rate of the created video stream.

frameSize Size

Size of video frames.

prms int[]

The params parameter allows to specify extra encoder parameters encoded as pairs (paramId_1, paramValue_1, paramId_2, paramValue_2, ... .) see cv::VideoWriterProperties

VideoWriter(string, VideoCaptureAPIs, FourCC, double, Size, VideoWriterPara)

Creates video writer structure.

public VideoWriter(string fileName, VideoCaptureAPIs apiPreference, FourCC fourcc, double fps, Size frameSize, VideoWriterPara prms)

Parameters

fileName string

Name of the output video file.

apiPreference VideoCaptureAPIs

allows to specify API backends to use. Can be used to enforce a specific reader implementation if multiple are available: e.g. cv::CAP_FFMPEG or cv::CAP_GSTREAMER.

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

Frame rate of the created video stream.

frameSize Size

Size of video frames.

prms VideoWriterPara

Parameters of VideoWriter for hardware acceleration