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

Export/rendering failure [Solved]

Tags: None
(comma "," separated)
olo
Registered Member
Posts
72
Karma
0

Re: Export/rendering failure

Sun Jun 10, 2007 1:38 pm

I've tried some of the ideas from this thread to track down the problem. Here are my observations:



1) I've had multiple versions of libavformat and libavcodec on Ubuntu Feisty. I've uninstalled the older ones (from the official Ubuntu repositories) and left out only the latest from http://ubuntu.tonio.homelinux.org/.



Then I've rebuilt mlt, mlt++ and kdenlive. It didn't solve the problem.



2) I've launched kdenlive_renderer from gdb:




gdb kdenlive_renderer
...
(gdb) run KDEnlive_project_2.kdenlive real_time=0 resize=hyper in=0 out=17057 -consumer avformat /home/olo/Movies_temp/output/from_KDEnlive_4.vob aspect_ratio=1.06667 display_ratio=1.33333 format=dvd aspect=4:3 vcodec=mpeg2video acodec=ac3 video_bit_rate=6500000 video_rc_max_rate=8000000 video_rc_min_rate=0 video_rc_buffer_size=1835008 mux_packet_size=2048 mux_rate=10080000 audio_bit_rate=192000 audio_sample_rate=48000 frame_size=720x576 frame_rate=25 gop_size=15 me_range=63 real_time=0 stats_on=1 qscale=0 > /home/olo/Movies_temp/output/from_KDEnlive_4_STDOUT.vob
Starting program: /usr/bin/kdenlive_renderer KDEnlive_project_2.kdenlive real_time=0 resize=hyper in=0 out=17057 -consumer avformat /home/olo/Movies_temp/output/from_KDEnlive_4.vob aspect_ratio=1.06667 display_ratio=1.33333 format=dvd aspect=4:3 vcodec=mpeg2video acodec=ac3 video_bit_rate=6500000 video_rc_max_rate=8000000 video_rc_min_rate=0 video_rc_buffer_size=1835008 mux_packet_size=2048 mux_rate=10080000 audio_bit_rate=192000 audio_sample_rate=48000 frame_size=720x576 frame_rate=25 gop_size=15 me_range=63 real_time=0 stats_on=1 qscale=0 > /home/olo/Movies_temp/output/from_KDEnlive_4_STDOUT.vob
[Thread debugging using libthread_db enabled]
[New Thread -1208846656 (LWP 16086)]
[New Thread -1216861296 (LWP 16089)]
[New Thread -1227760752 (LWP 16090)]
[Thread -1216861296 (LWP 16089) exited]

[Thread -1227760752 (LWP 16090) exited]

Program exited normally.
(gdb)


It didn't crash, exited normally but it has interrupted the the job in the middle (the output VOB has a length of 00:03:53, while the project has 00:11:22).



3) The project files saved by KDEnlive (both tempporary and File->Save As) seem corrupted - it looks like some portion of XML is chopped off at the end. Maybe the renderer exits when an internal inconsistency occurs because of incomplete project data?



4) kdenlive_renderer sends its output to STDOUT - is this behaviour correct?



olo
Registered Member
Posts
72
Karma
0

Re: Export/rendering failure

Sun Jun 10, 2007 1:51 pm

One more observation:



5) Looking at kdenlive_renderer commandline:




kdenlive_renderer KDEnlive_project_2.kdenlive real_time=0 resize=hyper in=0 out=17057 -consumer avformat /home/olo/Movies_temp/output/from_KDEnlive_4.vob aspect_ratio=1.06667 display_ratio=1.33333 format=dvd aspect=4:3 vcodec=mpeg2video acodec=ac3 video_bit_rate=6500000 video_rc_max_rate=8000000 video_rc_min_rate=0 video_rc_buffer_size=1835008 mux_packet_size=2048 mux_rate=10080000 audio_bit_rate=192000 audio_sample_rate=48000 frame_size=720x576 frame_rate=25 gop_size=15 me_range=63 real_time=0 stats_on=1 qscale=0


I can see that there's a file argument after "-consumer avformat". kdenlive_renderer won't start if this file doesn't exist or isn't a valid VOB file (it outputs the "Usage: kdenlive_renderer ..." help message), but if the VOB file exists, it starts the job but doesn't write to that file (maybe it reads from it?).



olo
Registered Member
Posts
72
Karma
0

Re: Export/rendering failure

Sun Jun 10, 2007 2:58 pm

Now that's interesting. kdenlive_renderer, when called from kdenlive, crashes with SIGSEGV in fact.



It dumps core, and I've extracted some backtraces from the core (unfortunately, stack seems corrupt in those):




$ gdb /usr/bin/kdenlive_renderer ~/core.30028

...

Loaded symbols for /usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-png.so
Core was generated by `kdenlive_renderer /tmp/kde-olo/kdenliveKZzlac.westley real_time=0 resize=hyper'.
Program terminated with signal 6, Aborted.
#0 0xffffe410 in __kernel_vsyscall ()
(gdb) info threads
2 process 30028 0xb7effefd in mlt_property_get_position (this=0x8079310) at mlt_property.c:206
* 1 process 30029 0xffffe410 in __kernel_vsyscall ()
(gdb) thread apply all bt

Thread 2 (process 30028):
#0 0xb7effefd in mlt_property_get_position (this=0x8079310) at mlt_property.c:206
#1 0xb7f00ee1 in mlt_properties_get_position (this=0x8078018, name=0xb7f10720 "_position") at mlt_properties.c:663
#2 0xb7f055e5 in mlt_producer_position (this=0x8078018) at mlt_producer.c:274
#3 0x08048bbc in transport (producer=0x8078018, consumer=0x8083010) at /home/opt/soft/Graphics/KDEnlive/SVN/build/2007-06-10.2/kdenlive/renderer/kdenlive_renderer.c:43
#4 0x08048fa4 in main (argc=29, argv=0xbfe2cd94) at /home/opt/soft/Graphics/KDEnlive/SVN/build/2007-06-10.2/kdenlive/renderer/kdenlive_renderer.c:147

Thread 1 (process 30029):
#0 0xffffe410 in __kernel_vsyscall ()
#1 0x45a72df0 in raise () from /lib/tls/i686/cmov/libc.so.6
#2 0x45a74641 in abort () from /lib/tls/i686/cmov/libc.so.6
#3 0x45a6c43b in __assert_fail () from /lib/tls/i686/cmov/libc.so.6
#4 0x4dd4e95a in ff_rate_estimate_qscale () from /usr/lib/libavcodec.so.1d
#5 0x08613b08 in ?? ()
#6 0x08613788 in ?? ()
#7 0xb7f107de in ?? () from /usr/lib/libmlt.so.0.2.3
#8 0x45aacb54 in _IO_setb_internal () from /lib/tls/i686/cmov/libc.so.6
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb)


olo
Registered Member
Posts
72
Karma
0

Re: Export/rendering failure

Sun Jun 10, 2007 3:13 pm

BTW, the above was reproduced using a clean build, with this afternoon's SVN version of mlt, mlt++ and kdenlive.



I've also removed all older versions of libavformat, libavcodec, libpostproc, libavutil before compiling to make sure the build is absolutelty clean.



Currently I have only FFMPEG libraries from http://ubuntu.tonio.homelinux.org/, their version is from CVS from 2007-03-07:




# dpkg -l | grep ffmpeg
ii ffmpeg 0.cvs20070307-4ubuntu1 multimedia player, server and encoder
rc libavcodec0d 0.cvs20060823-3.1ubuntu4 ffmpeg codec library
ii libavcodec1d 0.cvs20070307-4ubuntu1 ffmpeg codec library
rc libavformat0d 0.cvs20060823-3.1ubuntu4 ffmpeg file format library
ii libavformat1d 0.cvs20070307-4ubuntu1 ffmpeg file format library
ii libavutil1d 0.cvs20070307-4ubuntu1 ffmpeg utility library
rc libpostproc0d 0.cvs20060823-3.1ubuntu4 ffmpeg video postprocessing library
ii libpostproc1d 0.cvs20070307-4ubuntu1 ffmpeg video postprocessing library
ii libswscale1d 0.cvs20070307-4ubuntu1 ffmpeg video scaling library
ii libxine1-ffmpeg 1.1.6-1 mpeg related plugins for libxine1


You can see the old libraries in the rc state.

According to http://www.infodrom.org/Debian/doc/main ... ml#s3.10.3 , it means "rc - The package is removed, won't get reinstalled but still has its configuration files installed." - so those libraries aren't present in the system anymore.



olo
Registered Member
Posts
72
Karma
0

Re: Export/rendering failure

Sun Jun 10, 2007 3:35 pm

The previous backtrace was from exporting the timeline to DVD format.



Here's a backtrace from exporting the timeline to XviD 720x576 in medum quality:



Core was generated by `kdenlive_renderer /tmp/kde-olo/kdenliveLx47nb.westley real_time=0 resize=hyper'.
Program terminated with signal 6, Aborted.
#0 0xffffe410 in __kernel_vsyscall ()
(gdb) info threads
2 process 30877 0xb7fbe2ef in mlt_properties_get_int (this=0x8078018, name=0x804913b "done") at mlt_properties.c:290
* 1 process 30878 0xffffe410 in __kernel_vsyscall ()

(gdb) thread apply all bt

Thread 2 (process 30877):
#0 0xb7fbe2ef in mlt_properties_get_int (this=0x8078018, name=0x804913b "done") at mlt_properties.c:290
#1 0x08048bfc in transport (producer=0x8078018, consumer=0x8082d20) at /home/opt/soft/Graphics/KDEnlive/SVN/build/2007-06-10.2/kdenlive/renderer/kdenlive_renderer.c:40
#2 0x08048fa4 in main (argc=21, argv=0xbfb2bb54) at /home/opt/soft/Graphics/KDEnlive/SVN/build/2007-06-10.2/kdenlive/renderer/kdenlive_renderer.c:147

Thread 1 (process 30878):
#0 0xffffe410 in __kernel_vsyscall ()
#1 0x45a72df0 in raise () from /lib/tls/i686/cmov/libc.so.6
#2 0x45a74641 in abort () from /lib/tls/i686/cmov/libc.so.6
#3 0x45a6c43b in __assert_fail () from /lib/tls/i686/cmov/libc.so.6
#4 0x4dd4e95a in ff_rate_estimate_qscale () from /usr/lib/libavcodec.so.1d
#5 0x00000010 in ?? ()
#6 0x00000000 in ?? ()
(gdb)


From exporting to XviD 320x200 in medium quality:




Core was generated by `kdenlive_renderer /tmp/kde-olo/kdenlive3I6cVa.westley real_time=0 resize=hyper'.
Program terminated with signal 6, Aborted.
#0 0xffffe410 in __kernel_vsyscall ()
(gdb) info threads
2 process 30901 0xb7fc95e0 in mlt_producer_position (this=0x8078018) at mlt_producer.c:274
* 1 process 30902 0xffffe410 in __kernel_vsyscall ()
(gdb) thread apply all bt

Thread 2 (process 30901):
#0 0xb7fc95e0 in mlt_producer_position (this=0x8078018) at mlt_producer.c:274
#1 0x08048bbc in transport (producer=0x8078018, consumer=0x8082d20) at /home/opt/soft/Graphics/KDEnlive/SVN/build/2007-06-10.2/kdenlive/renderer/kdenlive_renderer.c:43
#2 0x08048fa4 in main (argc=21, argv=0xbfe5e684) at /home/opt/soft/Graphics/KDEnlive/SVN/build/2007-06-10.2/kdenlive/renderer/kdenlive_renderer.c:147

Thread 1 (process 30902):
#0 0xffffe410 in __kernel_vsyscall ()
#1 0x45a72df0 in raise () from /lib/tls/i686/cmov/libc.so.6
#2 0x45a74641 in abort () from /lib/tls/i686/cmov/libc.so.6
#3 0x45a6c43b in __assert_fail () from /lib/tls/i686/cmov/libc.so.6
#4 0x4dd4e95a in ff_rate_estimate_qscale () from /usr/lib/libavcodec.so.1d
#5 0x00000010 in ?? ()
#6 0x00000000 in ?? ()
(gdb)


What's interesting - export to Theora (320x240, medium quality) and Quicktime (720x480, medium quality) doesn't crash!



Also earlier attempts to export to small XviD (320x200, high quality) have succeeded - but now they crash.



MPEG4 320x200, Flash 320x240 crash, but ordinary MPEG exports fine in 320x200 while it crashes in 640x480 and 720x576.



So this problem largely depends on output format.



j-b-m
Registered Member
Posts
804
Karma
1

Re: Export/rendering failure

Sun Jun 10, 2007 6:32 pm

Ok, I think I may know what your problem is. Both of you have a debian version of FFMPEG. There was a bug in FFMPEG some time ago that required the qscale parameter to be set to 1 or that would cause crashes on export. 3 weeks ago I realised that this setting caused the avformat producer to ignore video bitrate setting, and also that the crash in FFMPEG had disappeared.



So I reverted the qscale default value to 0 ( see my commit: http://svn.sourceforge.net/viewvc/kdenl ... 16&r2=1517 )



But I left it by default at 1 in MLT's inigo player. That seems to explain everything, haha!



I just comited a fix to Kdenlive that will allow you to override the default qscale value. So please both of you, update your Kdenlive svn, and try adding qscale=1 to your avformat parameters. This should fix your crash, but the video bitrate will not work anymore.



Then, the real solution will be to find an updated FFMPEG version that does not crash on qscale=0...



Waiting for your feedback.

jb

olo
Registered Member
Posts
72
Karma
0

Re: Export/rendering failure

Sun Jun 10, 2007 11:56 pm

Do we have to create custom encoding options, or did I miss UI to set only this?



BTW, the corrupted XML in saved projects seems a different unrelated problem?



jmpoure_drupal
Registered Member
Posts
735
Karma
0

Re: Export/rendering failure

Mon Jun 11, 2007 7:43 am

Dear JB,



Some time ago, you informed me that my MLT was linked against an old version of ffmeg.

How can I sure to compile MLT against a recent version of ffmeg?

Read this thread : viewtopic.php?f=6&t=46



Marrilat compiled libavformat and mlt in a chroot, which is not my case.

How can I choose the version of libavformat I am compiling against?



Kind regards,

Jean-Michel

olo
Registered Member
Posts
72
Karma
0

Re: Export/rendering failure

Tue Jun 12, 2007 2:18 pm

OK, I've created 2 custom export settings based on DVD export template, and appended qscale=1 to the first and qscale=0.



The qscale=1 job proceeds successfully, the qscale=0 crashes after exporting a couple of seconds.



So you were totally right.



BTW, I like the new default GUI layout with the latest SVN version, especially the fact that project tree is on by default :)



espinosa_cz
Registered Member
Posts
118
Karma
0
OS

Re: Export/rendering failure

Sat Jun 16, 2007 8:22 pm

jmpoure wrote:
How can I be sure that MLT selects the right libavcodec?


try

ldd ./kdenlive

or more detailed

LD_DEBUG=libs ./kdenlive

in directory where your make install your kdenlive
olo
Registered Member
Posts
72
Karma
0

Re: Export/rendering failure

Sat Jun 16, 2007 10:09 pm

In my case it's:




28168: find library=libavcodec.so.1d [0]; searching
28168: trying file=/usr/lib/i686/cmov/libavcodec.so.1d
28168: trying file=/usr/lib/i686/libavcodec.so.1d
28168: trying file=/usr/lib/libavcodec.so.1d
28168: calling init: /usr/lib/libavcodec.so.1d
28168: calling fini: /usr/lib/libavcodec.so.1d [0]

...

$ dpkg -S /usr/lib/libavcodec.so.1d
libavcodec1d: /usr/lib/libavcodec.so.1d

$ dpkg -l libavcodec1d
ii libavcodec1d 0.cvs20070307-4ubuntu1 ffmpeg codec library


Seems quite recent (2007-03-07). What versions of ffmpeg have that bug fixed? I've googled out a discussion about qscale-related crash in FFmpeg from September 2005, but this one must be a different one?



espinosa_cz
Registered Member
Posts
118
Karma
0
OS

Re: Export/rendering failure

Sun Jun 17, 2007 11:34 am

So the /usr/lib/libavcodec.so.1d was used, the distribution version. Is that what you wanted?

I wrote a more detailed HOWTO:

viewtopic.php?f=8&t=69



Try my build script from this post (I need some tester's ;-)

viewtopic.php?f=8&t=68

It's an easy to use way how to build latest ffmpeg + mlt + Kdenlive from the latest vanilla sources with suggested config parameters.

And try it again and share the results with us.

olo
Registered Member
Posts
72
Karma
0

Re: Export/rendering failure

Mon Jun 18, 2007 10:41 pm

espinosa_cz wrote:
So the /usr/lib/libavcodec.so.1d was used, the distribution version. Is that what you wanted?

I wrote a more detailed HOWTO:

viewtopic.php?f=8&t=69



Well, it's not the distribution version, but a newer version from a cutting edge repository located here:



http://ubuntu.tonio.homelinux.org/



The distribution version was "libavformat0d 0.cvs20060823-3.1ubuntu4".

The version from Tonio, which I have installed, is "libavformat1d 0.cvs20070307-4ubuntu1".



espinosa_cz wrote:


Try my build script from this post (I need some tester's ;-)

viewtopic.php?f=8&t=68

It's an easy to use way how to build latest ffmpeg + mlt + Kdenlive from the latest vanilla sources with suggested config parameters.

And try it again and share the results with us.



I'm afraid of breaking my FFmpeg installation this way, since your scripts installs the latest version in /usr.



But what about the "--avformat-svn" configure option for MLT?



It seems that with this option, the latest SVN version of FFmpeg is checked out and built in the build directory, then MLT is linked statically with it. It would guarantee running with the latest FFmpeg version.



I've used it to build MLT today:




./configure --prefix=/usr --enable-debug --enable-gpl --enable-shared --enable-theora --enable-vorbis --enable-libogg --enable-pp --enable-shared-pp --enable-motion-est --avformat-swscale --avformat-svn


I could see the FFmpeg being checked out and built during MLT build, it has definitely happened. I can provide build logs as a proof.



Then I've build and installed MLT++ and KDEnlive (today's SVN versions, too) and run kdenlive with LD_DEBUG=libs.



As expected, no libavformat (nor libavcodec) has shown up this time (because it was statically linked into MLT - as I understand it).



So, currently, I should be using the latest, today's version of FFmpeg when running KDEnlive/MLT.



But still, when I do the timeframe export to DVD format, kdenlive_renderer crashes.



A new fact: I've observed that renderer crashes only when it reaches a transition between two tracks (a crosfade in of a text clip and a DV video clip in my case). And it has to be a transition between text clip and video clip - a crossfade transition between two video clips doesn't cause a crash!



When I've created a timeline consisting of a single clip, or two video clips crossfading at one point, the export went fine.



So the crash is very dependent on project contents.



espinosa_cz
Registered Member
Posts
118
Karma
0
OS

Re: Export/rendering failure

Tue Jun 19, 2007 6:43 pm

olo wrote:


I'm afraid of breaking my FFmpeg installation this way, since your scripts installs the latest version in /usr.



Noooooo! The exact opposite is true! The reason why I created and published this script was to easy and SAFE way how compile it all not breaking anything in your system. All libs, including kdenlive binary, is encapsulated in selected directory. Please read carefully the description.



I cannot help you with the Ubuntu packages, I don't use Ubuntu but SUSE or PCLinux. I can only recommend to compile ffmpeg + mtl + Kdenlive from latest sources, these are the version developers use, this only can exclude buggy (nonstandard) distribution components.

olo
Registered Member
Posts
72
Karma
0

Re: Export/rendering failure

Wed Jun 20, 2007 7:23 am

OK, you're right.



So I've used your script with minor modifications needed to get it working on my system:




--- espinosa_script.sh 2007-06-19 23:00:47.000000000 +0200
+++ espinosa_script-olo.sh 2007-06-20 03:05:25.000000000 +0200
@@ -21,18 +21,18 @@
# Modify the destination directory if you want
# Or you can copy it afterwars to /opt/kdenlive- or wherever you want.
# Caution: if you pick /usr here, you system kdenlive, ffmpeg and mlt will be overwritten!
-export DEST_DIR=~/build/kdenlive
+export DEST_DIR=~/misc/soft/Graphics/KDEnlive/SVN/espinosa/build

case "$1" in

"getsources")
-cd ffmpeg
+#cd ffmpeg
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
-cd ../mlt
+#cd ../mlt
svn co https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt mlt
-cd ../mlt++
+#cd ../mlt++
svn co https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt++ mlt++
-cd ../kdenlive
+#cd ../kdenlive
svn co https://svn.sourceforge.net/svnroot/kdenlive/trunk/kdenlive
;;

@@ -58,8 +58,8 @@

./configure --prefix=$DEST_DIR --enable-gpl --enable-shared --enable-swscaler \
--enable-libogg --enable-pp --enable-libtheora --enable-libmp3lame \
---enable-libfaac --enable-libfaad --enable-libvorbis --enable-liba52 \
---enable-vhook --enable-x11grab --enable-libx264 &&
+--enable-libvorbis --enable-liba52 \
+--enable-vhook --enable-x11grab &&
make &&
make install &&


As you can see I've commented some "cd" commands that didn't make sense and removed some configure options because those libs in my system aren't accepted by configure (wrong versions, probably).



It has built successfully and I've run it with LD_DEBUG=libs.



KDEnlive uses FFmpeg that was checked out from SVN by your script:




$ egrep '(av|swscale)' screenlog.3 | grep calling
5092: calling init: /home/olo/misc/soft/Graphics/KDEnlive/SVN/espinosa/build/lib/libavutil.so.49
5092: calling init: /home/olo/misc/soft/Graphics/KDEnlive/SVN/espinosa/build/lib/libswscale.so.0
5092: calling init: /home/olo/misc/soft/Graphics/KDEnlive/SVN/espinosa/build/lib/libavcodec.so.51
5092: calling init: /home/olo/misc/soft/Graphics/KDEnlive/SVN/espinosa/build/lib/libavformat.so.51
5092: calling init: /home/olo/misc/soft/Graphics/KDEnlive/SVN/espinosa/build/share/mlt/modules/libmltavformat.so
5092: calling fini: /home/olo/misc/soft/Graphics/KDEnlive/SVN/espinosa/build/share/mlt/modules/libmltavformat.so [0]
5092: calling fini: /home/olo/misc/soft/Graphics/KDEnlive/SVN/espinosa/build/lib/libavformat.so.51 [0]
5092: calling fini: /home/olo/misc/soft/Graphics/KDEnlive/SVN/espinosa/build/lib/libavcodec.so.51 [0]
5092: calling fini: /home/olo/misc/soft/Graphics/KDEnlive/SVN/espinosa/build/lib/libswscale.so.0 [0]
5092: calling fini: /home/olo/misc/soft/Graphics/KDEnlive/SVN/espinosa/build/lib/libavutil.so.49 [0]


So I'm using the today's SVN version of FFmpeg.



The crash still occurs when the render process reaches the timeline point where crossfade transition between a text clip and video clip begins.



This is related to export options (qscale=1 results in no crash), but also depends on project content. I suspect a bug in kdenlive_renderer or a not yet known bug in FFmpeg (or both).





Bookmarks



Who is online

Registered users: bancha, Bing [Bot], daret, Evergrowing, Google [Bot], lockheed, sandyvee, Sogou [Bot]