Commit 5167fb1b authored by Dmitry Kazakov's avatar Dmitry Kazakov

Don't use '-pattern_type glob' for ffmpeg stream input

'glob' option is not available on Windows in normal ffmpeg builds.
Therefore, we should use '-start_number' instead.

Fixes T5228
parent 2459d14e
......@@ -374,5 +374,5 @@ KisImportExportFilter::ConversionStatus KisAnimationExportSaver::saveFrameCallba
QString KisAnimationExportSaver::savedFilesMask() const
{
return m_d->filenamePrefix + "????" + m_d->filenameSuffix;
return m_d->filenamePrefix + "%04d" + m_d->filenameSuffix;
}
......@@ -253,7 +253,7 @@ KisImageBuilder_Result VideoSaver::encode(const QString &filename, KisProperties
{
QStringList args;
args << "-r" << QString::number(frameRate)
<< "-pattern_type" << "glob"
<< "-start_number" << QString::number(clipRange.start())
<< "-i" << savedFilesMask
<< "-vf" << "palettegen"
<< "-y" << palettePath;
......@@ -261,7 +261,7 @@ KisImageBuilder_Result VideoSaver::encode(const QString &filename, KisProperties
KisImageBuilder_Result result =
m_runner->runFFMpeg(args, i18n("Fetching palette..."),
framesDir.filePath("log_generate_palette_gif.log"),
clipRange.duration() + clipRange.start());
clipRange.duration());
if (result != KisImageBuilder_RESULT_OK) {
return result;
......@@ -271,19 +271,19 @@ KisImageBuilder_Result VideoSaver::encode(const QString &filename, KisProperties
{
QStringList args;
args << "-r" << QString::number(frameRate)
<< "-pattern_type" << "glob"
<< "-start_number" << QString::number(clipRange.start())
<< "-i" << savedFilesMask
<< "-i" << palettePath
<< "-lavfi" << "[0:v][1:v] paletteuse"
<< additionalOptionsList
<< "-y" << resultFile;
dbgFile << "savedFilesMask" << savedFilesMask << "start" << clipRange.start() << "duration" << clipRange.duration();
dbgFile << "savedFilesMask" << savedFilesMask << "start" << QString::number(clipRange.start()) << "duration" << clipRange.duration();
KisImageBuilder_Result result =
m_runner->runFFMpeg(args, i18n("Encoding frames..."),
framesDir.filePath("log_encode_gif.log"),
clipRange.duration() + clipRange.start());
clipRange.duration());
if (result != KisImageBuilder_RESULT_OK) {
return result;
......@@ -291,9 +291,9 @@ KisImageBuilder_Result VideoSaver::encode(const QString &filename, KisProperties
}
} else {
QStringList args;
args << "-r" << QString::number(frameRate);
args << "-pattern_type" << "glob";
args << "-i" << savedFilesMask;
args << "-r" << QString::number(frameRate)
<< "-start_number" << QString::number(clipRange.start())
<< "-i" << savedFilesMask;
QFileInfo audioFileInfo = animation->audioChannelFileName();
......@@ -316,7 +316,7 @@ KisImageBuilder_Result VideoSaver::encode(const QString &filename, KisProperties
result = m_runner->runFFMpeg(args, i18n("Encoding frames..."),
framesDir.filePath("log_encode.log"),
clipRange.duration() + clipRange.start());
clipRange.duration());
}
return result;
......
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