Commit 0d62a701 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Remove some deprecated config options, fix nvenc detection

parent 2d6fa35a
......@@ -252,14 +252,6 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap<QString, QString> &map
slotUpdateGrabRegionStatus();
loadTranscodeProfiles();
// HACK: check dvgrab version, because only dvgrab >= 3.3 supports
// --timestamp option without bug
if (KdenliveSettings::dvgrab_path().isEmpty() || !QFile::exists(KdenliveSettings::dvgrab_path())) {
QString dvgrabpath = QStandardPaths::findExecutable(QStringLiteral("dvgrab"));
KdenliveSettings::setDvgrab_path(dvgrabpath);
}
// decklink profile
QAction *act = new QAction(QIcon::fromTheme(QStringLiteral("configure")), i18n("Configure profiles"), this);
act->setData(4);
......@@ -350,30 +342,6 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap<QString, QString> &map
// No blackmagic card found
m_configSdl.kcfg_external_display->setEnabled(false);
}
if (!KdenliveSettings::dvgrab_path().isEmpty()) {
double dvgrabVersion = 0;
auto *versionCheck = new QProcess;
versionCheck->setProcessChannelMode(QProcess::MergedChannels);
versionCheck->start(QStringLiteral("dvgrab"), QStringList() << QStringLiteral("--version"));
if (versionCheck->waitForFinished()) {
QString version = QString(versionCheck->readAll()).simplified();
if (version.contains(QLatin1Char(' '))) {
version = version.section(QLatin1Char(' '), -1);
}
dvgrabVersion = version.toDouble();
// qCDebug(KDENLIVE_LOG) << "// FOUND DVGRAB VERSION: " << dvgrabVersion;
}
delete versionCheck;
if (dvgrabVersion < 3.3) {
KdenliveSettings::setFirewiretimestamp(false);
m_configCapture.kcfg_firewiretimestamp->setEnabled(false);
}
m_configCapture.dvgrab_info->setText(i18n("dvgrab version %1 at %2", dvgrabVersion, KdenliveSettings::dvgrab_path()));
} else {
m_configCapture.dvgrab_info->setText(i18n("<strong><em>dvgrab</em> utility not found, please install it for firewire capture</strong>"));
}
}
//static
......@@ -834,16 +802,6 @@ void KdenliveSettingsDialog::updateSettings()
}
}
if (m_configCapture.kcfg_dvgrabfilename->text() != KdenliveSettings::dvgrabfilename()) {
KdenliveSettings::setDvgrabfilename(m_configCapture.kcfg_dvgrabfilename->text());
updateCapturePath = true;
}
if (m_configCapture.kcfg_firewireformat->currentIndex() != KdenliveSettings::firewireformat()) {
KdenliveSettings::setFirewireformat(m_configCapture.kcfg_firewireformat->currentIndex());
updateCapturePath = true;
}
if (m_configCapture.kcfg_v4l_format->currentIndex() != (int)KdenliveSettings::v4l_format()) {
saveCurrentV4lProfile();
KdenliveSettings::setV4l_format(0);
......
......@@ -942,15 +942,21 @@ void Wizard::testHwEncoders()
KdenliveSettings::setVaapiEnabled(vaapiSupported);
// NVIDIA testing
QStringList args2{"-y","-hwaccel","cuvid","-f","lavfi","-i","smptebars=duration=5:size=1280x720:rate=25","-c:v","h264_nvenc","-an","-f","mp4",tmp.fileName()};
QTemporaryFile tmp2(QDir::tempPath() + "/XXXXXX.mp4");
if (!tmp2.open()) {
// Something went wrong
return;
}
tmp2.close();
QStringList args2{"-y","-hwaccel","cuvid","-f","lavfi","-i","smptebars=duration=5:size=1280x720:rate=25","-c:v","h264_nvenc","-an","-f","mp4",tmp2.fileName()};
qDebug()<<"// FFMPEG ARGS: "<<args2;
hwEncoders.start(KdenliveSettings::ffmpegpath(), args2);
bool nvencSupported = false;
if (hwEncoders.waitForFinished()) {
if (hwEncoders.exitStatus() == QProcess::CrashExit) {
qDebug()<<"/// ++ VAAPI NOT SUPPORTED";
qDebug()<<"/// ++ NVENC NOT SUPPORTED";
} else {
if (tmp.exists() && tmp.size() > 0) {
if (tmp2.exists() && tmp2.size() > 0) {
qDebug()<<"/// ++ NVENC YES SUPPORTED ::::::";
// vaapi support enabled
nvencSupported = true;
......
......@@ -453,21 +453,6 @@
<default>0</default>
</entry>
<entry name="firewireformat" type="Int">
<label>Default firewire capture format.</label>
<default>0</default>
</entry>
<entry name="firewireautosplit" type="Bool">
<label>Create new capture file on scene cut.</label>
<default>false</default>
</entry>
<entry name="firewiretimestamp" type="Bool">
<label>Add record time to captured file name.</label>
<default>false</default>
</entry>
<entry name="detectedv4ldevices" type="UInt">
<label>Detected v4l devices.</label>
<default>0</default>
......@@ -583,31 +568,16 @@
<default>false</default>
</entry>
<entry name="dvgrab_path" type="String">
<label>Path for the dvgrab binary.</label>
<default></default>
</entry>
<entry name="dvgrabfilename" type="String">
<label>Default name for dvgrab capture.</label>
<default>capture</default>
</entry>
<entry name="dvgrabextra" type="String">
<label>Additional dvgrab parameters.</label>
<default></default>
</entry>
<entry name="decklink_device_found" type="Bool">
<label>Enable Blackmagic decklink support.</label>
<default>true</default>
<default>false</default>
</entry>
<entry name="decklink_capturedevice" type="UInt">
<label>default HDMI capture device.</label>
<default>0</default>
</entry>
<entry name="decklink_profile" type="Int">
<label>default HDMI encoding profile.</label>
<default>0</default>
......
......@@ -52,117 +52,9 @@
<height>0</height>
</size>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Firewire</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0" colspan="3">
<widget class="QLabel" name="dvgrab_info">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Capture format</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="KComboBox" name="kcfg_firewireformat">
<item>
<property name="text">
<string>DV Raw</string>
</property>
</item>
<item>
<property name="text">
<string>DV AVI type 1</string>
</property>
</item>
<item>
<property name="text">
<string>DV AVI type 2</string>
</property>
</item>
<item>
<property name="text">
<string>HDV</string>
</property>
</item>
</widget>
</item>
<item row="1" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>241</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0" colspan="3">
<widget class="QCheckBox" name="kcfg_firewireautosplit">
<property name="text">
<string>Automatically start a new file on scene cut</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="3">
<widget class="QCheckBox" name="kcfg_firewiretimestamp">
<property name="text">
<string>Add recording time to captured file name</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Capture file name</string>
</property>
</widget>
</item>
<item row="4" column="1" colspan="2">
<widget class="QLineEdit" name="kcfg_dvgrabfilename"/>
</item>
<item row="5" column="0" colspan="2">
<widget class="QLabel" name="label_7">
<property name="text">
<string>dvgrab additional parameters</string>
</property>
</widget>
</item>
<item row="6" column="0" colspan="3">
<widget class="QLineEdit" name="kcfg_dvgrabextra"/>
</item>
<item row="7" column="1">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>188</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>FFmpeg</string>
......@@ -756,9 +648,6 @@
<tabstops>
<tabstop>kcfg_defaultcapture</tabstop>
<tabstop>tabWidget</tabstop>
<tabstop>kcfg_firewireformat</tabstop>
<tabstop>kcfg_firewireautosplit</tabstop>
<tabstop>kcfg_firewiretimestamp</tabstop>
<tabstop>kcfg_grab_capture_type</tabstop>
<tabstop>kcfg_grab_follow_mouse</tabstop>
<tabstop>kcfg_grab_hide_frame</tabstop>
......
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