@Name(value="cv::cudacodec::VideoReader") @Properties(inherit=opencv_cudacodec.class) public class VideoReader extends Pointer
\note - An example on how to use the videoReader class can be found at opencv_source_code/samples/gpu/video_reader.cpp
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter| Constructor and Description |
|---|
VideoReader(Pointer p)
Pointer cast constructor.
|
| Modifier and Type | Method and Description |
|---|---|
FormatInfo |
format()
\brief Returns information about video file format.
|
int |
get(int property) |
int |
get(int property,
int propertyVal)
\brief Returns the specified VideoReader property
|
boolean |
grab() |
boolean |
grab(Stream stream)
\brief Grabs the next frame from the video source.
|
boolean |
nextFrame(GpuMat frame) |
boolean |
nextFrame(GpuMat frame,
Stream stream)
\brief Grabs, decodes and returns the next video frame.
|
boolean |
retrieve(GpuMat frame) |
boolean |
retrieve(GpuMat frame,
long idx) |
boolean |
retrieve(Mat frame) |
boolean |
retrieve(Mat frame,
long idx)
\brief Returns previously grabbed video data.
|
boolean |
retrieve(UMat frame) |
boolean |
retrieve(UMat frame,
long idx) |
boolean |
set(int property,
double propertyVal)
\brief Sets a property in the VideoReader.
|
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getPointer, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zeropublic VideoReader(Pointer p)
Pointer(Pointer).@Cast(value="bool") public boolean nextFrame(@ByRef GpuMat frame, @ByRef(nullValue="cv::cuda::Stream::Null()") Stream stream)
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.
@ByVal public FormatInfo format()
@Cast(value="bool") public boolean grab(@ByRef(nullValue="cv::cuda::Stream::Null()") Stream stream)
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.
@Cast(value="bool") public boolean retrieve(@ByVal Mat frame, @Cast(value="const size_t") long idx)
frame - [out] 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)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.
@Cast(value="bool") public boolean retrieve(@ByVal UMat frame, @Cast(value="const size_t") long idx)
@Cast(value="bool") public boolean retrieve(@ByVal GpuMat frame, @Cast(value="const size_t") long idx)
@Cast(value="bool") public boolean set(@Cast(value="const cv::cudacodec::VideoReaderProps") int property, double propertyVal)
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.true if the property has been set.public int get(@Cast(value="const cv::cudacodec::VideoReaderProps") int property, int propertyVal)
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.Copyright © 2022. All rights reserved.