![]() |
University of Murcia, Spain ![]() |
QVVideoRecorder Class ReferenceVideo source class for reading many video file formats, webcams and digital cameras.
More...
|
Public Member Functions | |
bool | linkProperty (QVWorker &worker, const QString rgbImageName) |
bool | linkProperty (QVWorker &worker, const QString yImageName, const QString uImageName, const QString vImageName) |
void | iterate () |
Function to be defined in subclasses with processing code. |
This worker can be linked to a worker object producing an output image, to store the flow of images in a video file in the uncompressed YUV4MPEG2 format.
To use it, create a QVVideoRecorder object in the main function, and link a RGB image from a worker, to store each output image from the worker in a video file.
int main(int argc, char *argv[]) { [...] // The following worker should have a property named 'Output image' containing an RGB image. MyWorker myWorker("My worker"); [...] QVVideoRecorder recorder("Video recorder"); recorder.linkProperty(player, "Output image"); [...] }
Alternatively you can link three properties containing the Y, U and V channels of a YUV image respectively to store images in the video file directly in that format:
int main(int argc, char *argv[]) { [...] // The following worker should have three properties named 'Output image Y', 'Output image U' and // 'Output image V' representing the three channels of a YUV image. MyWorker myWorker("My worker"); [...] QVVideoRecorder recorder("Video recorder"); recorder.linkProperty(player, "Output image Y", "Output image U", "Output image V"); [...] }
You can tune the number of frames per second and the name of the file to store the video using functions setFPS and setVideoFileName respectively, or through the user command line, setting values for the properties FPS and Record file name in the video record object.
Once the object reads the first image frame changing those values will have no effect.
Definition at line 74 of file qvvideorecorder.h.
bool QVVideoRecorder::linkProperty | ( | QVWorker & | worker, | |
const QString | rgbImageName | |||
) |
bool QVVideoRecorder::linkProperty | ( | QVWorker & | worker, | |
const QString | yImageName, | |||
const QString | uImageName, | |||
const QString | vImageName | |||
) |
void QVVideoRecorder::iterate | ( | ) | [virtual] |
Function to be defined in subclasses with processing code.
This function should contain the code to process data, that will be executed continuously until worker is finished.
Reimplemented from QVWorker.
Definition at line 60 of file qvvideorecorder.cpp.