Export/rendering failure [Solved]

Dear JB,

I am trying to export a 35 minutes interview, using the mpeg4 high quality option.
Export fails immediately. Can ayone reproduce this bug ?
This is today Kdenlive/mlt SVN versions as usual.

For me, this is a sound problem.
Probably since MLT was modified.

Kind regards,


Thanks, I'll try 9505.

But note that I _am_ using MPEG2. Actually I didn't even test MPEG4 export.

Nope, FFMPEG rev 9505 crashes with assert as usual in the same place.

olo: You have
-consumer avformat /some/file/name
This should be
-consumer avformat:/some/file/name

i.e. a ':' (colon) should separate 'avformat' from the path name, not a space.
when kdenlive_renderer runs, it zeros out the 'colon' so the one argument looks like two.
So when you use 'ps' you don't see the colon. But it needs to be there when you run the program.

You were right!

I've checked in a new version of capture script, could you test it how it works? I've captured a DVD export successfully and it runs fine.

Here's where it's located:


And I've been able to at last see what error does kdenlive_renderer crash with.


Current Position:         73
Current Position:         76
kdenlive_renderer: ratecontrol.c:756: ff_rate_estimate_qscale: Assertion `q>0.0' failed.

The thread about this has started on FFMPEG-devel mailing list:

http://lists.mplayerhq.hu/pipermail/ffm ... 32779.html

Hi guys...i'm having this problem:

I can't render anything...

With ffmpeg...with mencoder...with k9copy...and now, with kdenlive...

Sometime ago, i rip dvd9 to dvd5 well in k9copy...but in this days, the k9copy and the kdenlive are hanging/freezing my system...and ffmpeg and mencoder give a segmentation failure in the videos wiling rendering...

What's it could be?? I think it could be a problem of others here too...

Some clue?

To help ffmpeg debug, make a custom render profile in kdenlive with a .jpg extension and with no avformat parameters. Then, use a filename like kdenlive-%06d.jpg. Render. You can then use the images in ffmpeg ala:
ffmpeg -r 25 -i kdenlive-%06d.jpg -pix_fmt yuv420p ...
You will need to map all the mlt parameters of the render profile you are testing to ffmpeg's options. (In a future version of mlt, I am going to try to adopt ffmpeg's option parsing approach.)

I think I (almost) know what is going on.
There are some magic numbers used to guide mpeg compession. Two of them are i_qfactor and i_qoffset.
There is a 'quantisation factor' that is meant to range from 0.5 to 55 (I think) that guides how much
to 'quantize' various numbers in the image stream. The more you 'quantise', the lower your quality.
The qfactor for one frame is derived in part from the qfactor of previous frames, and sometimes the
calculation will be

        oldqfactor * abs(i_qfactor) + i_qoffset

ffpmeg sets the default for these two values to

   i_qfactor = -0.8
   i_qoffset  = 0.0

mlt, in comsumer_avformat.c sets

		mlt_properties_set_double( properties, "video_i_qfactor", 1.25 );
		mlt_properties_set_double( properties, "video_i_qoffset", -0.8 );

They both have a -0.8, but for different values - odd..

Anyway, if 'oldqfactor' is small, and the above formula is applied, then adding
a qoffset of -0.8 makes the new qfactor negative. This causes the problem.

While I really don't know how these numbers are used, or what you achieve by setting them,
it seems quite clear from the code that a negative qoffset is a dangerous thing.

I think the best solution to our problem is to get rid of it. either change the MLT source,
or get kdenlive to pass video_i_qfactor=-0.8 video_i_qoffset=0 to MLT.

I seems sensible to choose the same defaults that ffmpeg chooses.

It really seems a strange co-incidence that both use -0.8, but at different places.
I wonder if it was a typo...

Just for the record, this problem has been fixing in the MLT SVN. So if you build from SVN,
rendering mpeg files shouldn't crash any more.

Yes, it seems fixed for me too. I've also seen a possibly related checkin to FFMPEG SVN lately.

My test project exports to DVD format correctly now. SVN revisions I'm using:

FFmpeg SVN version:
Revision: 9878
Last Changed Date: 2007-08-03 22:49:53 +0200 (Fri, 03 Aug 2007)
MLT SVN version:
Revision: 1022
Last Changed Date: 2007-08-03 06:34:01 +0200 (Fri, 03 Aug 2007)
MLT++ SVN version:
Revision: 1022
Last Changed Date: 2007-06-12 08:00:29 +0200 (Tue, 12 Jun 2007)
Kdenlive SVN version:
Revision: 1658
Last Changed Date: 2007-08-03 20:21:38 +0200 (Fri, 03 Aug 2007)