Skip to content

Commit e9696f9

Browse files
authored
v1.0.3
- Fixed color bit depth output on ProRes XQ encoding. - Added two pass encoding for both QuickSync and AMF encoders. - Added constant quantizer encoding for both QuickSync and AMF encoders. - Added the option to open the output path by right-clicking a job in the job queue.
1 parent f2c055f commit e9696f9

13 files changed

+73
-36
lines changed

Arguments/Argument.h

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class Argument {
3636
static QString AudioBitrate(int, QString);
3737
static QString ConstantRateFactor(int);
3838
static QString ConstantQuantizer(int);
39+
static QString Quantizer(int);
3940
static QString ConstantVideoQuality(int);
4041
static QString ConstantAudioQuality(int, QString);
4142
static QString VideoResolution(int, int);

Arguments/RateControlArgs.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,13 @@ QString Argument::ConstantRateFactor(int crf) {
5252
/// <returns>String representation of the argument.</returns>
5353
QString Argument::ConstantQuantizer(int strength) {
5454
return QString(" -cq %1").arg(strength);
55+
}
56+
57+
/// <summary>
58+
/// Sets the constant quantization for GPU encoders.
59+
/// </summary>
60+
/// <param name="strength">The quantizaton strength.</param>
61+
/// <returns>String representation of the argument.</returns>
62+
QString Argument::Quantizer(int strength) {
63+
return QString(" -q %1").arg(strength);
5564
}

EncodeGUI.vcxproj.user

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
<ShowAllFiles>true</ShowAllFiles>
55
</PropertyGroup>
66
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
7-
<QtLastBackgroundBuild>2022-03-18T23:50:41.1429074Z</QtLastBackgroundBuild>
7+
<QtLastBackgroundBuild>2022-03-20T22:05:57.9550090Z</QtLastBackgroundBuild>
88
</PropertyGroup>
99
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
10-
<QtLastBackgroundBuild>2022-03-18T23:50:41.5960213Z</QtLastBackgroundBuild>
10+
<QtLastBackgroundBuild>2022-03-20T22:05:58.4645888Z</QtLastBackgroundBuild>
1111
</PropertyGroup>
1212
</Project>

Process/MediaConfig.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ void MediaConfig::SetConstantQuantizer(int strength) {
130130
ArgumentList.append(Argument::ConstantQuantizer(strength));
131131
}
132132

133+
void MediaConfig::SetQuantizer(int strength) {
134+
ArgumentList.append(Argument::Quantizer(strength));
135+
}
136+
133137
void MediaConfig::SetConstantVideoQuality(int quality) {
134138
ArgumentList.append(Argument::ConstantVideoQuality(quality));
135139
}

Process/MediaConfig.h

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class MediaConfig : protected Argument {
4141
static void SetAudioBitrate(int, QString);
4242
static void SetConstantRateFactor(int);
4343
static void SetConstantQuantizer(int);
44+
static void SetQuantizer(int);
4445
static void SetConstantVideoQuality(int);
4546
static void SetConstantAudioQuality(int, QString);
4647
static void SetVideoResolution(int, int);

Regex/AudioSubInfoRegex.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ QString AudioSubInfoRegex::SubLanguage;
1313
QString AudioSubInfoRegex::SubStreams;
1414

1515
void AudioSubInfoRegex::SetupPattern() {
16-
Indexer << QRegularExpression("Stream\\s?#0:([0-9]?[0-9]?)\\[?[^\\]]*?\\]?\\(?(\\w*)\\)?:?\\[?[^\\]]*\\]?:\\s?Audio:\\s?(\\w*)[^,]*,?\\s?([^\\s]*)\\sHz,\\s?([^,]*),?");
17-
Indexer << QRegularExpression("Stream\\s?#0:([0-9]?[0-9]?)\\[?[^\\]]*?\\]?\\(?(\\w*)\\)?:?\\[?[^\\]]*\\]?:\\s?Subtitle:\\s?([^\\s]*)");
16+
Indexer << QRegularExpression("Stream\\s?#0:([0-9]?[0-9]?)\\[?[^\\]]*\\]?\\(?(\\w*)\\)?:?\\[?[^\\]]*\\]?:\\s?Audio:\\s?(\\w*)[^,]*,?\\s?([^\\s]*)\\sHz,\\s?([^,]*),?");
17+
Indexer << QRegularExpression("Stream\\s?#0:([0-9]?[0-9]?)\\[?[^\\]]*\\]?\\(?(\\w*)\\)?:?\\[?[^\\]]*\\]?:\\s?Subtitle:\\s?([^\\s]*)");
1818
Indexer << QRegularExpression("\\s*Chapters:");
1919
}
2020

@@ -55,7 +55,7 @@ void AudioSubInfoRegex::AudioInfoRegex(QString output) {
5555

5656
if (!AudioLanguage.contains("und") && !AudioLanguage.isEmpty())
5757
AudioLanguage = AudioLanguage.toUpper();
58-
else
58+
else if (AudioLanguage.isEmpty() || AudioLanguage.contains("und"))
5959
AudioLanguage = "?";
6060

6161
if (!SampleRate.isEmpty())

UI/AVC.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ void EncodeGUI::hdwr_264d() {
8585
}
8686
if (ui.Hardware264DD->count() == 1 || ui.Hardware264DD->currentIndex() == 1) {
8787
SET_VISIBLE(ui.EncodeMode264HWDD);
88-
ui.EncodeMode264HWDD->setCurrentIndex(1);
89-
SET_DISABLED(ui.EncodeMode264HWDD);
9088
SET_INVISIBLE(ui.EncodeMode264DD);
9189
SET_DISABLED(ui.EncodeMode264DD);
9290
}

UI/Config.cpp

+13-2
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,10 @@ QString EncodeGUI::ConfigureArgs(QString id, QString audio, QString subtitles, b
158158

159159
switch (ui.EncodeMode264HWDD->currentIndex()) {
160160
case 0:
161-
MediaConfig::SetConstantQuantizer(ui.Quantizer264NUD->value());
161+
if (ui.Hardware264DD->currentText().contains("NVENC"))
162+
MediaConfig::SetConstantQuantizer(ui.Quantizer264NUD->value());
163+
else
164+
MediaConfig::SetQuantizer(ui.Quantizer264NUD->value());
162165
break;
163166
case 1:
164167
MediaConfig::SetVideoBitrate(ui.Bitrate264NUD->value());
@@ -293,7 +296,10 @@ QString EncodeGUI::ConfigureArgs(QString id, QString audio, QString subtitles, b
293296

294297
switch (ui.EncodeMode265HWDD->currentIndex()) {
295298
case 0:
296-
MediaConfig::SetConstantQuantizer(ui.Quantizer265NUD->value());
299+
if (ui.Hardware265DD->currentText().contains("NVENC"))
300+
MediaConfig::SetConstantQuantizer(ui.Quantizer265NUD->value());
301+
else
302+
MediaConfig::SetQuantizer(ui.Quantizer265NUD->value());
297303
break;
298304
case 1:
299305
MediaConfig::SetVideoBitrate(ui.Bitrate265NUD->value());
@@ -322,6 +328,11 @@ QString EncodeGUI::ConfigureArgs(QString id, QString audio, QString subtitles, b
322328
MediaConfig::SetColorsProRes(mtrx, trans, prims);
323329
}
324330

331+
if (ui.ProfileDD->currentIndex() >= 0 && ui.ProfileDD->currentIndex() < 4)
332+
MediaConfig::SetPixelFormat("yuv422p10le");
333+
else
334+
MediaConfig::SetPixelFormat("yuv444p12le");
335+
325336
break;
326337
case 3:
327338
MediaConfig::SetVideoCodec("libtheora");

UI/EncodeGUI.cpp

+32-21
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ EncodeGUI::EncodeGUI(QWidget *parent) : QMainWindow(parent)
144144
bsldr_264();
145145
profile_gb264();
146146
hdwr_265();
147-
hdwr_265d();
148147
SampleVid();
149148
mode_265();
149+
hdwr_265d();
150150
mode_vpx();
151151
downmix_cb();
152152
mode_theora();
@@ -192,12 +192,13 @@ EncodeGUI::EncodeGUI(QWidget *parent) : QMainWindow(parent)
192192
GPUFinished();
193193
CheckEncoders();
194194
GetProcessor();
195-
LoadSysSetting();
196195

197196
Updater();
198197

199198
connect(ui.AutoDelSourceCB, SIGNAL(stateChanged(int)), this, SLOT(DelSource()));
200199
connect(ui.SCThresholdNUD, SIGNAL(valueChanged(int)), this, SLOT(ScNUD()));
200+
201+
LoadSysSetting();
201202
}
202203

203204
void EncodeGUI::CheckEncoders() {
@@ -507,28 +508,33 @@ void EncodeGUI::RegexFinished() {
507508
}
508509
else {
509510
tool_interp();
510-
ui.InterpolationCB->setChecked(true);
511-
ui.InterpolationCB->setChecked(false);
511+
512+
if (CHECKED(ui.ColorSpaceCB)) {
513+
if (VideoInfo::GetMatrix().contains("?") || VideoInfo::GetMatrix().contains("unknown")) {
514+
VideoInfo::SetMatrix("bt709");
515+
WriteLog("Color matrix for the selected source is unknown, assuming BT709.", false, false, false);
516+
}
517+
if (VideoInfo::GetTransfer().contains("?") || VideoInfo::GetTransfer().contains("unknown")) {
518+
VideoInfo::SetTransfer("bt709");
519+
WriteLog("Color transfer for the selected source is unknown, assuming BT709.", false, false, false);
520+
}
521+
if (VideoInfo::GetPrimaries().contains("?") || VideoInfo::GetPrimaries().contains("unknown")) {
522+
VideoInfo::SetPrimaries("bt709");
523+
WriteLog("Color primaries for the selected source is unknown, assuming BT709.", false, false, false);
524+
}
525+
}
526+
527+
if (!ui.InterpolationCB->isChecked()) {
528+
ui.InterpolationCB->setChecked(true);
529+
ui.InterpolationCB->setChecked(false);
530+
}
512531

513532
if (AudioInfo::TotalStreams() != 0) {
514-
SET_ENABLED(ui.AudioTrackDD);
533+
if (CHECKED(ui.GetVidInfoCB))
534+
SET_ENABLED(ui.AudioTrackDD);
535+
515536
SET_ENABLED(ui.AudioCB);
516537
ui.AudioCB->setChecked(true);
517-
518-
if (CHECKED(ui.ColorSpaceCB)) {
519-
if (VideoInfo::GetMatrix().contains("?") || VideoInfo::GetMatrix().contains("unknown")) {
520-
VideoInfo::SetMatrix("bt709");
521-
WriteLog("Color matrix for the selected source is unknown, assuming BT709.", false, false, false);
522-
}
523-
if (VideoInfo::GetTransfer().contains("?") || VideoInfo::GetTransfer().contains("unknown")) {
524-
VideoInfo::SetTransfer("bt709");
525-
WriteLog("Color transfer for the selected source is unknown, assuming BT709.", false, false, false);
526-
}
527-
if (VideoInfo::GetPrimaries().contains("?") || VideoInfo::GetPrimaries().contains("unknown")) {
528-
VideoInfo::SetPrimaries("bt709");
529-
WriteLog("Color primaries for the selected source is unknown, assuming BT709.", false, false, false);
530-
}
531-
}
532538
}
533539
if (SubtitleInfo::TotalStreams() != 0) {
534540
SET_ENABLED(ui.SubtitlesDD);
@@ -591,9 +597,10 @@ void EncodeGUI::RegexFinished() {
591597
InterpFactor();
592598
}
593599

600+
SetAudioInfo();
601+
594602
if (CHECKED(ui.GetVidInfoCB)) {
595603
SetVideoInfo();
596-
SetAudioInfo();
597604

598605
connect(ui.AudioTrackDD, SIGNAL(currentIndexChanged(int)), this, SLOT(audio_track()));
599606
}
@@ -1181,6 +1188,10 @@ void EncodeGUI::OpenJobLogs() {
11811188
QDesktopServices::openUrl(QUrl(QString("file:///") + QDir::toNativeSeparators(QDir::homePath() + QString("\\AppData\\Local\\EncodeGUI\\job-%1").arg(job.at(selectedJob)))));
11821189
}
11831190

1191+
void EncodeGUI::OpenOutput() {
1192+
QDesktopServices::openUrl(QUrl(QString("file:///") + QDir::toNativeSeparators(QFileInfo(outputList.at(selectedJob)).absolutePath())));
1193+
}
1194+
11841195
void EncodeGUI::UpdateProgress() {
11851196
ui.progressBar->setMaximum(100);
11861197

UI/EncodeGUI.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#define INFO 2
4141
#define QUESTION 3
4242

43-
#define VERSION QString("1.0.2")
43+
#define VERSION QString("1.0.3")
4444

4545
class EncodeGUI : public QMainWindow {
4646
Q_OBJECT
@@ -118,6 +118,7 @@ class EncodeGUI : public QMainWindow {
118118
private slots:
119119
void Start();
120120
void CreateJob();
121+
void OpenOutput();
121122
void Skip();
122123
void MediaInfo();
123124
void GoToUpdate();
@@ -184,7 +185,6 @@ private slots:
184185
void hide_aud();
185186
void hide_sub();
186187
void hdwr_264();
187-
void hdwr_264d();
188188
void mode_264();
189189
void hide_pre264();
190190
void hide_tun264();
@@ -201,6 +201,7 @@ private slots:
201201
void bsldr_265();
202202
void hdwr_265();
203203
void hdwr_265d();
204+
void hdwr_264d();
204205
void mode_265();
205206
void audio_dd();
206207
void downmix_cb();

UI/HEVC.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ void EncodeGUI::hdwr_265d() {
102102
}
103103
if (ui.Hardware265DD->count() == 1 || ui.Hardware265DD->currentIndex() == 1) {
104104
SET_VISIBLE(ui.EncodeMode265HWDD);
105-
ui.EncodeMode265HWDD->setCurrentIndex(1);
106-
SET_DISABLED(ui.EncodeMode265HWDD);
107105
SET_INVISIBLE(ui.EncodeMode265DD);
108106
SET_DISABLED(ui.EncodeMode265DD);
109107
}
@@ -159,7 +157,7 @@ void EncodeGUI::mode_265() {
159157
SET_INVISIBLE(ui.FastPass265CB);
160158
SET_INVISIBLE(ui.FastPass265Label);
161159

162-
if (ui.EncodeMode264HWDD->currentIndex() == 0) {
160+
if (ui.EncodeMode265HWDD->currentIndex() == 0) {
163161
SET_INVISIBLE(ui.Bitrate265NUD);
164162
SET_INVISIBLE(ui.Bitrate265Label);
165163
SET_VISIBLE(ui.Quantizer265Label);

UI/Jobs.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ void EncodeGUI::JobContext(QPoint pos) {
6161
QMenu* m = new QMenu(this);
6262

6363
QAction* logs = new QAction("Open logs path", this);
64+
QAction* output = new QAction("Open output path", this);
6465
QAction* pause = new QAction("Pause / Resume", this);
6566
QAction* cancel = new QAction("Cancel", this);
6667
QAction* remove = new QAction("Remove", this);
@@ -81,13 +82,15 @@ void EncodeGUI::JobContext(QPoint pos) {
8182

8283
m->setFont(this->font());
8384
m->addAction(logs);
85+
m->addAction(output);
8486
m->addAction(pause);
8587
m->addAction(cancel);
8688
m->addAction(remove);
8789
m->addAction(reset);
8890
m->popup(ui.JobQueue->viewport()->mapToGlobal(pos));
8991

9092
connect(pause, SIGNAL(triggered()), this, SLOT(PauseClick()));
93+
connect(output, SIGNAL(triggered()), this, SLOT(OpenOutput()));
9194
connect(logs, SIGNAL(triggered()), this, SLOT(OpenJobLogs()));
9295
connect(cancel, SIGNAL(triggered()), this, SLOT(CancelClick()));
9396
connect(remove, SIGNAL(triggered()), this, SLOT(RemoveJob()));

x64/Release/uic/ui_EncodeGUI.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -2357,7 +2357,7 @@ class Ui_EncodeGUIMV
23572357

23582358
void retranslateUi(QMainWindow *EncodeGUIMV)
23592359
{
2360-
EncodeGUIMV->setWindowTitle(QCoreApplication::translate("EncodeGUIMV", "EncodeGUI v1.0.1 (free, stable)", nullptr));
2360+
EncodeGUIMV->setWindowTitle(QCoreApplication::translate("EncodeGUIMV", "EncodeGUI v1.0.3 (free, stable)", nullptr));
23612361
#if QT_CONFIG(tooltip)
23622362
EGUILogo->setToolTip(QCoreApplication::translate("EncodeGUIMV", "EncodeGUI :)", nullptr));
23632363
#endif // QT_CONFIG(tooltip)

0 commit comments

Comments
 (0)