pub trait VideoReader: VideoReaderConst {
    fn as_raw_mut_VideoReader(&mut self) -> *mut c_void;

    fn next_frame(
        &mut self,
        frame: &mut GpuMat,
        stream: &mut Stream
    ) -> Result<bool> { ... } fn grab(&mut self, stream: &mut Stream) -> Result<bool> { ... } fn set(
        &mut self,
        property_id: VideoReaderProps,
        property_val: f64
    ) -> Result<bool> { ... } fn set_video_reader_props(
        &mut self,
        property_id: VideoReaderProps,
        property_val: f64
    ) -> Result<bool> { ... } fn set_1(&mut self, color_format: ColorFormat) -> Result<()> { ... } }

Required Methods

Provided Methods

Grabs, decodes and returns the next video frame.

Parameters
  • frame:[out] The video frame.
  • stream: Stream for the asynchronous version.
Returns

false if no frames have been grabbed.

If no frames have been grabbed (there are no more frames in video file), the methods return false. The method throws an Exception if error occurs.

C++ default parameters
  • stream: Stream::Null()

Grabs the next frame from the video source.

Parameters
  • stream: Stream for the asynchronous version.
Returns

true (non-zero) in the case of success.

The method/function grabs the next frame from video file or camera and returns true (non-zero) in the case of success.

The primary use of the function is for reading both the encoded and decoded video data when rawMode is enabled. With rawMode enabled retrieve() can be called following grab() to retrieve all the data associated with the current video source since the last call to grab() or the creation of the VideoReader.

C++ default parameters
  • stream: Stream::Null()

Sets a property in the VideoReader.

Parameters
  • propertyId: Property identifier from cv::cudacodec::VideoReaderProps (eg. cv::cudacodec::VideoReaderProps::PROP_DECODED_FRAME_IDX, cv::cudacodec::VideoReaderProps::PROP_EXTRA_DATA_INDEX, …).
  • propertyVal: Value of the property.
Returns

true if the property has been set.

Set the desired ColorFormat for the frame returned by nextFrame()/retrieve().

Parameters
  • colorFormat: Value of the ColorFormat.

Implementors