15#ifndef QGSVIDEOEXPORTER_H
16#define QGSVIDEOEXPORTER_H
24#include <QtMultimedia/QMediaFormat>
25#include <QtMultimedia/QMediaRecorder>
28class QMediaCaptureSession;
29class QVideoFrameInput;
94 QSize
size()
const {
return mSize; }
105 void setInputFiles(
const QStringList &files );
118 void setInputFilesByPattern(
const QString &directory,
const QString &pattern );
125 QStringList inputFiles()
const;
136 void setFileFormat( QMediaFormat::FileFormat format );
143 QMediaFormat::FileFormat fileFormat()
const;
153 void setVideoCodec( QMediaFormat::VideoCodec codec );
160 QMediaFormat::VideoCodec videoCodec()
const;
167 QMediaRecorder::Error error()
const;
180 void setFileFormat( QMediaFormat::FileFormat format );
187 QMediaFormat::FileFormat fileFormat()
const;
197 void setVideoCodec( QMediaFormat::VideoCodec codec );
204 QMediaFormat::VideoCodec videoCodec()
const;
211 QMediaRecorder::Error error()
const;
219 QString errorString()
const;
242 void checkStatus( QMediaRecorder::RecorderState state );
243 void handleError( QMediaRecorder::Error
error, const QString &
errorString );
248 QStringList mInputFiles;
249 double mFramesPerSecond = 10;
250 qint64 mFrameDurationUs = 100000;
251 QMediaFormat::FileFormat mFormat = QMediaFormat::FileFormat::MPEG4;
252 QMediaFormat::VideoCodec mCodec = QMediaFormat::VideoCodec::H264;
253 QMediaRecorder::Error mError = QMediaRecorder::Error::NoError;
254 int mCurrentFrameIndex = 0;
257 QString mErrorString;
259 std::unique_ptr< QMediaCaptureSession > mSession;
260 std::unique_ptr< QMediaRecorder > mRecorder;
261 std::unique_ptr< QVideoFrameInput > mVideoInput;
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Custom exception class which is raised when an operation is not supported.
void finished()
Emitted when the video export finishes.
QMediaRecorder::Error error() const
Returns the last error received while writing the video.
qint64 frameDuration() const
Returns the duration of each frame, in micro-seconds.
QString errorString() const
Returns the string describing the last error received while writing the video.
QgsVideoExporter(const QString &filename, QSize size, double framesPerSecond)
Constructor for QgsVideoExporter.
double framesPerSecond() const
Returns the output video frames per second.
static bool isAvailable()
Returns true if the video export functionality is available on the current system.
void setFeedback(QgsFeedback *feedback)
Sets an optional feedback object, for progress reports and cancellation support.
QSize size() const
Returns the output video frame size.
QgsFeedback * feedback()
Returns the optional feedback object.
#define SIP_THROW(name,...)