pub trait VideoWriterTrait: VideoWriterTraitConst {
    // Required method
    fn as_raw_mut_VideoWriter(&mut self) -> *mut c_void;

    // Provided methods
    fn open(
        &mut self,
        filename: &str,
        fourcc: i32,
        fps: f64,
        frame_size: Size,
        is_color: bool
    ) -> Result<bool> { ... }
    fn open_with_backend(
        &mut self,
        filename: &str,
        api_preference: i32,
        fourcc: i32,
        fps: f64,
        frame_size: Size,
        is_color: bool
    ) -> Result<bool> { ... }
    fn open_1(
        &mut self,
        filename: &str,
        fourcc: i32,
        fps: f64,
        frame_size: Size,
        params: &Vector<i32>
    ) -> Result<bool> { ... }
    fn open_2(
        &mut self,
        filename: &str,
        api_preference: i32,
        fourcc: i32,
        fps: f64,
        frame_size: Size,
        params: &Vector<i32>
    ) -> Result<bool> { ... }
    fn release(&mut self) -> Result<()> { ... }
    fn write(&mut self, image: &dyn ToInputArray) -> Result<()> { ... }
    fn set(&mut self, prop_id: i32, value: f64) -> Result<bool> { ... }
}
Expand description

Mutable methods for crate::videoio::VideoWriter

Required Methods§

Provided Methods§

source

fn open( &mut self, filename: &str, fourcc: i32, fps: f64, frame_size: Size, is_color: bool ) -> Result<bool>

Initializes or reinitializes video writer.

The method opens video writer. Parameters are the same as in the constructor VideoWriter::VideoWriter.

Returns

true if video writer has been successfully initialized

The method first calls VideoWriter::release to close the already opened file.

C++ default parameters
  • is_color: true
source

fn open_with_backend( &mut self, filename: &str, api_preference: i32, fourcc: i32, fps: f64, frame_size: Size, is_color: bool ) -> Result<bool>

Initializes or reinitializes video writer.

The method opens video writer. Parameters are the same as in the constructor VideoWriter::VideoWriter.

Returns

true if video writer has been successfully initialized

The method first calls VideoWriter::release to close the already opened file.

Overloaded parameters
C++ default parameters
  • is_color: true
source

fn open_1( &mut self, filename: &str, fourcc: i32, fps: f64, frame_size: Size, params: &Vector<i32> ) -> Result<bool>

Initializes or reinitializes video writer.

The method opens video writer. Parameters are the same as in the constructor VideoWriter::VideoWriter.

Returns

true if video writer has been successfully initialized

The method first calls VideoWriter::release to close the already opened file.

Overloaded parameters
source

fn open_2( &mut self, filename: &str, api_preference: i32, fourcc: i32, fps: f64, frame_size: Size, params: &Vector<i32> ) -> Result<bool>

Initializes or reinitializes video writer.

The method opens video writer. Parameters are the same as in the constructor VideoWriter::VideoWriter.

Returns

true if video writer has been successfully initialized

The method first calls VideoWriter::release to close the already opened file.

Overloaded parameters
source

fn release(&mut self) -> Result<()>

Closes the video writer.

The method is automatically called by subsequent VideoWriter::open and by the VideoWriter destructor.

source

fn write(&mut self, image: &dyn ToInputArray) -> Result<()>

Writes the next video frame

Parameters
  • image: The written frame. In general, color images are expected in BGR format.

The function/method writes the specified image to video file. It must have the same size as has been specified when opening the video writer.

source

fn set(&mut self, prop_id: i32, value: f64) -> Result<bool>

Sets a property in the VideoWriter.

Parameters
  • propId: Property identifier from cv::VideoWriterProperties (eg. cv::VIDEOWRITER_PROP_QUALITY) or one of [videoio_flags_others]

  • value: Value of the property.

Returns

true if the property is supported by the backend used by the VideoWriter instance.

Implementors§