15#ifndef QGSVIDEOEXPORTER_H
16#define QGSVIDEOEXPORTER_H
24#include <QtMultimedia/QMediaFormat>
25#include <QtMultimedia/QMediaRecorder>
28class QMediaCaptureSession;
29class QVideoFrameInput;
95 QSize
size()
const {
return mSize; }
106 void setInputFiles(
const QStringList &files );
119 void setInputFilesByPattern(
const QString &directory,
const QString &pattern );
126 QStringList inputFiles()
const;
137 void setFileFormat( QMediaFormat::FileFormat format );
144 QMediaFormat::FileFormat fileFormat()
const;
154 void setVideoCodec( QMediaFormat::VideoCodec codec );
161 QMediaFormat::VideoCodec videoCodec()
const;
168 QMediaRecorder::Error error()
const;
181 void setFileFormat( QMediaFormat::FileFormat format );
188 QMediaFormat::FileFormat fileFormat()
const;
198 void setVideoCodec( QMediaFormat::VideoCodec codec );
205 QMediaFormat::VideoCodec videoCodec()
const;
212 QMediaRecorder::Error error()
const;
220 QString errorString()
const;
243 void checkStatus( QMediaRecorder::RecorderState state );
244 void handleError( QMediaRecorder::Error
error, const QString &
errorString );
250 QStringList mInputFiles;
251 double mFramesPerSecond = 10;
252 qint64 mFrameDurationUs = 100000;
253 QMediaFormat::FileFormat mFormat = QMediaFormat::FileFormat::MPEG4;
254 QMediaFormat::VideoCodec mCodec = QMediaFormat::VideoCodec::H264;
255 QMediaRecorder::Error mError = QMediaRecorder::Error::NoError;
256 int mCurrentFrameIndex = 0;
259 QString mErrorString;
261 std::unique_ptr< QMediaCaptureSession > mSession;
262 std::unique_ptr< QMediaRecorder > mRecorder;
263 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,...)