This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Kdenlive 15.08 render crash on rescale-partial patch

Tags: None
(comma "," separated)
lukefromdc
Registered Member
Posts
27
Karma
0
In Kdenlive 15.08.0 and all the last month's GIT master builds, checking "rescale" to output to a different resolution causes the renderer to immediately "finish" announcing it is done but creating a zero byte file. A workaround is to resize the project instead, then render without rescaling but rescaling on render gives higher quality with fewer artifacts under heavy compression. In addition, resizing the project corrupts any obscure effects used, requiring them to be reset.

It is possible to replace the entire kdenlive_render binary with that from 15.04, which will render at project resolution normally. In a rescale job, the video will render normally, the audio will have speed issues, and a big memory leak results. By playing with the source code, I came up with the patch below for the 15.08 renderjob.cpp which seems to duplicate this effect while making the fewest changes. Logging had to be disabled as it causes an infinate wait state on rescale. Also, this won't work for a very large project, which will also generate an infinate wait. A somewhat less large project can also use up all available RAM if rescaled, but the patch below will allow rescaling smaller jobs. It is not suitable for release but I'm providing it anyway in hopes it wil provide clues for fixing this right. Here is the patch:

Code: Select all
--- /home/luke/Desktop/Kdenlive_Development/kdenlive-15.08.0/renderer/renderjob.cpp   2015-08-11 19:20:55.000000000 -0400
+++ /home/luke/Desktop/Kdenlive_Development/kdenlive-15.08.0+rendererhack/renderer/renderjob.cpp   2015-08-19 21:36:56.224737665 -0400
@@ -61,7 +61,7 @@ RenderJob::RenderJob(bool erase, bool us
     // Disable VDPAU so that rendering will work even if there is a Kdenlive instance using VDPAU
     qputenv("MLT_NO_VDPAU", "1");
 
-    m_args << "xml:" + scenelist;
+    m_args << scenelist;  //cannot use  "xml:" entry, it crashes rescaled jobs
     if (in != -1) m_args << QLatin1String("in=") + QString::number(in);
     if (out != -1) m_args << QLatin1String("out=") + QString::number(out);
     m_args << preargs;
@@ -74,11 +74,13 @@ RenderJob::RenderJob(bool erase, bool us
     m_args << QLatin1String("-consumer") << rendermodule + QLatin1Char(':') + m_dest
            << QLatin1String("progress=1") << args;
 
-    m_dualpass = args.contains(QLatin1String("pass=1"));
+    m_dualpass = false;  // Set this explictly so rescaled jobs don't infinate wait
+    if (args.contains(QLatin1String("pass=1"))) m_dualpass = true;
 
+   //Disable logging, it causes an infinate wait on a rescaled render job
     // Create a log of every render process.
-    if (!m_logfile.open(QIODevice::WriteOnly|QIODevice::Text)) qWarning() << "Unable to log to " << m_logfile.fileName();
-    else m_logstream.setDevice(&m_logfile);
+//    if (!m_logfile.open(QIODevice::WriteOnly|QIODevice::Text)) qWarning() << "Unable to log //to " << m_logfile.fileName();
+//    else m_logstream.setDevice(&m_logfile);
 }
 
lukefromdc
Registered Member
Posts
27
Karma
0
Some updates: For actual usage, replace the ENTIRE "renderer" directory in the source file with the same directory from 15.04 . It will work without issue rendering to project size and the same as above for rescaling-except that it is more robust and won't hang in an infinate wait stage on any job. Still the same memory leak and soundtrack corruption when rescaling, no memory leak and good sound when not rescaling. Exact same results building the binary as part of 15.08 or just dropping 15.04's version of the finished kdenlive_render into /usr/bin.

The purpose of the patch was to identify the code causing a rescaled render job to "finish" instantly with no output, I believe I found that. On the other hand, the patched file only worked with certain render jobs, hanging in infinate wait on other jobs. I will continue to experiment with this.The above patch is not for use, it's only purpose was to find out why it's possible to rescale with the 15.04 renderer dropped into 15.08 but not with the normal 15.08 version of kdenlive_render.

One thing I also found was that it sometimes is necessary to "make clean" reconfigure, and rebuild all of kdenlive after changing out these files, or all render jobs will hang. If I can ever come up with a patch that allows rescaling without that massive memory leak I will post it here. This is my first time hacking the kdenlive code, until now I've mostly worked with the MATE desktop environment, themes, and shell scripts for encrpting files.

There is also a render bug (at least with the AMD radeon driver) if Movit is used: rendering is to a player at the video's resolution, not to a file! An empty file is made, at the end of playback the renderjob hangs. Disabling Movit restores normal rendering but obviously cannot render a project with Movit-dependant effects or transitions.


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot]