Commit 1186f306 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle

Try harder to find ffmpeg path if not defined

parent 7c121fdd
......@@ -30,6 +30,7 @@
#include "profiles/profilerepository.hpp"
#include "profilesdialog.h"
#include "project/dialogs/profilewidget.h"
#include "wizard.h"
#ifdef USE_V4L
#include "capture/v4lcapture.h"
......@@ -855,6 +856,15 @@ void KdenliveSettingsDialog::updateSettings()
}
KdenliveSettings::setDefault_profile(m_pw->selectedProfile());
if (m_configEnv.ffmpegurl->text().isEmpty()) {
QString infos;
QString warnings;
Wizard::slotCheckPrograms(infos, warnings);
m_configEnv.ffmpegurl->setText(KdenliveSettings::ffmpegpath());
m_configEnv.ffplayurl->setText(KdenliveSettings::ffplaypath());
m_configEnv.ffprobeurl->setText(KdenliveSettings::ffprobepath());
}
bool resetConsumer = false;
bool fullReset = false;
bool updateCapturePath = false;
......
......@@ -49,6 +49,7 @@
#include <QStandardPaths>
#include <QTemporaryFile>
#include <QTimer>
#include <QApplication>
#include <kio_version.h>
#include <QXmlStreamWriter>
......@@ -626,24 +627,24 @@ void Wizard::checkMissingCodecs()
}*/
}
void Wizard::slotCheckPrograms()
void Wizard::slotCheckPrograms(QString &infos, QString &warnings)
{
bool allIsOk = true;
// Check first in same folder as melt exec
const QStringList mltpath = QStringList() << QFileInfo(KdenliveSettings::rendererpath()).canonicalPath();
const QStringList mltpath({QFileInfo(KdenliveSettings::rendererpath()).canonicalPath(), qApp->applicationDirPath()});
QString exepath;
if (KdenliveSettings::ffmpegpath().isEmpty() || !QFileInfo::exists(KdenliveSettings::ffmpegpath())) {
exepath = QStandardPaths::findExecutable(QStringLiteral("ffmpeg%1").arg(FFMPEG_SUFFIX), mltpath);
exepath = QStandardPaths::findExecutable(QString("ffmpeg%1").arg(FFMPEG_SUFFIX), mltpath);
if (exepath.isEmpty()) {
exepath = QStandardPaths::findExecutable(QStringLiteral("ffmpeg%1").arg(FFMPEG_SUFFIX));
exepath = QStandardPaths::findExecutable(QString("ffmpeg%1").arg(FFMPEG_SUFFIX));
}
qDebug() << "Unable to find FFMpeg binary...";
qDebug() << "Found FFMpeg binary: "<<exepath;
if (exepath.isEmpty()) {
// Check for libav version
exepath = QStandardPaths::findExecutable(QStringLiteral("avconv"));
if (exepath.isEmpty()) {
m_warnings.append(i18n("<li>Missing app: <b>ffmpeg</b><br/>required for proxy clips and transcoding</li>"));
warnings.append(i18n("<li>Missing app: <b>ffmpeg</b><br/>required for proxy clips and transcoding</li>"));
allIsOk = false;
}
}
......@@ -658,7 +659,7 @@ void Wizard::slotCheckPrograms()
// Check for libav version
playpath = QStandardPaths::findExecutable(QStringLiteral("avplay"));
if (playpath.isEmpty()) {
m_infos.append(i18n("<li>Missing app: <b>ffplay</b><br/>recommended for some preview jobs</li>"));
infos.append(i18n("<li>Missing app: <b>ffplay</b><br/>recommended for some preview jobs</li>"));
}
}
}
......@@ -672,7 +673,7 @@ void Wizard::slotCheckPrograms()
// Check for libav version
probepath = QStandardPaths::findExecutable(QStringLiteral("avprobe"));
if (probepath.isEmpty()) {
m_infos.append(i18n("<li>Missing app: <b>ffprobe</b><br/>recommended for extra clip analysis</li>"));
infos.append(i18n("<li>Missing app: <b>ffprobe</b><br/>recommended for extra clip analysis</li>"));
}
}
}
......@@ -910,7 +911,7 @@ void Wizard::slotCheckMlt()
if (m_systemCheckIsOk) {
checkMltComponents();
}
slotCheckPrograms();
slotCheckPrograms(m_infos, m_warnings);
}
bool Wizard::isOk() const
......
......@@ -51,6 +51,7 @@ public:
void adjustSettings();
bool isOk() const;
static void testHwEncoders();
static void slotCheckPrograms(QString &infos, QString &warnings);
private:
Ui::WizardStandard_UI m_standard;
......@@ -69,7 +70,6 @@ private:
QMap<QString, QString> m_dvProfiles;
QMap<QString, QString> m_hdvProfiles;
QMap<QString, QString> m_otherProfiles;
void slotCheckPrograms();
void checkMltComponents();
void checkMissingCodecs();
void updateHwStatus();
......
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