void FfmpegExporter::processError(QProcess::ProcessError error) { qWarning() << "Ffmpeg error:" << error; switch(error) { case QProcess::FailedToStart: emit exporterError(tr("Couldn't start ffmpeg!")); break; case QProcess::Crashed: emit exporterError(tr("Ffmpeg crashed!")); break; default: emit exporterError(tr("Ffmpeg process error")); break; } }
void PlaybackController::startVideoExport(VideoExporter *exporter) { Q_ASSERT(!m_exporter); Q_ASSERT(exporter); m_exporter = exporter; m_exporter->setParent(this); m_exporterReady = false; m_waitedForExporter = false; connect(m_exporter, &VideoExporter::exporterReady, this, &PlaybackController::exporterReady, Qt::QueuedConnection); connect(m_exporter, SIGNAL(exporterError(QString)), this, SLOT(exporterError(QString)), Qt::QueuedConnection); connect(m_exporter, SIGNAL(exporterFinished()), this, SLOT(exporterFinished()), Qt::QueuedConnection); m_exporter->start(); emit exportStarted(); }
void ImageSeriesExporter::writeFrame(const QImage &image, int repeat) { for(int f=1;f<=repeat;++f) { QString filename = _filepattern; filename.replace(QLatin1Literal("{F}"), QString("%1").arg(frame() + f, 5, 10, QLatin1Char('0'))); filename.replace(QLatin1Literal("{E}"), _format); QString fullpath = QFileInfo(QDir(_path), filename).absoluteFilePath(); QImageWriter writer(fullpath, _format); if(!writer.write(image)) { emit exporterError(writer.errorString()); return; } } emit exporterReady(); }