if (exepath.isEmpty()) video_frame->setPixmap(mergeSideBySide(KIcon("dialog-warning").pixmap(QSize(50, 50)), i18n("ffmpeg or avconv not found,\n please install it for screen grabs")));
else KdenliveSettings::setFfmpegpath(exepath);
}
- if (!KdenliveSettings::ffmpegpath().isEmpty()) video_frame->setPixmap(mergeSideBySide(KIcon("video-display").pixmap(QSize(50, 50)), i18n("Press record button\nto start screen capture\nFiles will be saved in:\n%1", m_capturePath)));
+ if (!KdenliveSettings::ffmpegpath().isEmpty()) {
+ if (!Render::checkX11Grab()) {
+ // FFmpeg does not support screen grab
+ video_frame->setPixmap(mergeSideBySide(KIcon("dialog-warning").pixmap(QSize(50, 50)), i18n("Your FFmpeg / Libav installation\n does not support screen grab")));
+ m_recAction->setEnabled(false);
+ }
+ else video_frame->setPixmap(mergeSideBySide(KIcon("video-display").pixmap(QSize(50, 50)), i18n("Press record button\nto start screen capture\nFiles will be saved in:\n%1", m_capturePath)));
+ }
//video_frame->setText(i18n("Press record button\nto start screen capture"));
break;
case VIDEO4LINUX:
}
}
+//static
+bool Render::checkX11Grab()
+{
+ if (KdenliveSettings::rendererpath().isEmpty() || KdenliveSettings::ffmpegpath().isEmpty()) return false;
+ QProcess p;
+ QStringList args;
+ args << "avformat:f-list";
+ p.start(KdenliveSettings::rendererpath(), args);
+ if (!p.waitForStarted()) return false;
+ if (!p.waitForFinished()) return false;
+ QByteArray result = p.readAllStandardError();
+ return result.contains("x11grab");
+}
+
#include "renderer.moc"
int getCurrentSeekPosition() const;
/** @brief Create a producer from url and load it in the monitor */
void loadUrl(const QString &url);
+ /** @brief Check if the installed FFmpeg / Libav supports x11grab */
+ static bool checkX11Grab();
QSemaphore showFrameSemaphore;
bool externalConsumer;