Enum VideoWriterProperties
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
VideoWriter generic properties identifier.
public enum VideoWriterProperties
Fields
BitRate = 16(open-only) Target bitrate in bits per second. Crf takes precedence. FFmpeg and GStreamer backends, when supported by the selected encoder.
ColorSpace = 14(open-only) Pixel format as a FourCC. FFmpeg and GStreamer backends. FFmpeg uses the same codes as CodecPixelFormat and requires the selected encoder to support the format. FFmpeg hardware encoding accepts only NV12. GStreamer uses raw video formats such as I420, NV12, and BGRx.
Crf = 17(open-only) Constant rate factor. Lower values give better quality and larger files. The range depends on the encoder. FFmpeg and GStreamer backends, when supported by the selected encoder.
Depth = 5Defaults to CV_8U.
DtsDelay = 13Specifies the maximum difference between presentation (pts) and decompression timestamps using the FPS time base. This property is necessary only when encapsulating externally encoded video where the decoding order differs from the presentation order. FFmpeg back-end only.
EnableAlpha = 15(open-only) FFmpeg backend only. Defines that input frames contain alpha channel.
FrameBytes = 2(Read-only): Size of just encoded video frame. Note that the encoding order may be different from representation order.
GopSize = 19(open-only) Maximum interval between key frames, in frames. FFmpeg and GStreamer backends, when supported by the selected encoder.
HwAcceleration = 6(open-only) Hardware acceleration type (see VideoAccelerationType). Setting supported only via params parameter in cv::VideoCapture constructor / .open() method. Default value is backend-specific.
HwAccelerationUseOpenCL = 8(open-only) If non-zero, create new OpenCL context and bind it to current thread. The OpenCL context created with Video Acceleration context attached it (if not attached yet) for optimized GPU data copy between cv::UMat and HW accelerated encoder.
HwDevice = 7(open-only) Hardware device index (select GPU if multiple available). Device enumeration is acceleration type specific.
IsColor = 4If it is not zero, the encoder will expect and encode color frames, otherwise it will work with grayscale frames.
KeyFlag = 11Set to non-zero to signal that the following frames are key frames or zero if not, when encapsulating raw video (RawVideo != 0). FFmpeg back-end only.
KeyInterval = 10(open-only) Set the key frame interval when using raw video encapsulation (RawVideo != 0). Defaults to 1 when not set. FFmpeg back-end only.
NStripes = 3Number of stripes for parallel encoding. -1 for auto detection.
Preset = 18(open-only) Encoding speed and compression trade-off. Pass a VideoWriterPresets value. Supported by FFmpeg libx264 and libx265 and the corresponding GStreamer encoder elements.
Pts = 12Specifies the frame presentation timestamp for each frame using the FPS time base. This property is only necessary when encapsulating externally encoded video where the decoding order differs from the presentation order, such as in GOP patterns with bi-directional B-frames. FFmpeg back-end only.
Quality = 1Current quality (0..100%) of the encoded video stream. Can be adjusted dynamically in some codecs.
RawVideo = 9(open-only) Set to non-zero to enable encapsulation of an encoded raw video stream. Each raw encoded video frame should be passed to VideoWriter.Write() as single row or column of a CV_8UC1 Mat. If the key frame interval is not 1 then it must be manually specified by the user, either during initialization by passing KeyInterval as one of the extra encoder params, or afterwards by setting KeyFlag with VideoWriter.Set() before writing each frame. FFmpeg backend only.