Commit 693ea598 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Rendering: add option to render at preview resolution for faster preview rendering

parent 4b57766b
......@@ -328,12 +328,19 @@ RenderWidget::RenderWidget(bool enableProxy, QWidget *parent)
#else
m_view.shareButton->setEnabled(false);
#endif
// Parallel rendering
m_view.parallel_process->setChecked(KdenliveSettings::parallelrender());
connect(m_view.parallel_process, &QCheckBox::stateChanged, [](int state) { KdenliveSettings::setParallelrender(state == Qt::Checked); });
if (KdenliveSettings::gpu_accel()) {
// Disable parallel rendering for movit
m_view.parallel_process->setEnabled(false);
}
// Preview res rendering
m_view.render_at_preview_res->setChecked(KdenliveSettings::render_at_preview_res());
connect(m_view.render_at_preview_res, &QCheckBox::stateChanged, [](int state) { KdenliveSettings::setRender_at_preview_res(state == Qt::Checked); });
m_view.field_order->setEnabled(false);
connect(m_view.scanning_list, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [this](int index) { m_view.field_order->setEnabled(index == 2); });
loadConfig();
......@@ -1561,6 +1568,11 @@ void RenderWidget::generateRenderFiles(QDomDocument doc, const QString &playlist
playlists << playlistName;
myConsumer.setAttribute(QStringLiteral("target"), mytarget);
// Preview rendering
if (KdenliveSettings::render_at_preview_res() && pCore->getMonitorProfile().height() != pCore->getCurrentFrameSize().height()) {
myConsumer.setAttribute(QStringLiteral("scale"), double(pCore->getMonitorProfile().height()) / pCore->getCurrentFrameSize().height());
}
// Prepare rendering args
int pass = passes == 2 ? i + 1 : 0;
if (renderArgs.contains(QStringLiteral("libx265"))) {
......
......@@ -276,6 +276,11 @@
<default>true</default>
</entry>
<entry name="render_at_preview_res" type="Bool">
<label>Use preview resolution for faster/low quality rendering.</label>
<default>false</default>
</entry>
<entry name="vaapiEnabled" type="Bool">
<label>Enables vaapi hw accel in encoders.</label>
<default>false</default>
......
......@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>1029</width>
<width>1041</width>
<height>573</height>
</rect>
</property>
......@@ -388,6 +388,13 @@
</item>
<item row="4" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QCheckBox" name="render_at_preview_res">
<property name="text">
<string>Render at preview resolution</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="options">
<property name="sizePolicy">
......
  • @mardelle Why have you decided to store the setting in KdenliveSettings? I am asking because other render settings are saved in the project file

  • Oh you're right, it is probably better to store it in the project file, will fix thanks.

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