![]() |
OpenCV
Open Source Computer Vision
|
Video reader interface, see createVideoReader(). More...
#include <opencv2/cudacodec.hpp>
Public Member Functions | |
virtual | ~VideoReader () |
virtual FormatInfo | format () const =0 |
Returns information about video file format. | |
virtual bool | get (const int propertyId, double &propertyVal) const =0 |
Retrieves the specified property used by the VideoSource. | |
virtual bool | get (const VideoReaderProps propertyId, double &propertyVal) const =0 |
Returns the specified VideoReader property. | |
virtual bool | getVideoReaderProps (const VideoReaderProps propertyId, double &propertyValOut, double propertyValIn=0) const =0 |
virtual bool | grab (cuda::Stream &stream=cuda::Stream::Null())=0 |
Grabs the next frame from the video source. | |
virtual bool | nextFrame (cuda::GpuMat &frame, cuda::GpuMat &histogram, cuda::Stream &stream=cuda::Stream::Null())=0 |
Grabs, decodes and returns the next video frame and frame luma histogram. | |
virtual bool | nextFrame (cuda::GpuMat &frame, cuda::Stream &stream=cuda::Stream::Null())=0 |
Grabs, decodes and returns the next video frame. | |
bool | retrieve (cuda::GpuMat &frame) const |
Returns the next video frame. | |
bool | retrieve (Mat &frame, const size_t idx) const |
Returns previously grabbed encoded video data. | |
virtual bool | retrieve (OutputArray frame, const size_t idx=static_cast< size_t >(VideoReaderProps::PROP_DECODED_FRAME_IDX)) const =0 |
Returns previously grabbed video data. | |
virtual bool | set (const ColorFormat colorFormat, const BitDepth bitDepth=BitDepth::UNCHANGED, const bool planar=false)=0 |
Set the desired ColorFormat for the frame returned by nextFrame()/retrieve(). | |
virtual bool | set (const VideoReaderProps propertyId, const double propertyVal)=0 |
Sets a property in the VideoReader. | |
bool | setVideoReaderProps (const VideoReaderProps propertyId, double propertyVal) |
Video reader interface, see createVideoReader().
Available if Nvidia's Video Codec SDK is installed.
Decoding support is dependent on the GPU, refer to the Nvidia Video Codec SDK Video Encode and Decode GPU Support Matrix for details.
|
inlinevirtual |
|
pure virtual |
Returns information about video file format.
|
pure virtual |
Retrieves the specified property used by the VideoSource.
propertyId | Property identifier from cv::VideoCaptureProperties (eg. cv::CAP_PROP_POS_MSEC, cv::CAP_PROP_POS_FRAMES, ...) or one from Additional flags for video I/O API backends. |
propertyVal | Value for the specified property. |
true
unless the property is unset set or not supported.
|
pure virtual |
Returns the specified VideoReader property.
propertyId | Property identifier from cv::cudacodec::VideoReaderProps (eg. cv::cudacodec::VideoReaderProps::PROP_DECODED_FRAME_IDX, cv::cudacodec::VideoReaderProps::PROP_EXTRA_DATA_INDEX, ...). |
propertyVal |
|
true
unless the property is not supported.
|
pure virtual |
|
pure virtual |
Grabs the next frame from the video source.
stream | Stream for the asynchronous version. |
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.
|
pure virtual |
Grabs, decodes and returns the next video frame and frame luma histogram.
[out] | frame | The video frame. |
[out] | histogram | Histogram of the luma component of the encoded frame, see note. |
stream | Stream for the asynchronous version. |
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.
|
pure virtual |
Grabs, decodes and returns the next video frame.
[out] | frame | The video frame. |
stream | Stream for the asynchronous version. |
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.
|
inline |
Returns the next video frame.
[out] | frame | The video frame. If grab() has not been called then this will be empty(). |
false
if no frames have been grabbedThe method returns data associated with the current video source since the last call to grab(). If no data is present the method returns false and the function returns an empty image.
|
inline |
Returns previously grabbed encoded video data.
[out] | frame | The encoded video data. |
idx | Determines the returned data inside image. The returned data can be the:
|
false
if no frames have been grabbedThe 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.
|
pure virtual |
Returns previously grabbed video data.
[out] | frame | The returned data which depends on the provided idx. |
idx | Determines the returned data inside image. The returned data can be the:
|
false
if no frames have been grabbedThe 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.
|
pure virtual |
Set the desired ColorFormat for the frame returned by nextFrame()/retrieve().
colorFormat | Value of the ColorFormat. |
bitDepth | Requested bit depth of the frame. |
planar | Set to true for planar and false for packed color format. |
true
unless the colorFormat is not supported.
|
pure virtual |
Sets a property in the VideoReader.
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. |
true
if the property has been set.
|
inline |