Add support for x264 and x265 presets (#1856)

* Add support for x264 and x265 presets

just adds presets for x264 and x265. seems to work fine for me.

* UI tweaks

Make the presets easier to understand, add tooltip explaining preset's effects

* Do things properly, minor typo fix
This commit is contained in:
Quackdoc
2022-02-03 17:44:08 -08:00
committed by GitHub
parent 249006c685
commit 7d52dc19e3
2 changed files with 29 additions and 0 deletions
+27
View File
@@ -42,6 +42,31 @@ H264Section::H264Section(int default_crf, QWidget *parent) :
layout->setMargin(0);
int row = 0;
layout->addWidget(new QLabel(tr("Encode Speed:")), row, 0);
preset_combobox_ = new QComboBox();
preset_combobox_->setToolTip(tr("This setting allows you to tweak the ratio of export speed to compression quality. \n\n"
"If using Constant Rate Factor, slower speeds will result in smaller file sizes for the same quality. \n\n"
"If using Target Bit Rate or Target File Size, slower speeds will result in higher quality for the same bitrate/filesize. \n\n"
"This setting is equivalent to the `preset` setting in libx264."));
preset_combobox_->addItem(tr("Ultra Fast"));
preset_combobox_->addItem(tr("Super Fast"));
preset_combobox_->addItem(tr("Very Fast"));
preset_combobox_->addItem(tr("Faster"));
preset_combobox_->addItem(tr("Fast"));
preset_combobox_->addItem(tr("Medium"));
preset_combobox_->addItem(tr("Slow"));
preset_combobox_->addItem(tr("Slower"));
preset_combobox_->addItem(tr("Very Slow"));
//Default to "medium"
preset_combobox_->setCurrentIndex(5);
layout->addWidget(preset_combobox_, row, 1);
row++;
layout->addWidget(new QLabel(tr("Compression Method:")), row, 0);
@@ -110,6 +135,8 @@ void H264Section::AddOpts(EncodingParams *params)
params->set_video_buffer_size(2000000);
}
params->set_video_option(QStringLiteral("preset"), QString::number(preset_combobox_->currentIndex()));
}
H264CRFSection::H264CRFSection(int default_crf, QWidget *parent) :
+2
View File
@@ -23,6 +23,7 @@
#include <QSlider>
#include <QStackedWidget>
#include <QComboBox>
#include "codecsection.h"
#include "widget/slider/floatslider.h"
@@ -111,6 +112,7 @@ private:
H264FileSizeSection* filesize_section_;
QComboBox *preset_combobox_;
};
class H265Section : public H264Section