@Namespace(value="cv") @NoOffset public static class opencv_videoio.VideoWriter extends Pointer
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator| Constructor and Description |
|---|
opencv_videoio.VideoWriter()
\brief VideoWriter constructors
|
opencv_videoio.VideoWriter(BytePointer filename,
int fourcc,
double fps,
opencv_core.Size frameSize) |
opencv_videoio.VideoWriter(BytePointer filename,
int fourcc,
double fps,
opencv_core.Size frameSize,
boolean isColor)
\overload
|
opencv_videoio.VideoWriter(long size)
Native array allocator.
|
opencv_videoio.VideoWriter(Pointer p)
Pointer cast constructor.
|
opencv_videoio.VideoWriter(String filename,
int fourcc,
double fps,
opencv_core.Size frameSize) |
opencv_videoio.VideoWriter(String filename,
int fourcc,
double fps,
opencv_core.Size frameSize,
boolean isColor) |
| Modifier and Type | Method and Description |
|---|---|
static int |
fourcc(byte c1,
byte c2,
byte c3,
byte c4)
\brief Concatenates 4 chars to a fourcc code
|
double |
get(int propId)
\brief Returns the specified VideoWriter property
|
boolean |
isOpened()
\brief Returns true if video writer has been successfully initialized.
|
boolean |
open(BytePointer filename,
int fourcc,
double fps,
opencv_core.Size frameSize) |
boolean |
open(BytePointer filename,
int fourcc,
double fps,
opencv_core.Size frameSize,
boolean isColor)
\brief Initializes or reinitializes video writer.
|
boolean |
open(String filename,
int fourcc,
double fps,
opencv_core.Size frameSize) |
boolean |
open(String filename,
int fourcc,
double fps,
opencv_core.Size frameSize,
boolean isColor) |
opencv_videoio.VideoWriter |
position(long position) |
void |
release()
\brief Closes the video writer.
|
boolean |
set(int propId,
double value)
\brief Sets a property in the VideoWriter.
|
opencv_videoio.VideoWriter |
shiftLeft(opencv_core.Mat image) |
void |
write(opencv_core.Mat image)
\brief Writes the next video frame
|
address, asBuffer, asByteBuffer, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, hashCode, isNull, limit, limit, maxBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, position, put, setNull, sizeof, toString, totalBytes, withDeallocator, zeropublic opencv_videoio.VideoWriter(Pointer p)
Pointer.Pointer(Pointer).public opencv_videoio.VideoWriter(long size)
Pointer.position(long).public opencv_videoio.VideoWriter()
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.
public opencv_videoio.VideoWriter(@opencv_core.Str BytePointer filename, int fourcc, double fps, @ByVal opencv_core.Size frameSize, @Cast(value="bool") boolean isColor)
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](http://www.fourcc.org/codecs.php) page. FFMPEG backend with MP4 container natively uses
other values as fourcc code: see [ObjectType](http://www.mp4ra.org/codecs.html),
so you may receive a warning message from OpenCV about fourcc code conversion.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).public opencv_videoio.VideoWriter(@opencv_core.Str BytePointer filename, int fourcc, double fps, @ByVal opencv_core.Size frameSize)
public opencv_videoio.VideoWriter(@opencv_core.Str String filename, int fourcc, double fps, @ByVal opencv_core.Size frameSize, @Cast(value="bool") boolean isColor)
public opencv_videoio.VideoWriter(@opencv_core.Str String filename, int fourcc, double fps, @ByVal opencv_core.Size frameSize)
public opencv_videoio.VideoWriter position(long position)
@Cast(value="bool") public boolean open(@opencv_core.Str BytePointer filename, int fourcc, double fps, @ByVal opencv_core.Size frameSize, @Cast(value="bool") boolean isColor)
The method opens video writer. Parameters are the same as in the constructor VideoWriter::VideoWriter.
@Cast(value="bool") public boolean open(@opencv_core.Str BytePointer filename, int fourcc, double fps, @ByVal opencv_core.Size frameSize)
@Cast(value="bool") public boolean open(@opencv_core.Str String filename, int fourcc, double fps, @ByVal opencv_core.Size frameSize, @Cast(value="bool") boolean isColor)
@Cast(value="bool") public boolean open(@opencv_core.Str String filename, int fourcc, double fps, @ByVal opencv_core.Size frameSize)
@Cast(value="bool") public boolean isOpened()
public void release()
The methods are automatically called by subsequent VideoWriter::open and by the VideoWriter destructor.
@ByRef @Name(value="operator <<") public opencv_videoio.VideoWriter shiftLeft(@Const@ByRef opencv_core.Mat image)
public void write(@Const@ByRef opencv_core.Mat image)
image - The written frame
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.
@Cast(value="bool") public boolean set(int propId, double value)
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.
- **VIDEOWRITER_PROP_NSTRIPES** Number of stripes for parallel encodingvalue - Value of the property.public double get(int propId)
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.
- **VIDEOWRITER_PROP_NSTRIPES** Number of stripes for parallel encoding
\note When querying a property that is not supported by the backend used by the VideoWriter class, value 0 is returned.
public static int fourcc(@Cast(value="char") byte c1, @Cast(value="char") byte c2, @Cast(value="char") byte c3, @Cast(value="char") byte c4)
This static method constructs the fourcc code of the codec to be used in the constructor VideoWriter::VideoWriter or VideoWriter::open.
Copyright © 2016. All rights reserved.