Fix proxy decoding path and add proxy generation diagnostics

- RenderWorkerPool::DecodeInputFrame now uses the proxy filename/decoder/stream
  from FootageJob when a proxy is attached, so generated proxies are actually
  used during render.
- Add qDebug/qWarning logging to TimelineWidget::GenerateProxiesForSelectedClips
  and ProxyTask::Run to diagnose why Generate Proxy appears to do nothing.
This commit is contained in:
2026-07-13 10:19:30 +08:00
parent e52570c89f
commit 94250a7690
3 changed files with 54 additions and 23 deletions
+33 -19
View File
@@ -1,20 +1,22 @@
/*
* Oak Video Editor - Non-Linear Video Editor
* Copyright (C) 2026 Oak Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/***
Oak - Non-Linear Video Editor
Copyright (C) 2026 Oak Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
***/
#include "proxy.h"
@@ -45,21 +47,27 @@ bool ProxyTask::Run()
const QString ffmpeg = QStandardPaths::findExecutable(QStringLiteral("ffmpeg"));
if (ffmpeg.isEmpty()) {
SetError(tr("Failed to generate proxy: ffmpeg executable was not found"));
qWarning() << "ProxyTask: ffmpeg executable not found";
return false;
}
QDir output_dir = QFileInfo(output_filename_).dir();
if (!output_dir.exists() && !output_dir.mkpath(QStringLiteral("."))) {
SetError(tr("Failed to create proxy output directory"));
qWarning() << "ProxyTask: failed to create output directory"
<< output_dir.absolutePath();
return false;
}
qDebug() << "ProxyTask: starting ffmpeg proxy generation:"
<< source_filename_ << "->" << output_filename_;
QFile::remove(output_filename_);
const QString scale_filter = QStringLiteral(
"scale=w=%1:h=%2:force_original_aspect_ratio=decrease")
.arg(QString::number(params_.width),
QString::number(params_.height));
.arg(QString::number(params_.width),
QString::number(params_.height));
QStringList args;
args << QStringLiteral("-y")
@@ -82,6 +90,7 @@ bool ProxyTask::Run()
if (!process.waitForStarted()) {
SetError(tr("Failed to start ffmpeg for proxy generation"));
qWarning() << "ProxyTask: failed to start ffmpeg" << process.errorString();
return false;
}
@@ -99,14 +108,19 @@ bool ProxyTask::Run()
const QString output = QString::fromUtf8(process.readAll()).trimmed();
QFile::remove(output_filename_);
SetError(tr("ffmpeg failed to generate proxy: %1").arg(output));
qWarning() << "ProxyTask: ffmpeg failed with exit code" << process.exitCode()
<< "output:" << output;
return false;
}
if (!QFileInfo::exists(output_filename_)) {
SetError(tr("ffmpeg finished but proxy file was not created"));
qWarning() << "ProxyTask: ffmpeg finished but output file missing"
<< output_filename_;
return false;
}
qDebug() << "ProxyTask: proxy generation succeeded:" << output_filename_;
emit ProgressChanged(1.0);
return true;
}