From: Dan Dennedy Date: Fri, 18 Feb 2011 07:01:54 +0000 (+0000) Subject: Add mlt and encoder threads to render dialog. X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=3577376c5e5b6cc533af0edc9d4f03d0b3770f9e;p=kdenlive Add mlt and encoder threads to render dialog. svn path=/trunk/kdenlive/; revision=5423 --- 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); diff --git a/src/renderwidget.h b/src/renderwidget.h index 708d39a6..11e9e08e 100644 --- a/src/renderwidget.h +++ b/src/renderwidget.h @@ -164,6 +164,7 @@ private slots: void slotPlayRendering(QTreeWidgetItem *item, int); void slotStartCurrentJob(); void slotCopyToFavorites(); + void slotUpdateEncodeThreads(int); void slotUpdateRescaleHeight(int); void slotUpdateRescaleWidth(int); void slotSwitchAspectRatio(); diff --git a/src/widgets/renderwidget_ui.ui b/src/widgets/renderwidget_ui.ui index be71963d..b47f26cd 100644 --- a/src/widgets/renderwidget_ui.ui +++ b/src/widgets/renderwidget_ui.ui @@ -6,8 +6,8 @@ 0 0 - 391 - 575 + 387 + 652 @@ -198,7 +198,7 @@ - + @@ -222,13 +222,6 @@ 0 - - - - 0 - - - @@ -266,47 +259,54 @@ + + + + 0 + + + - + Open Dvd wizard after rendering - + Create chapter file based on guides - + Open browser window after export - + Play after render - + Timecode overlay - + @@ -347,7 +347,7 @@ - + @@ -390,21 +390,21 @@ - + Render to File - + Generate Script - + Qt::Horizontal @@ -417,14 +417,14 @@ - + Close - + @@ -453,13 +453,30 @@ - + Render using proxy clips + + + + Encoder threads + + + + + + + 1 + + + 999 + + +