Skip to content

Commit

Permalink
Fix save & load x265 CBR and CVBR custom presets.
Browse files Browse the repository at this point in the history
  • Loading branch information
ddennedy committed Dec 3, 2016
1 parent 47d12cd commit c149b02
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/docks/encodedock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ void EncodeDock::loadPresetFromProperties(Mlt::Properties& preset)
ui->videoRateControlCombo->setCurrentIndex(RateControlConstant);
ui->videoBufferSizeSpinner->setValue(getBufferSize(preset, "vbufsize"));
}
else if (name == "vmaxrate") {
ui->videoBitrateCombo->lineEdit()->setText(preset.get("vmaxrate"));
}
else if (name == "threads") {
// TODO: should we save the thread count and restore it if preset is not 1?
if (preset.get_int("threads") == 1)
Expand Down Expand Up @@ -459,6 +462,8 @@ Mlt::Properties* EncodeDock::collectProperties(int realtime)
x265params = QString("bitrate=%1:vbv-bufsize=%2:vbv-maxrate=%3:%4")
.arg(b).arg(int(ui->videoBufferSizeSpinner->value() * 8)).arg(b).arg(x265params);
break;
p->set("vb", b.toLatin1().constData());
p->set("vbufsize", int(ui->videoBufferSizeSpinner->value() * 8 * 1024));
}
case RateControlQuality: {
int vq = ui->videoQualitySpinner->value();
Expand All @@ -477,6 +482,7 @@ Mlt::Properties* EncodeDock::collectProperties(int realtime)
// Also set properties so that custom presets can be interpreted properly.
p->set("crf", TO_ABSOLUTE(51, 0, vq));
p->set("vbufsize", int(ui->videoBufferSizeSpinner->value() * 8 * 1024));
p->set("vmaxrate", ui->videoBitrateCombo->currentText().toLatin1().constData());
break;
}
}
Expand Down

0 comments on commit c149b02

Please sign in to comment.