iVS3D v2.0.0
Loading...
Searching...
No Matches
VideoReader Class Reference

The VideoReader class is used to import video files and implement the Reader interface. It utilizes the FFMPEG libaries to enable frame perfect random access inside a video stream. More...

#include <videoreader.h>

Inheritance diagram for VideoReader:
Reader

Public Member Functions

 VideoReader (const QString &path, std::shared_ptr< ReaderParams > readerParams)
 VideoReader constructor which reads the given file and creates cv::VideoCapture from it.
 
 ~VideoReader ()
 VideoReader destructor.
 
cv::Mat getPic (unsigned int index, PictureProcessingFlags flags=APPLY_ALL) override
 Returns the frame to a given index.
 
unsigned int getPicCount () override
 Returns the number of frame.
 
QString getInputPath () override
 Returns the input path.
 
double getFPS () override
 Returns the video FPS.
 
double getVideoDuration () override
 Returns the video duration.
 
bool isDir () override
 Returns wether the input is a direcory or not.
 
VideoReadercopy (std::shared_ptr< ReaderParams > params) override
 Creates this reader again and returns it.
 
std::vector< std::string > getFileVector () override
 Returns a empty vector.
 
SequentialReadercreateSequentialReader (std::vector< uint > indices, PictureProcessingFlags flags=APPLY_ALL) override
 createSequentialReader Creates a SequentialReader object for the given indices. This can be used to access images concurrently if the images are known a priori.
 
void addMetaData (MetaData *md) override
 addMetaData Used to add MetaData to the reader
 
MetaDatagetMetaData () override
 getMetaData Returns the currently saved MetaData
 
bool isValid () override
 isValid Retruns wether the reader is valid or not
 
- Public Member Functions inherited from Reader
virtual void enableMultithreading ()
 enableMultithreading This method has to be called once in the plugins to use the reader while multithreading
 

Detailed Description

The VideoReader class is used to import video files and implement the Reader interface. It utilizes the FFMPEG libaries to enable frame perfect random access inside a video stream.

Author
Dominic Zahn
Date
2025/08/01

Constructor & Destructor Documentation

◆ VideoReader()

VideoReader::VideoReader ( const QString &  path,
std::shared_ptr< ReaderParams readerParams 
)
explicit

VideoReader constructor which reads the given file and creates cv::VideoCapture from it.

Parameters
pathPath to the video. Video can be the types, which cv::VideoCapture can handle

Member Function Documentation

◆ addMetaData()

void VideoReader::addMetaData ( MetaData md)
overridevirtual

addMetaData Used to add MetaData to the reader

Parameters
mdThe MetaData to be saved

Implements Reader.

◆ copy()

VideoReader * VideoReader::copy ( std::shared_ptr< ReaderParams params)
overridevirtual

Creates this reader again and returns it.

Returns
New instance of this reader

Implements Reader.

◆ createSequentialReader()

SequentialReader * VideoReader::createSequentialReader ( std::vector< uint >  indices,
PictureProcessingFlags  flags = APPLY_ALL 
)
overridevirtual

createSequentialReader Creates a SequentialReader object for the given indices. This can be used to access images concurrently if the images are known a priori.

Parameters
indicesThe indices of the images that will be accessed
Returns
SequentialReader instance (caller takes ownership!)

Implements Reader.

◆ getFileVector()

std::vector< std::string > VideoReader::getFileVector ( )
overridevirtual

Returns a empty vector.

Returns
empty vector

Implements Reader.

◆ getFPS()

double VideoReader::getFPS ( )
overridevirtual

Returns the video FPS.

Returns
double with the FPS, -1 if input isn't a video

Implements Reader.

◆ getInputPath()

QString VideoReader::getInputPath ( )
overridevirtual

Returns the input path.

Returns
Qstring with the input path

Implements Reader.

◆ getMetaData()

MetaData * VideoReader::getMetaData ( )
overridevirtual

getMetaData Returns the currently saved MetaData

Returns
The currently saved MetaData

Implements Reader.

◆ getPic()

cv::Mat VideoReader::getPic ( unsigned int  index,
PictureProcessingFlags  flags = APPLY_ALL 
)
overridevirtual

Returns the frame to a given index.

Parameters
indexIndex of the frame to be returned
Returns
cv::Mat of the selected frame

Implements Reader.

◆ getPicCount()

unsigned int VideoReader::getPicCount ( )
overridevirtual

Returns the number of frame.

Returns
Number of frame

Implements Reader.

◆ getVideoDuration()

double VideoReader::getVideoDuration ( )
overridevirtual

Returns the video duration.

Returns
double with the video duration, -1 if input isn't a video

Implements Reader.

◆ isDir()

bool VideoReader::isDir ( )
overridevirtual

Returns wether the input is a direcory or not.

Returns
true if the input is based on a directory, false otherwise

Implements Reader.

◆ isValid()

bool VideoReader::isValid ( )
overridevirtual

isValid Retruns wether the reader is valid or not

Returns
true if the reader is valid, false otherwise

Implements Reader.


The documentation for this class was generated from the following files: