Video reader interface.
More...
#include <opencv2/cudacodec.hpp>
Video reader interface.
- Note
- An example on how to use the videoReader class can be found at opencv_source_code/samples/gpu/video_reader.cpp
◆ ~VideoReader()
virtual cv::cudacodec::VideoReader::~VideoReader |
( |
| ) |
|
|
inlinevirtual |
◆ format()
virtual FormatInfo cv::cudacodec::VideoReader::format |
( |
| ) |
const |
|
pure virtual |
Returns information about video file format.
◆ get()
virtual int cv::cudacodec::VideoReader::get |
( |
const VideoReaderProps |
property, |
|
|
const int |
propertyVal = -1 |
|
) |
| const |
|
pure virtual |
Returns the specified VideoReader property.
- Parameters
-
property | Property identifier from cv::cudacodec::VideoReaderProps (eg. cv::cudacodec::PROP_DECODED_FRAME_IDX, cv::cudacodec::PROP_EXTRA_DATA_INDEX, ...) |
propertyVal | Optional value for the property. |
- Returns
- Value for the specified property. Value -1 is returned when querying a property that is not supported.
◆ grab()
Grabs the next frame from the video source.
- 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.
◆ nextFrame()
Grabs, decodes and returns the next video frame.
If no frames has been grabbed (there are no more frames in video file), the methods return false . The method throws Exception if error occurs.
◆ retrieve()
Returns previously grabbed video data.
- Parameters
-
[out] | frame | The returned data which depends on the provided idx. If there is no new data since the last call to grab() the image will be empty. |
| idx | Determins the returned data inside image. The returned data can be the: Decoded frame, idx = get(PROP_DECODED_FRAME_IDX). Extra data if available, idx = get(PROP_EXTRA_DATA_INDEX). Raw encoded data package. To retrieve package i, idx = get(PROP_RAW_PACKAGES_BASE_INDEX) + i with i < get(PROP_NUMBER_OF_RAW_PACKAGES_SINCE_LAST_GRAB) |
- Returns
false
if no frames has been grabbed
The method returns data associated with the current video source since the last call to grab() or the creation of the VideoReader. If no data is present the method returns false and the function returns an empty image.
◆ set()
virtual bool cv::cudacodec::VideoReader::set |
( |
const VideoReaderProps |
property, |
|
|
const double |
propertyVal |
|
) |
| |
|
pure virtual |
Sets a property in the VideoReader.
- Parameters
-
property | Property identifier from cv::cudacodec::VideoReaderProps (eg. cv::cudacodec::PROP_DECODED_FRAME_IDX, cv::cudacodec::PROP_EXTRA_DATA_INDEX, ...) |
propertyVal | Value of the property. |
- Returns
true
if the property has been set.
The documentation for this class was generated from the following file: