opencv::mod_prelude

Trait VideoCaptureTraitConst

Source
pub trait VideoCaptureTraitConst {
    // Required method
    fn as_raw_VideoCapture(&self) -> *const c_void;

    // Provided methods
    fn is_opened(&self) -> Result<bool> { ... }
    fn get(&self, prop_id: i32) -> Result<f64> { ... }
    fn get_backend_name(&self) -> Result<String> { ... }
    fn get_exception_mode(&self) -> Result<bool> { ... }
}
Expand description

Constant methods for crate::videoio::VideoCapture

Required Methods§

Provided Methods§

Source

fn is_opened(&self) -> Result<bool>

Returns true if video capturing has been initialized already.

If the previous call to VideoCapture constructor or VideoCapture::open() succeeded, the method returns true.

Source

fn get(&self, prop_id: i32) -> Result<f64>

Returns the specified VideoCapture property

§Parameters
  • propId: Property identifier from cv::VideoCaptureProperties (eg. cv::CAP_PROP_POS_MSEC, cv::CAP_PROP_POS_FRAMES, …) or one from [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 VideoCapture instance.

Note: Reading / writing properties involves many layers. Some unexpected result might happens along this chain.

VideoCapture -> API Backend -> Operating System -> Device Driver -> Device Hardware

The returned value might be different from what really used by the device or it could be encoded using device dependent rules (eg. steps or percentage). Effective behaviour depends from device driver and API Backend

Source

fn get_backend_name(&self) -> Result<String>

Returns used backend API name

Note: Stream should be opened.

Source

fn get_exception_mode(&self) -> Result<bool>

query if exception mode is active

Implementors§