Commit 5d121549 authored by Julius Künzel's avatar Julius Künzel
Browse files

Show warnings if avfilter, especially avfilter.subtitles was not found

Also add it as dependency for mlt to the dev-docs build instructions
parent cb7c5bcc
Pipeline #124106 passed with stage
in 6 minutes and 34 seconds
......@@ -86,7 +86,7 @@ And if you want to build MLT manually:
git clone https://github.com/mltframework/mlt.git
# Install MLT dependencies
sudo apt install libxml++2.6-dev libavformat-dev libswscale-dev libavutil-dev librtaudio-dev
sudo apt install libxml++2.6-dev libavformat-dev libswscale-dev libavfilter-dev libavutil-dev libsdl1.2-dev librtaudio-dev
```
#### Build and install the projects
......
......@@ -404,21 +404,59 @@ void Wizard::checkMltComponents()
// Check that we have the frei0r effects installed
Mlt::Properties *filters = pCore->getMltRepository()->filters();
bool hasFrei0r = false;
QString filterName;
for (int i = 0; i < filters->count(); ++i) {
filterName = filters->get_name(i);
QString filterName = filters->get_name(i);
if (filterName.startsWith(QStringLiteral("frei0r."))) {
hasFrei0r = true;
break;
}
}
delete filters;
if (!hasFrei0r) {
// Frei0r effects not found
qDebug() << "Missing Frei0r module";
m_warnings.append(
i18n("<li>Missing package: <b>Frei0r</b> effects (frei0r-plugins)<br/>provides many effects and transitions. Install recommended</li>"));
}
if (!hasFrei0r) {
// Frei0r effects not found
qDebug() << "Missing Frei0r module";
m_warnings.append(
i18n("<li>Missing package: <b>Frei0r</b> effects (frei0r-plugins)<br/>provides many effects and transitions. Install recommended</li>"));
}
// Check that we have the avfilter effects installed
bool hasAvfilter = false;
for (int i = 0; i < filters->count(); ++i) {
QString filterName = filters->get_name(i);
if (filterName.startsWith(QStringLiteral("avfilter."))) {
hasAvfilter = true;
break;
}
}
if (!hasAvfilter) {
// Frei0r effects not found
qDebug() << "Missing AVFilter module";
m_warnings.append(
i18n("<li>Missing package: <b>AVFilter</b><br/>provides many effects. Install recommended</li>"));
} else {
// Check that we have the avfilter.subtitles effects installed
bool hasSubtitle = false;
for (int i = 0; i < filters->count(); ++i) {
QString filterName = filters->get_name(i);
if (filterName == QStringLiteral("avfilter.subtitles")) {
hasSubtitle = true;
break;
}
}
if (!hasAvfilter) {
// Frei0r effects not found
qDebug() << "Missing avfilter.subtitles module";
m_warnings.append(
i18n("<li>Missing filter: <b>avfilter.subtitles</b><br/>required for subtitle feature. Install recommended</li>"));
}
}
delete filters;
#if(!(defined(Q_OS_WIN)||defined(Q_OS_MAC)))
// Check that we have the breeze icon theme installed
......
......@@ -428,6 +428,7 @@ Rectangle {
property bool paletteUnchanged: true
property int maxLabelWidth: 20 * root.baseUnit * Math.sqrt(root.timeScale)
property bool showSubtitles: false
property bool subtitlesWarning: timeline.subtitlesWarning
property bool subtitlesLocked: timeline.subtitlesLocked
property bool subtitlesDisabled: timeline.subtitlesDisabled
property int trackTagWidth: fontMetrics.boundingRect("M").width * ((getAudioTracksCount() > 9) || (trackHeaderRepeater.count - getAudioTracksCount() > 9) ? 3 : 2)
......@@ -944,6 +945,37 @@ Rectangle {
width: childrenRect.width
x: Math.max(2 * root.collapsedHeight + 2, parent.width - width - 4)
spacing: 0
ToolButton {
id: warningButton
visible: subtitlesWarning
focusPolicy: Qt.NoFocus
contentItem: Item {
Image {
source: "image://icon/data-warning"
anchors.centerIn: parent
width: root.collapsedHeight - 4
height: root.collapsedHeight - 4
cache: root.paletteUnchanged
}
}
width: root.collapsedHeight
height: root.collapsedHeight
onClicked: timeline.subtitlesWarningDetails()
ToolTip {
visible: warningButton.hovered
font: miniFont
delay: 1500
timeout: 5000
background: Rectangle {
color: activePalette.alternateBase
border.color: activePalette.light
}
contentItem: Label {
color: activePalette.text
text: i18n("Click to see details")
}
}
}
ToolButton {
id: analyseButton
focusPolicy: Qt.NoFocus
......
......@@ -4806,6 +4806,18 @@ void TimelineController::subtitleSpeechRecognition()
d.exec();
}
bool TimelineController::subtitlesWarning() const
{
return !EffectsRepository::get()->hasInternalEffect("avfilter.subtitles");
}
void TimelineController::subtitlesWarningDetails()
{
KMessageBox::error(nullptr, i18n("The avfilter.subtitles filter is required, but was not found."
" The subtitles feature will probably not work as expected."));
emit regainFocus();
}
void TimelineController::deleteSubtitle(int startframe, int endframe, const QString &text)
{
auto subtitleModel = pCore->getSubtitleModel();
......
......@@ -71,6 +71,7 @@ class TimelineController : public QObject
Q_PROPERTY(QColor lockedColor READ lockedColor NOTIFY colorsChanged)
Q_PROPERTY(QColor selectionColor READ selectionColor NOTIFY colorsChanged)
Q_PROPERTY(QColor groupColor READ groupColor NOTIFY colorsChanged)
Q_PROPERTY(bool subtitlesWarning READ subtitlesWarning)
Q_PROPERTY(bool subtitlesDisabled READ subtitlesDisabled NOTIFY subtitlesDisabledChanged)
Q_PROPERTY(bool subtitlesLocked READ subtitlesLocked NOTIFY subtitlesLockedChanged)
Q_PROPERTY(bool guidesLocked READ guidesLocked NOTIFY guidesLockedChanged)
......@@ -177,6 +178,9 @@ public:
Q_INVOKABLE void showToolTip(const QString &info = QString()) const;
Q_INVOKABLE void showKeyBinding(const QString &info = QString()) const;
Q_INVOKABLE void showTimelineToolInfo(bool show) const;
/** @brief Returns true if the avfilter.subtiles filter is not found */
bool subtitlesWarning() const;
Q_INVOKABLE void subtitlesWarningDetails();
void switchSubtitleDisable();
bool subtitlesDisabled() const;
void switchSubtitleLock();
......
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