Skip to content

Instantly share code, notes, and snippets.

@hcooper
Created December 19, 2014 16:22
Show Gist options
  • Save hcooper/f33fc6deb92fd50c7b56 to your computer and use it in GitHub Desktop.
Save hcooper/f33fc6deb92fd50c7b56 to your computer and use it in GitHub Desktop.
fix video stabilization in kdenlive
--- /tmp/kdenlive-0.9.10/src/project/projectlist.cpp 2014-10-05 10:55:35.000000000 +0100
+++ src/project/projectlist.cpp 2014-12-19 16:05:33.906585717 +0000
@@ -3648,9 +3648,10 @@
// producer params
preParams << jobParams.takeFirst();
// filter name
- preParams << jobParams.takeFirst();
+ QString filterName = jobParams.takeFirst();
+ preParams << filterName;
// filter params
- preParams << jobParams.takeFirst();
+ QString filterParams = jobParams.takeFirst();
// consumer
QString consumer = jobParams.takeFirst();
@@ -3667,11 +3668,25 @@
}
jobArgs << preParams;
if (ids.count() == 1) {
- jobArgs << consumer + ':' + destination;
+ // Append a 'filename' paramater for saving vidstab data
+ if (filterName == "vidstab") {
+ QString trffile = destination + ".trf";
+ jobArgs << filterParams + QString(" filename=%1").arg(trffile) << consumer + ':' + destination;
+ } else {
+ jobArgs << filterParams << consumer + ':' + destination;
+ }
}
else {
- jobArgs << consumer + ':' + destination + item->clipUrl().fileName() + ".mlt";
+ QString mltfile = destination + item->clipUrl().fileName() + ".mlt";
+ if (filterName == "vidstab") {
+ QString trffile = mltfile + ".trf";
+ jobArgs << filterParams + QString(" filename=%1").arg(trffile) << consumer + ':' + mltfile;
+ } else {
+ jobArgs << filterParams << consumer + ':' + mltfile;
+ }
}
+
+ kDebug() << jobArgs;
jobArgs << jobParams;
MeltJob *job = new MeltJob(item->clipType(), id, jobArgs, extraParams);
@hcooper
Copy link
Author

hcooper commented Dec 19, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment