Added support for presets to NVEncC.

This commit is contained in:
LoRd_MuldeR 2020-04-10 15:09:39 +02:00
parent b3d696aae0
commit f7ba35757c
2 changed files with 12 additions and 3 deletions

View File

@ -144,7 +144,7 @@ public:
virtual QStringList getPresets(void) const
{
return QStringList();
return QStringList() << "performance" << "quality";
}
virtual QStringList getProfiles(const quint32 &variant) const
@ -341,6 +341,15 @@ void NVEncEncoder::buildCommandLine(QStringList &cmdLine, const bool &usePipe, c
MUTILS_THROW("Bad encoder variant !!!");
}
const QString preset = m_options->preset().simplified().toLower();
if(!preset.isEmpty())
{
if(preset.compare(QString::fromLatin1(OptionsModel::SETTING_UNSPECIFIED), Qt::CaseInsensitive) != 0)
{
cmdLine << "--preset" << preset;
}
}
switch(m_options->rcMode())
{
case 0:

View File

@ -167,8 +167,8 @@ const bool &StringValidator::setStatus(const bool &flag, const QString &toolName
QValidator::State StringValidatorEncoder::validate(QString &input, int &pos) const
{
static const char *const params[] = { "D", "B", "o", "h", "p", "q", /*"fps", "frames",*/ "preset", "tune", "profile",
"stdin", "crf", "bitrate", "qp", "pass", "stats", "output", "output-depth", "help", "quiet", "codec", "y4m", NULL };
static const char *const params[] = { "D", "B", "o", "h", "p", "q", "u", "preset", "tune", "profile", "stdin",
"crf", "bitrate", "qp", "pass", "stats", "output", "output-depth", "help", "quiet", "codec", "y4m", NULL };
const QString commandLine = input.trimmed();
const QStringList tokens = commandLine.isEmpty() ? QStringList() : MUtils::OS::crack_command_line(commandLine);