OpenCV for Unity 2.6.4
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.10.0/index.html ) for the details of the argument of the method.
Loading...
Searching...
No Matches
OpenCVForUnity.VideoioModule.VideoWriter Class Reference

Video writer class. More...

Public Member Functions

 VideoWriter ()
 Default constructors.
 
 VideoWriter (string filename, int apiPreference, int fourcc, double fps, in Vec2d frameSize)
 
 VideoWriter (string filename, int apiPreference, int fourcc, double fps, in Vec2d frameSize, bool isColor)
 
 VideoWriter (string filename, int apiPreference, int fourcc, double fps, in Vec2d frameSize, MatOfInt _params)
 
 VideoWriter (string filename, int apiPreference, int fourcc, double fps, in(double width, double height) frameSize)
 
 VideoWriter (string filename, int apiPreference, int fourcc, double fps, in(double width, double height) frameSize, bool isColor)
 
 VideoWriter (string filename, int apiPreference, int fourcc, double fps, in(double width, double height) frameSize, MatOfInt _params)
 
 VideoWriter (string filename, int apiPreference, int fourcc, double fps, Size frameSize)
 
 VideoWriter (string filename, int apiPreference, int fourcc, double fps, Size frameSize, bool isColor)
 
 VideoWriter (string filename, int apiPreference, int fourcc, double fps, Size frameSize, MatOfInt _params)
 
 VideoWriter (string filename, int fourcc, double fps, in Vec2d frameSize)
 
 VideoWriter (string filename, int fourcc, double fps, in Vec2d frameSize, bool isColor)
 
 VideoWriter (string filename, int fourcc, double fps, in Vec2d frameSize, MatOfInt _params)
 
 VideoWriter (string filename, int fourcc, double fps, in(double width, double height) frameSize)
 
 VideoWriter (string filename, int fourcc, double fps, in(double width, double height) frameSize, bool isColor)
 
 VideoWriter (string filename, int fourcc, double fps, in(double width, double height) frameSize, MatOfInt _params)
 
 VideoWriter (string filename, int fourcc, double fps, Size frameSize)
 
 VideoWriter (string filename, int fourcc, double fps, Size frameSize, bool isColor)
 
 VideoWriter (string filename, int fourcc, double fps, Size frameSize, MatOfInt _params)
 
double get (int propId)
 Returns the specified VideoWriter property.
 
string getBackendName ()
 Returns used backend API name.
 
IntPtr getNativeObjAddr ()
 
bool isOpened ()
 Returns true if video writer has been successfully initialized.
 
bool open (string filename, int apiPreference, int fourcc, double fps, in Vec2d frameSize)
 
bool open (string filename, int apiPreference, int fourcc, double fps, in Vec2d frameSize, bool isColor)
 
bool open (string filename, int apiPreference, int fourcc, double fps, in Vec2d frameSize, MatOfInt _params)
 
bool open (string filename, int apiPreference, int fourcc, double fps, in(double width, double height) frameSize)
 
bool open (string filename, int apiPreference, int fourcc, double fps, in(double width, double height) frameSize, bool isColor)
 
bool open (string filename, int apiPreference, int fourcc, double fps, in(double width, double height) frameSize, MatOfInt _params)
 
bool open (string filename, int apiPreference, int fourcc, double fps, Size frameSize)
 
bool open (string filename, int apiPreference, int fourcc, double fps, Size frameSize, bool isColor)
 
bool open (string filename, int apiPreference, int fourcc, double fps, Size frameSize, MatOfInt _params)
 
bool open (string filename, int fourcc, double fps, in Vec2d frameSize)
 Initializes or reinitializes video writer.
 
bool open (string filename, int fourcc, double fps, in Vec2d frameSize, bool isColor)
 Initializes or reinitializes video writer.
 
bool open (string filename, int fourcc, double fps, in Vec2d frameSize, MatOfInt _params)
 
bool open (string filename, int fourcc, double fps, in(double width, double height) frameSize)
 Initializes or reinitializes video writer.
 
bool open (string filename, int fourcc, double fps, in(double width, double height) frameSize, bool isColor)
 Initializes or reinitializes video writer.
 
bool open (string filename, int fourcc, double fps, in(double width, double height) frameSize, MatOfInt _params)
 
bool open (string filename, int fourcc, double fps, Size frameSize)
 Initializes or reinitializes video writer.
 
bool open (string filename, int fourcc, double fps, Size frameSize, bool isColor)
 Initializes or reinitializes video writer.
 
bool open (string filename, int fourcc, double fps, Size frameSize, MatOfInt _params)
 
void release ()
 Closes the video writer.
 
bool set (int propId, double value)
 Sets a property in the VideoWriter.
 
void write (Mat image)
 Writes the next video frame.
 
- Public Member Functions inherited from OpenCVForUnity.DisposableObject
void Dispose ()
 
void ThrowIfDisposed ()
 

Static Public Member Functions

static VideoWriter __fromPtr__ (IntPtr addr)
 
static int fourcc (char c1, char c2, char c3, char c4)
 Concatenates 4 chars to a fourcc code.
 
- Static Public Member Functions inherited from OpenCVForUnity.DisposableObject
static IntPtr ThrowIfNullIntPtr (IntPtr ptr)
 

Protected Member Functions

override void Dispose (bool disposing)
 
- Protected Member Functions inherited from OpenCVForUnity.DisposableOpenCVObject
 DisposableOpenCVObject ()
 
 DisposableOpenCVObject (bool isEnabledDispose)
 
 DisposableOpenCVObject (IntPtr ptr)
 
 DisposableOpenCVObject (IntPtr ptr, bool isEnabledDispose)
 
- Protected Member Functions inherited from OpenCVForUnity.DisposableObject
 DisposableObject ()
 
 DisposableObject (bool isEnabledDispose)
 

Additional Inherited Members

- Package Attributes inherited from OpenCVForUnity.DisposableOpenCVObject
- Properties inherited from OpenCVForUnity.DisposableObject
bool IsDisposed [get, protected set]
 
bool IsEnabledDispose [get, set]
 

Detailed Description

Video writer class.

The class provides C++ API for writing video files or image sequences.

Constructor & Destructor Documentation

◆ VideoWriter() [1/19]

OpenCVForUnity.VideoioModule.VideoWriter.VideoWriter ( )

Default constructors.

The constructors/functions initialize video writers.

  • On Linux FFMPEG is used to write videos;
  • On Windows FFMPEG or MSWF or DSHOW is used;
  • On MacOSX AVFoundation is used.

◆ VideoWriter() [2/19]

OpenCVForUnity.VideoioModule.VideoWriter.VideoWriter ( string filename,
int fourcc,
double fps,
Size frameSize,
bool isColor )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
filenameName of the output video file.
fourcc4-character code of codec used to compress the frames. For example, VideoWriter.fourcc('P','I','M','1') is a MPEG-1 codec, VideoWriter.fourcc('M','J','P','G') is a motion-jpeg codec etc. List of codes can be obtained at MSDN page or with this page of the fourcc site for a more complete list). FFMPEG backend with MP4 container natively uses other values as fourcc code: see ObjectType, so you may receive a warning message from OpenCV about fourcc code conversion.
fpsFramerate of the created video stream.
frameSizeSize of the video frames.
isColorIf it is not zero, the encoder will expect and encode color frames, otherwise it will work with grayscale frames.

Tips:

  • With some backends fourcc=-1 pops up the codec selection dialog from the system.
  • To save image sequence use a proper filename (eg. img_%02d.jpg) and fourcc=0 OR fps=0. Use uncompressed image format (eg. img_%02d.BMP) to save raw frames.
  • Most codecs are lossy. If you want lossless video file you need to use a lossless codecs (eg. FFMPEG FFV1, Huffman HFYU, Lagarith LAGS, etc...)
  • If FFMPEG is enabled, using codec=0; fps=0; you can create an uncompressed (raw) video file.
  • If FFMPEG is used, we allow frames of odd width or height, but in this case we truncate the rightmost column/the bottom row. Probably, this should be handled more elegantly, but some internal functions inside FFMPEG swscale require even width/height.

◆ VideoWriter() [3/19]

OpenCVForUnity.VideoioModule.VideoWriter.VideoWriter ( string filename,
int fourcc,
double fps,
Size frameSize )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
filenameName of the output video file.
fourcc4-character code of codec used to compress the frames. For example, VideoWriter.fourcc('P','I','M','1') is a MPEG-1 codec, VideoWriter.fourcc('M','J','P','G') is a motion-jpeg codec etc. List of codes can be obtained at MSDN page or with this page of the fourcc site for a more complete list). FFMPEG backend with MP4 container natively uses other values as fourcc code: see ObjectType, so you may receive a warning message from OpenCV about fourcc code conversion.
fpsFramerate of the created video stream.
frameSizeSize of the video frames.
isColorIf it is not zero, the encoder will expect and encode color frames, otherwise it will work with grayscale frames.

Tips:

  • With some backends fourcc=-1 pops up the codec selection dialog from the system.
  • To save image sequence use a proper filename (eg. img_%02d.jpg) and fourcc=0 OR fps=0. Use uncompressed image format (eg. img_%02d.BMP) to save raw frames.
  • Most codecs are lossy. If you want lossless video file you need to use a lossless codecs (eg. FFMPEG FFV1, Huffman HFYU, Lagarith LAGS, etc...)
  • If FFMPEG is enabled, using codec=0; fps=0; you can create an uncompressed (raw) video file.
  • If FFMPEG is used, we allow frames of odd width or height, but in this case we truncate the rightmost column/the bottom row. Probably, this should be handled more elegantly, but some internal functions inside FFMPEG swscale require even width/height.

◆ VideoWriter() [4/19]

OpenCVForUnity.VideoioModule.VideoWriter.VideoWriter ( string filename,
int apiPreference,
int fourcc,
double fps,
Size frameSize,
bool isColor )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. The apiPreference parameter 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.

◆ VideoWriter() [5/19]

OpenCVForUnity.VideoioModule.VideoWriter.VideoWriter ( string filename,
int apiPreference,
int fourcc,
double fps,
Size frameSize )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. The apiPreference parameter 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.

◆ VideoWriter() [6/19]

OpenCVForUnity.VideoioModule.VideoWriter.VideoWriter ( string filename,
int fourcc,
double fps,
Size frameSize,
MatOfInt _params )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. The params parameter allows to specify extra encoder parameters encoded as pairs (paramId_1, paramValue_1, paramId_2, paramValue_2, ... .) see cv::VideoWriterProperties

◆ VideoWriter() [7/19]

OpenCVForUnity.VideoioModule.VideoWriter.VideoWriter ( string filename,
int apiPreference,
int fourcc,
double fps,
Size frameSize,
MatOfInt _params )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ VideoWriter() [8/19]

OpenCVForUnity.VideoioModule.VideoWriter.VideoWriter ( string filename,
int fourcc,
double fps,
in Vec2d frameSize,
bool isColor )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
filenameName of the output video file.
fourcc4-character code of codec used to compress the frames. For example, VideoWriter.fourcc('P','I','M','1') is a MPEG-1 codec, VideoWriter.fourcc('M','J','P','G') is a motion-jpeg codec etc. List of codes can be obtained at MSDN page or with this page of the fourcc site for a more complete list). FFMPEG backend with MP4 container natively uses other values as fourcc code: see ObjectType, so you may receive a warning message from OpenCV about fourcc code conversion.
fpsFramerate of the created video stream.
frameSizeSize of the video frames.
isColorIf it is not zero, the encoder will expect and encode color frames, otherwise it will work with grayscale frames.

Tips:

  • With some backends fourcc=-1 pops up the codec selection dialog from the system.
  • To save image sequence use a proper filename (eg. img_%02d.jpg) and fourcc=0 OR fps=0. Use uncompressed image format (eg. img_%02d.BMP) to save raw frames.
  • Most codecs are lossy. If you want lossless video file you need to use a lossless codecs (eg. FFMPEG FFV1, Huffman HFYU, Lagarith LAGS, etc...)
  • If FFMPEG is enabled, using codec=0; fps=0; you can create an uncompressed (raw) video file.
  • If FFMPEG is used, we allow frames of odd width or height, but in this case we truncate the rightmost column/the bottom row. Probably, this should be handled more elegantly, but some internal functions inside FFMPEG swscale require even width/height.

◆ VideoWriter() [9/19]

OpenCVForUnity.VideoioModule.VideoWriter.VideoWriter ( string filename,
int fourcc,
double fps,
in Vec2d frameSize )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
filenameName of the output video file.
fourcc4-character code of codec used to compress the frames. For example, VideoWriter.fourcc('P','I','M','1') is a MPEG-1 codec, VideoWriter.fourcc('M','J','P','G') is a motion-jpeg codec etc. List of codes can be obtained at MSDN page or with this page of the fourcc site for a more complete list). FFMPEG backend with MP4 container natively uses other values as fourcc code: see ObjectType, so you may receive a warning message from OpenCV about fourcc code conversion.
fpsFramerate of the created video stream.
frameSizeSize of the video frames.
isColorIf it is not zero, the encoder will expect and encode color frames, otherwise it will work with grayscale frames.

Tips:

  • With some backends fourcc=-1 pops up the codec selection dialog from the system.
  • To save image sequence use a proper filename (eg. img_%02d.jpg) and fourcc=0 OR fps=0. Use uncompressed image format (eg. img_%02d.BMP) to save raw frames.
  • Most codecs are lossy. If you want lossless video file you need to use a lossless codecs (eg. FFMPEG FFV1, Huffman HFYU, Lagarith LAGS, etc...)
  • If FFMPEG is enabled, using codec=0; fps=0; you can create an uncompressed (raw) video file.
  • If FFMPEG is used, we allow frames of odd width or height, but in this case we truncate the rightmost column/the bottom row. Probably, this should be handled more elegantly, but some internal functions inside FFMPEG swscale require even width/height.

◆ VideoWriter() [10/19]

OpenCVForUnity.VideoioModule.VideoWriter.VideoWriter ( string filename,
int apiPreference,
int fourcc,
double fps,
in Vec2d frameSize,
bool isColor )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. The apiPreference parameter 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.

◆ VideoWriter() [11/19]

OpenCVForUnity.VideoioModule.VideoWriter.VideoWriter ( string filename,
int apiPreference,
int fourcc,
double fps,
in Vec2d frameSize )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. The apiPreference parameter 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.

◆ VideoWriter() [12/19]

OpenCVForUnity.VideoioModule.VideoWriter.VideoWriter ( string filename,
int fourcc,
double fps,
in Vec2d frameSize,
MatOfInt _params )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. The params parameter allows to specify extra encoder parameters encoded as pairs (paramId_1, paramValue_1, paramId_2, paramValue_2, ... .) see cv::VideoWriterProperties

◆ VideoWriter() [13/19]

OpenCVForUnity.VideoioModule.VideoWriter.VideoWriter ( string filename,
int apiPreference,
int fourcc,
double fps,
in Vec2d frameSize,
MatOfInt _params )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ VideoWriter() [14/19]

OpenCVForUnity.VideoioModule.VideoWriter.VideoWriter ( string filename,
int fourcc,
double fps,
in(double width, double height) frameSize,
bool isColor )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
filenameName of the output video file.
fourcc4-character code of codec used to compress the frames. For example, VideoWriter.fourcc('P','I','M','1') is a MPEG-1 codec, VideoWriter.fourcc('M','J','P','G') is a motion-jpeg codec etc. List of codes can be obtained at MSDN page or with this page of the fourcc site for a more complete list). FFMPEG backend with MP4 container natively uses other values as fourcc code: see ObjectType, so you may receive a warning message from OpenCV about fourcc code conversion.
fpsFramerate of the created video stream.
frameSizeSize of the video frames.
isColorIf it is not zero, the encoder will expect and encode color frames, otherwise it will work with grayscale frames.

Tips:

  • With some backends fourcc=-1 pops up the codec selection dialog from the system.
  • To save image sequence use a proper filename (eg. img_%02d.jpg) and fourcc=0 OR fps=0. Use uncompressed image format (eg. img_%02d.BMP) to save raw frames.
  • Most codecs are lossy. If you want lossless video file you need to use a lossless codecs (eg. FFMPEG FFV1, Huffman HFYU, Lagarith LAGS, etc...)
  • If FFMPEG is enabled, using codec=0; fps=0; you can create an uncompressed (raw) video file.
  • If FFMPEG is used, we allow frames of odd width or height, but in this case we truncate the rightmost column/the bottom row. Probably, this should be handled more elegantly, but some internal functions inside FFMPEG swscale require even width/height.

◆ VideoWriter() [15/19]

OpenCVForUnity.VideoioModule.VideoWriter.VideoWriter ( string filename,
int fourcc,
double fps,
in(double width, double height) frameSize )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
filenameName of the output video file.
fourcc4-character code of codec used to compress the frames. For example, VideoWriter.fourcc('P','I','M','1') is a MPEG-1 codec, VideoWriter.fourcc('M','J','P','G') is a motion-jpeg codec etc. List of codes can be obtained at MSDN page or with this page of the fourcc site for a more complete list). FFMPEG backend with MP4 container natively uses other values as fourcc code: see ObjectType, so you may receive a warning message from OpenCV about fourcc code conversion.
fpsFramerate of the created video stream.
frameSizeSize of the video frames.
isColorIf it is not zero, the encoder will expect and encode color frames, otherwise it will work with grayscale frames.

Tips:

  • With some backends fourcc=-1 pops up the codec selection dialog from the system.
  • To save image sequence use a proper filename (eg. img_%02d.jpg) and fourcc=0 OR fps=0. Use uncompressed image format (eg. img_%02d.BMP) to save raw frames.
  • Most codecs are lossy. If you want lossless video file you need to use a lossless codecs (eg. FFMPEG FFV1, Huffman HFYU, Lagarith LAGS, etc...)
  • If FFMPEG is enabled, using codec=0; fps=0; you can create an uncompressed (raw) video file.
  • If FFMPEG is used, we allow frames of odd width or height, but in this case we truncate the rightmost column/the bottom row. Probably, this should be handled more elegantly, but some internal functions inside FFMPEG swscale require even width/height.

◆ VideoWriter() [16/19]

OpenCVForUnity.VideoioModule.VideoWriter.VideoWriter ( string filename,
int apiPreference,
int fourcc,
double fps,
in(double width, double height) frameSize,
bool isColor )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. The apiPreference parameter 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.

◆ VideoWriter() [17/19]

OpenCVForUnity.VideoioModule.VideoWriter.VideoWriter ( string filename,
int apiPreference,
int fourcc,
double fps,
in(double width, double height) frameSize )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. The apiPreference parameter 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.

◆ VideoWriter() [18/19]

OpenCVForUnity.VideoioModule.VideoWriter.VideoWriter ( string filename,
int fourcc,
double fps,
in(double width, double height) frameSize,
MatOfInt _params )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. The params parameter allows to specify extra encoder parameters encoded as pairs (paramId_1, paramValue_1, paramId_2, paramValue_2, ... .) see cv::VideoWriterProperties

◆ VideoWriter() [19/19]

OpenCVForUnity.VideoioModule.VideoWriter.VideoWriter ( string filename,
int apiPreference,
int fourcc,
double fps,
in(double width, double height) frameSize,
MatOfInt _params )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Member Function Documentation

◆ __fromPtr__()

static VideoWriter OpenCVForUnity.VideoioModule.VideoWriter.__fromPtr__ ( IntPtr addr)
static

◆ Dispose()

override void OpenCVForUnity.VideoioModule.VideoWriter.Dispose ( bool disposing)
protectedvirtual

◆ fourcc()

static int OpenCVForUnity.VideoioModule.VideoWriter.fourcc ( char c1,
char c2,
char c3,
char c4 )
static

Concatenates 4 chars to a fourcc code.

Returns
a fourcc code

This static method constructs the fourcc code of the codec to be used in the constructor VideoWriter.VideoWriter or VideoWriter.open.

◆ get()

double OpenCVForUnity.VideoioModule.VideoWriter.get ( int propId)

Returns the specified VideoWriter property.

Parameters
propIdProperty identifier from cv::VideoWriterProperties (eg. cv::VIDEOWRITER_PROP_QUALITY) or one of videoio_flags_others
Returns
Value for the specified property. Value 0 is returned when querying a property that is not supported by the backend used by the VideoWriter instance.

◆ getBackendName()

string OpenCVForUnity.VideoioModule.VideoWriter.getBackendName ( )

Returns used backend API name.

Note
Stream should be opened.

◆ getNativeObjAddr()

IntPtr OpenCVForUnity.VideoioModule.VideoWriter.getNativeObjAddr ( )

◆ isOpened()

bool OpenCVForUnity.VideoioModule.VideoWriter.isOpened ( )

Returns true if video writer has been successfully initialized.

◆ open() [1/18]

bool OpenCVForUnity.VideoioModule.VideoWriter.open ( string filename,
int apiPreference,
int fourcc,
double fps,
in Vec2d frameSize )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ open() [2/18]

bool OpenCVForUnity.VideoioModule.VideoWriter.open ( string filename,
int apiPreference,
int fourcc,
double fps,
in Vec2d frameSize,
bool isColor )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ open() [3/18]

bool OpenCVForUnity.VideoioModule.VideoWriter.open ( string filename,
int apiPreference,
int fourcc,
double fps,
in Vec2d frameSize,
MatOfInt _params )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ open() [4/18]

bool OpenCVForUnity.VideoioModule.VideoWriter.open ( string filename,
int apiPreference,
int fourcc,
double fps,
in(double width, double height) frameSize )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ open() [5/18]

bool OpenCVForUnity.VideoioModule.VideoWriter.open ( string filename,
int apiPreference,
int fourcc,
double fps,
in(double width, double height) frameSize,
bool isColor )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ open() [6/18]

bool OpenCVForUnity.VideoioModule.VideoWriter.open ( string filename,
int apiPreference,
int fourcc,
double fps,
in(double width, double height) frameSize,
MatOfInt _params )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ open() [7/18]

bool OpenCVForUnity.VideoioModule.VideoWriter.open ( string filename,
int apiPreference,
int fourcc,
double fps,
Size frameSize )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ open() [8/18]

bool OpenCVForUnity.VideoioModule.VideoWriter.open ( string filename,
int apiPreference,
int fourcc,
double fps,
Size frameSize,
bool isColor )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ open() [9/18]

bool OpenCVForUnity.VideoioModule.VideoWriter.open ( string filename,
int apiPreference,
int fourcc,
double fps,
Size frameSize,
MatOfInt _params )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ open() [10/18]

bool OpenCVForUnity.VideoioModule.VideoWriter.open ( string filename,
int fourcc,
double fps,
in Vec2d frameSize )

Initializes or reinitializes video writer.

The method opens video writer. Parameters are the same as in the constructor VideoWriter.VideoWriter.

Returns
true if video writer has been successfully initialized

The method first calls VideoWriter.release to close the already opened file.

◆ open() [11/18]

bool OpenCVForUnity.VideoioModule.VideoWriter.open ( string filename,
int fourcc,
double fps,
in Vec2d frameSize,
bool isColor )

Initializes or reinitializes video writer.

The method opens video writer. Parameters are the same as in the constructor VideoWriter.VideoWriter.

Returns
true if video writer has been successfully initialized

The method first calls VideoWriter.release to close the already opened file.

◆ open() [12/18]

bool OpenCVForUnity.VideoioModule.VideoWriter.open ( string filename,
int fourcc,
double fps,
in Vec2d frameSize,
MatOfInt _params )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ open() [13/18]

bool OpenCVForUnity.VideoioModule.VideoWriter.open ( string filename,
int fourcc,
double fps,
in(double width, double height) frameSize )

Initializes or reinitializes video writer.

The method opens video writer. Parameters are the same as in the constructor VideoWriter.VideoWriter.

Returns
true if video writer has been successfully initialized

The method first calls VideoWriter.release to close the already opened file.

◆ open() [14/18]

bool OpenCVForUnity.VideoioModule.VideoWriter.open ( string filename,
int fourcc,
double fps,
in(double width, double height) frameSize,
bool isColor )

Initializes or reinitializes video writer.

The method opens video writer. Parameters are the same as in the constructor VideoWriter.VideoWriter.

Returns
true if video writer has been successfully initialized

The method first calls VideoWriter.release to close the already opened file.

◆ open() [15/18]

bool OpenCVForUnity.VideoioModule.VideoWriter.open ( string filename,
int fourcc,
double fps,
in(double width, double height) frameSize,
MatOfInt _params )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ open() [16/18]

bool OpenCVForUnity.VideoioModule.VideoWriter.open ( string filename,
int fourcc,
double fps,
Size frameSize )

Initializes or reinitializes video writer.

The method opens video writer. Parameters are the same as in the constructor VideoWriter.VideoWriter.

Returns
true if video writer has been successfully initialized

The method first calls VideoWriter.release to close the already opened file.

◆ open() [17/18]

bool OpenCVForUnity.VideoioModule.VideoWriter.open ( string filename,
int fourcc,
double fps,
Size frameSize,
bool isColor )

Initializes or reinitializes video writer.

The method opens video writer. Parameters are the same as in the constructor VideoWriter.VideoWriter.

Returns
true if video writer has been successfully initialized

The method first calls VideoWriter.release to close the already opened file.

◆ open() [18/18]

bool OpenCVForUnity.VideoioModule.VideoWriter.open ( string filename,
int fourcc,
double fps,
Size frameSize,
MatOfInt _params )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ release()

void OpenCVForUnity.VideoioModule.VideoWriter.release ( )

Closes the video writer.

The method is automatically called by subsequent VideoWriter.open and by the VideoWriter destructor.

◆ set()

bool OpenCVForUnity.VideoioModule.VideoWriter.set ( int propId,
double value )

Sets a property in the VideoWriter.

Parameters
propIdProperty identifier from cv::VideoWriterProperties (eg. cv::VIDEOWRITER_PROP_QUALITY) or one of videoio_flags_others
valueValue of the property.
Returns
true if the property is supported by the backend used by the VideoWriter instance.

◆ write()

void OpenCVForUnity.VideoioModule.VideoWriter.write ( Mat image)

Writes the next video frame.

Parameters
imageThe written frame. In general, color images are expected in BGR format.

The function/method writes the specified image to video file. It must have the same size as has been specified when opening the video writer.


The documentation for this class was generated from the following files: