Commit 10e9c86a authored by Boudewijn Rempt's avatar Boudewijn Rempt

Fix inconsistent frame numbering when calling FFMPEG

BUG: 389045
parent 8b611ec1
......@@ -104,7 +104,7 @@ void KisAsyncAnimationFramesSavingRenderer::frameCompletedCallback(int frame)
KisImportExportFilter::ConversionStatus status = KisImportExportFilter::OK;
for (int i = range.start(); i <= range.end(); i++) {
QString frameNumber = QString("%1").arg(i - m_d->range.start() + m_d->sequenceNumberingOffset, 4, 10, QChar('0'));
QString frameNumber = QString("%1").arg(i + m_d->sequenceNumberingOffset, 4, 10, QChar('0'));
QString filename = m_d->filenamePrefix + frameNumber + m_d->filenameSuffix;
if (!m_d->savingDoc->exportDocumentSync(QUrl::fromLocalFile(filename), m_d->outputMimeType, m_d->exportConfiguration)) {
......
......@@ -66,7 +66,7 @@ int calculateNumberMemoryAllowedClones(KisImageSP image)
const qint64 allowedMemory = 0.8 * stats.tilesHardLimit - stats.realMemorySize;
const qint64 cloneSize = stats.projectionsSize;
return allowedMemory > 0 ? allowedMemory / cloneSize : 0;
return cloneSize > 0 ? allowedMemory / cloneSize : 0;
}
}
......
......@@ -235,7 +235,11 @@ KisImageBuilder_Result VideoSaver::encode(const QString &filename, KisProperties
const KisTimeRange fullRange = animation->fullClipRange();
const int frameRate = configuration->getInt("framerate", animation->framerate());
const KisTimeRange clipRange(configuration->getInt("first_frame", fullRange.start()), configuration->getInt("last_frame", fullRange.end()));
const int sequenceNumberingOffset = configuration->getInt("sequence_start", 0);
const KisTimeRange clipRange(sequenceNumberingOffset + configuration->getInt("first_frame", fullRange.start()),
sequenceNumberingOffset + configuration->getInt("last_frame", fullRange.end())
);
const bool includeAudio = configuration->getBool("include_audio", true);
const int exportHeight = configuration->getInt("height", int(m_image->height()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment