X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Frenderwidget.cpp;h=18b97b63bc12d7e36d665d6088c76b95a334392b;hb=3577376c5e5b6cc533af0edc9d4f03d0b3770f9e;hp=7b0d5117c2370ff6a658183f1784057d972b4b80;hpb=668d8a4d6a1436697fb48fdf279b69e61dec8f8d;p=kdenlive diff --git a/src/renderwidget.cpp b/src/renderwidget.cpp index 7b0d5117..18b97b63 100644 --- a/src/renderwidget.cpp +++ b/src/renderwidget.cpp @@ -43,6 +43,7 @@ #include #include #include +#include const int GroupRole = Qt::UserRole; const int ExtensionRole = GroupRole + 1; @@ -89,6 +90,10 @@ RenderWidget::RenderWidget(const QString &projectfolder, bool enableProxy, QWidg m_view.proxy_render->setHidden(!enableProxy); + m_view.encoder_threads->setMaximum(QThread::idealThreadCount()); + m_view.encoder_threads->setValue(KdenliveSettings::encodethreads()); + connect(m_view.encoder_threads, SIGNAL(valueChanged(int)), this, SLOT(slotUpdateEncodeThreads(int))); + m_view.rescale_keep->setChecked(KdenliveSettings::rescalekeepratio()); connect(m_view.rescale_width, SIGNAL(valueChanged(int)), this, SLOT(slotUpdateRescaleWidth(int))); connect(m_view.rescale_height, SIGNAL(valueChanged(int)), this, SLOT(slotUpdateRescaleHeight(int))); @@ -755,6 +760,10 @@ void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut, const // disable audio if requested if (!exportAudio) renderArgs.append(" an=1 "); + // Set the thread counts + renderArgs.append(QString(" threads=%1").arg(KdenliveSettings::encodethreads())); + renderArgs.append(QString(" real_time=-%1").arg(KdenliveSettings::mltthreads())); + // Check if the rendering profile is different from project profile, // in which case we need to use the producer_comsumer from MLT QString std = renderArgs; @@ -780,7 +789,7 @@ void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut, const break; } } - + if (resizeProfile) render_process_args << "consumer:" + (scriptExport ? "$SOURCE" : playlistPath); else @@ -1859,6 +1868,11 @@ void RenderWidget::missingClips(bool hasMissing) } else m_view.errorBox->setHidden(true); } +void RenderWidget::slotUpdateEncodeThreads(int val) +{ + KdenliveSettings::setEncodethreads(val); +} + void RenderWidget::slotUpdateRescaleWidth(int val) { KdenliveSettings::setDefaultrescalewidth(val);