]> git.sesse.net Git - kdenlive/commitdiff
Speed up automatic scene detection (still very slow but better)
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Wed, 7 Nov 2012 21:19:37 +0000 (22:19 +0100)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Wed, 7 Nov 2012 21:19:37 +0000 (22:19 +0100)
src/projectlist.cpp
src/projecttree/meltjob.cpp

index a00d6f4043b48da3f6a04a76450db430e5a2bf65..a8e11723a0268c490bf32bb98f9d0421f39d5f07 100644 (file)
@@ -3508,14 +3508,16 @@ void ProjectList::startClipFilterJob(const QString &filterName, const QString &c
        // Producer params
        jobParams << QString();
        // Filter params, use a smaller region of the image to speed up operation
-       jobParams << filterName << "bounding=\"25%x25%:15%x15\" shot_change_list=0 denoise=0";
+       // In fact, it's faster to rescale whole image than using part of it (bounding=\"25%x25%:15%x15\")
+       jobParams << filterName << "shot_change_list=0 denoise=0";
        // Consumer
-       jobParams << "null" << "all=1 terminate_on_pause=1 real_time=-1";
+       jobParams << "null" << "all=1 terminate_on_pause=1 real_time=-1 rescale=nearest deinterlace_method=onefield top_field_first=-1";
        QMap <QString, QString> extraParams;
        extraParams.insert("key", "shot_change_list");
        extraParams.insert("projecttreefilter", "1");
        QString keyword("%count");
        extraParams.insert("resultmessage", i18n("Found %1 scenes.", keyword));
+       extraParams.insert("resize_profile", "160");
        if (ui.store_data->isChecked()) {
            // We want to save result as clip metadata
            extraParams.insert("storedata", "1");
index 1bc16c69370b272fc4f49fd6c64c02c50224ee54..8efb1e5becc6a2942648c8425a862dcd5070ee92 100644 (file)
@@ -96,6 +96,10 @@ void MeltJob::startJob()
     else {
        m_profile = new Mlt::Profile(KdenliveSettings::current_profile().toUtf8().constData());
     }
+    if (m_extra.contains("resize_profile")) {  
+       m_profile->set_height(m_extra.value("resize_profile").toInt());
+       m_profile->set_width(m_profile->height() * m_profile->sar());
+    }
     if (out == -1) {
        prod = new Mlt::Producer(*m_profile,  m_url.toUtf8().constData());
        m_length = prod->get_length();