VideoWriterProperties

Enum VideoWriterProperties 

Source
#[repr(i32)]
pub enum VideoWriterProperties {
Show 14 variants VIDEOWRITER_PROP_QUALITY = 1, VIDEOWRITER_PROP_FRAMEBYTES = 2, VIDEOWRITER_PROP_NSTRIPES = 3, VIDEOWRITER_PROP_IS_COLOR = 4, VIDEOWRITER_PROP_DEPTH = 5, VIDEOWRITER_PROP_HW_ACCELERATION = 6, VIDEOWRITER_PROP_HW_DEVICE = 7, VIDEOWRITER_PROP_HW_ACCELERATION_USE_OPENCL = 8, VIDEOWRITER_PROP_RAW_VIDEO = 9, VIDEOWRITER_PROP_KEY_INTERVAL = 10, VIDEOWRITER_PROP_KEY_FLAG = 11, VIDEOWRITER_PROP_PTS = 12, VIDEOWRITER_PROP_DTS_DELAY = 13, CV__VIDEOWRITER_PROP_LATEST = 14,
}
Expand description

cv::VideoWriter generic properties identifier.

§See also

VideoWriter::get(), VideoWriter::set()

Variants§

§

VIDEOWRITER_PROP_QUALITY = 1

Current quality (0..100%) of the encoded videostream. Can be adjusted dynamically in some codecs.

§

VIDEOWRITER_PROP_FRAMEBYTES = 2

(Read-only): Size of just encoded video frame. Note that the encoding order may be different from representation order.

§

VIDEOWRITER_PROP_NSTRIPES = 3

Number of stripes for parallel encoding. -1 for auto detection.

§

VIDEOWRITER_PROP_IS_COLOR = 4

If it is not zero, the encoder will expect and encode color frames, otherwise it will work with grayscale frames.

§

VIDEOWRITER_PROP_DEPTH = 5

Defaults to \ref CV_8U.

§

VIDEOWRITER_PROP_HW_ACCELERATION = 6

(open-only) Hardware acceleration type (see #VideoAccelerationType). Setting supported only via params parameter in VideoWriter constructor / .open() method. Default value is backend-specific.

§

VIDEOWRITER_PROP_HW_DEVICE = 7

(open-only) Hardware device index (select GPU if multiple available). Device enumeration is acceleration type specific.

§

VIDEOWRITER_PROP_HW_ACCELERATION_USE_OPENCL = 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.

§

VIDEOWRITER_PROP_RAW_VIDEO = 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 \ref CV_8UC1 Mat. \note If the key frame interval is not 1 then it must be manually specified by the user. This can either be performed during initialization passing \ref VIDEOWRITER_PROP_KEY_INTERVAL as one of the extra encoder params to \ref VideoWriter::VideoWriter(const String &, int, double, const Size &, const std::vector< int > &params) or afterwards by setting the \ref VIDEOWRITER_PROP_KEY_FLAG with \ref VideoWriter::set() before writing each frame. FFMpeg backend only.

§

VIDEOWRITER_PROP_KEY_INTERVAL = 10

(open-only) Set the key frame interval using raw video encapsulation (\ref VIDEOWRITER_PROP_RAW_VIDEO != 0). Defaults to 1 when not set. FFmpeg back-end only.

§

VIDEOWRITER_PROP_KEY_FLAG = 11

Set to non-zero to signal that the following frames are key frames or zero if not, when encapsulating raw video (\ref VIDEOWRITER_PROP_RAW_VIDEO != 0). FFmpeg back-end only.

§

VIDEOWRITER_PROP_PTS = 12

Specifies 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. The value should be provided by your external encoder and for video sources with fixed frame rates it is equivalent to dividing the current frame’s presentation time (\ref CAP_PROP_POS_MSEC) by the frame duration (1000.0 / VideoCapture::get(\ref CAP_PROP_FPS)). It can be queried from the resulting encapsulated video file using VideoCapture::get(\ref CAP_PROP_PTS). FFmpeg back-end only.

§

VIDEOWRITER_PROP_DTS_DELAY = 13

Specifies the maximum difference between presentation (pts) and decompression timestamps (dts) using the FPS time base. This property is necessary only when encapsulating externally encoded video where the decoding order differs from the presentation order, such as in GOP patterns with bi-directional B-frames. The value should be calculated based on the specific GOP pattern used during encoding. For example, in a GOP with presentation order IBP and decoding order IPB, this value would be 1, as the B-frame is the second frame presented but the third to be decoded. It can be queried from the resulting encapsulated video file using VideoCapture::get(\ref CAP_PROP_DTS_DELAY). Non-zero values usually imply the stream is encoded using B-frames. FFmpeg back-end only.

§

CV__VIDEOWRITER_PROP_LATEST = 14

Trait Implementations§

Source§

impl Clone for VideoWriterProperties

Source§

fn clone(&self) -> VideoWriterProperties

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for VideoWriterProperties

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<VideoWriterProperties> for i32

Source§

fn from(v: VideoWriterProperties) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for VideoWriterProperties

Source§

fn eq(&self, other: &VideoWriterProperties) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TryFrom<i32> for VideoWriterProperties

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(value: i32) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Copy for VideoWriterProperties

Source§

impl Eq for VideoWriterProperties

Source§

impl StructuralPartialEq for VideoWriterProperties

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.