Video writer class.
More...
#include "videoio.hpp"
|
static int | fourcc (char c1, char c2, char c3, char c4) |
| Concatenates 4 chars to a fourcc code. More...
|
|
cv::VideoWriter::VideoWriter |
( |
| ) |
|
VideoWriter constructors.
The constructors/functions initialize video writers. On Linux FFMPEG is used to write videos; on Windows FFMPEG or VFW is used; on MacOSX QTKit is used.
cv::VideoWriter::VideoWriter |
( |
const String & |
filename, |
|
|
int |
fourcc, |
|
|
double |
fps, |
|
|
Size |
frameSize, |
|
|
bool |
isColor = true |
|
) |
| |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Parameters
-
filename | Name of the output video file. |
fourcc | 4-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 Video Codecs by FOURCC page. |
fps | Framerate of the created video stream. |
frameSize | Size of the video frames. |
isColor | If it is not zero, the encoder will expect and encode color frames, otherwise it will work with grayscale frames (the flag is currently supported on Windows only). |
virtual cv::VideoWriter::~VideoWriter |
( |
| ) |
|
|
virtual |
static Ptr<IVideoWriter> cv::VideoWriter::create |
( |
const String & |
filename, |
|
|
int |
fourcc, |
|
|
double |
fps, |
|
|
Size |
frameSize, |
|
|
bool |
isColor = true |
|
) |
| |
|
staticprotected |
static int cv::VideoWriter::fourcc |
( |
char |
c1, |
|
|
char |
c2, |
|
|
char |
c3, |
|
|
char |
c4 |
|
) |
| |
|
static |
virtual double cv::VideoWriter::get |
( |
int |
propId | ) |
const |
|
virtual |
Returns the specified VideoWriter property.
- Parameters
-
propId | Property identifier. It can be one of the following:
- VIDEOWRITER_PROP_QUALITY Current quality of the encoded videostream.
- VIDEOWRITER_PROP_FRAMEBYTES (Read-only) Size of just encoded video frame; note that the encoding order may be different from representation order.
|
- Note
- When querying a property that is not supported by the backend used by the VideoWriter class, value 0 is returned.
virtual bool cv::VideoWriter::isOpened |
( |
| ) |
const |
|
virtual |
Returns true if video writer has been successfully initialized.
virtual bool cv::VideoWriter::open |
( |
const String & |
filename, |
|
|
int |
fourcc, |
|
|
double |
fps, |
|
|
Size |
frameSize, |
|
|
bool |
isColor = true |
|
) |
| |
|
virtual |
Initializes or reinitializes video writer.
The method opens video writer. Parameters are the same as in the constructor VideoWriter::VideoWriter.
virtual void cv::VideoWriter::release |
( |
| ) |
|
|
virtual |
virtual bool cv::VideoWriter::set |
( |
int |
propId, |
|
|
double |
value |
|
) |
| |
|
virtual |
Sets a property in the VideoWriter.
- Parameters
-
propId | Property identifier. It can be one of the following:
- VIDEOWRITER_PROP_QUALITY Quality (0..100%) of the videostream encoded. Can be adjusted dynamically in some codecs.
|
value | Value of the property. |
virtual void cv::VideoWriter::write |
( |
const Mat & |
image | ) |
|
|
virtual |
Writes the next video frame.
- Parameters
-
The functions/methods write the specified image to video file. It must have the same size as has been specified when opening the video writer.
Ptr<IVideoWriter> cv::VideoWriter::iwriter |
|
protected |
The documentation for this class was generated from the following file: