Choppy desync sound in playback and rendering - MLT bug

Playback in both Monitors appears to be "choking", sound is unlistenable (rattling, jerking) and not synchronized with video, video is jerking too.
Problems start after a few first seconds of playback, CPU rocketed to 100% and then sound starts rattling and after a more couples of seconds also video.
Sometimes helps to stop movie, wait until CPU drops, and then continue playback, it helps just for a few next seconds however.

And what is the worst rendered output behaves the same! Sound is completely corrupted there, unlistenable, desynchronized, much quicker then video. Tested in mplayer and xine.

All tested clips are OK in 0.4 version, CPU is 90%-100% but playback is fluent. Both playback and render.

All clips are MPEG2 PS VOBs as usual and rendered to the same format.

ffplay shows clip OK, so I guess it is not ffmpeg issue.

How can I test MLT?

For me it appears as a buffer like problem, somewhat between kdenlive x mlt x ffmpeg, must be in the same function (layer) shared for both playback and render.

Because rendered output is affected too I doubt it is problem of audio driver
Anyway I have tested OSS, Alsa, Arst.

This may be the same bug as in


however no problems with rendering are mentioned by jmpoure and the problem is described as a latency problem.

I have to mention my another other problems with Clip and Timeline Monitor



Tested on kdenlive_builder build, all newest SVN sources - 22.6.2007, but affected is also 16.6.2007 version. Don't know with older ones.
ffmpeg, mlt, kdenlive - all builded.

Tried to enable or disable mmx support in mtl, remove some codec support from ffmpeg - no change.

This makes kdenlive unusable to me :(


This seems to be a MLT bug, not Kdenlive.
I have just tried 0.4 running against both mlt and ffmpeg from SVN (fresh from 22.6.2007) and the same problems appeared.
I have also tested 0.5 running against system versions of mlt 0.2.3 and ffmpeg - and it worked!

So this is definitively not a kdenlive bug, most probably a MLT one. I can try contact Dan on mail list to help with this.

More info. This is what I have sent to maillist:

Serious MLT audio bug - probably related to interlacing

MLT bug probably related to latest interlacing support. Audio is TWICE as speed as video.
This affect both kdenlive playback in monitors and rendering to file.

When you watch rendered video clip audio stops exactly in the middle of movie.
Sound is choppy and somewhat "compressed" all human voices sound "clownish".
When playbacked in inigo or Kdenlive sound is very choppy, hardly listenable and even video jerking, choking and bursting again in waves.

Testing files: ... p.kdenlive ... _clip2.vob


1/ playback in inigo
espinosa@esplaptop:~/build/kdenlive/bin> ./inigo ~/video2/test_beach_clip.kdenlive

2/ render using inigo - plain

espinosa@esplaptop:~/build/kdenlive/bin> ./inigo ~/video2/test_beach_clip.kdenlive -consumer avformat:/home/espinosa/test2.vob real_time=0

3/ render using inigo - ildtc and ilme

espinosa@esplaptop:~/build/kdenlive/bin> ./inigo ~/video2/test_beach_clip.kdenlive -consumer avformat:/home/espinosa/test3.vob real_time=0 ildct=1 ilme=1
+-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+
|1=-10| |2= -5| |3= -2| |4= -1| |5=  0| |6=  1| |7=  2| |8=  5| |9= 10|
+-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+
No accelerated IMDCT transform found
Current Position:        297

All the same. Choppy "compressed" sound, audio finishes in the middle of playback in xine or mplayer.


The old mlt 0.2.3 is OK
Tested on kdenlive (playback, render) and ingo (playback, render)
The same test set - everything OK. Not tested in HW DVD player - it is another story.


This bug affects heavily both kdenlive playback (timeline monitor, clip monitor) and render.
See this bugreports:




3 different reporters encountered this problem

After latest SVN MLT changes rev 991, a small bug on startup:


Starting program: /usr/bin/kdenlive 
[Thread debugging using libthread_db enabled]
[New Thread 47106140971024 (LWP 7886)]
Qt: gdb: -nograb added to command-line options.
         Use the -dograb option to enforce grabbing.
kbuildsycoca running...
DCOP Cleaning up dead connections.
kdenlive: Mlt inited
kdenlive: Creating new document
kdenlive: deleting contents...
kdenlive: Creating new document DONE 
kdenlive: ****************  INIT DOCUMENT VIEW ***************
kdenlive: Mlt inited
Failed to load plugin: /usr/share/mlt/modules/ undefined symbol: img_convert

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 47106140971024 (LWP 7886)]
mlt_properties_set_int (this=0x0, name=0x2ad7c24ae2d5 "forced", value=3) at mlt_properties.c:275
275             property_list *list = this->local;

(gdb) bt
#0  mlt_properties_set_int (this=0x0, name=0x2ad7c24ae2d5 "forced", value=3) at mlt_properties.c:275
#1  0x00002ad7c24ae015 in consumer_start (parent=0xc58340) at consumer_sdl_still.c:165
#2  0x00002ad7c24ac845 in consumer_start (parent=0xcb8350) at consumer_sdl_preview.c:208
#3  0x00002ad7ba54bbdc in Mlt::Consumer::start () from /usr/lib/
#4  0x00000000004eaa79 in KRender::start ()
#5  0x00000000004b0b4c in Gui::KdenliveApp::activateClipMonitor ()
#6  0x00000000004b0fb9 in Gui::KdenliveApp::initMonitors ()
#7  0x00000000004cf923 in Gui::KdenliveApp::KdenliveApp ()
#8  0x0000000000507e4e in main ()

Failed to load plugin: /usr/share/mlt/modules/ undefined symbol: img_convert

looks to be a bad problems. Perhaps you forgot to configure MLT with --enable-gpl and --avformat-swscale.

Here is the link to that MLT wiki topic on build tips: ... /BuildTips

A recent change to the build scripts is that --avformat-svn now statically links the MLT module with the ffmpeg libs to alleviate shared lib conflicts.

I added --avformat-swscale and it works fine.
Looks like --avformat-swscale is a requirement.

Seems to work for me too.
Builded using kdenlive_builder script, where indeed the right and recommended SW scaler settings are used ;-)

espinosa@esplaptop:~/src> ./ info
FFmpeg SVN version:
Revision: 9435
Last Changed Date: 2007-06-26 17:13:44 +0100 (Tue, 26 Jun 2007)
MLT SVN version:
Revision: 991
Last Changed Date: 2007-06-26 07:57:09 +0100 (Tue, 26 Jun 2007)
MLT++ SVN version:
Revision: 991
Last Changed Date: 2007-06-12 07:00:29 +0100 (Tue, 12 Jun 2007)
Kdenlive SVN version:
Revision: 1604
Last Changed Date: 2007-06-24 17:53:51 +0100 (Sun, 24 Jun 2007)

Note: uses LD_RUN_PATH technique to stitch together particular libs, an alternative to statically linked mlt and ffmpeg, but more general, it is applicaple to any library(ies) and binary, not just mlt and ffmpeg.

This is the same bug that I reported here:


Unfortunately, I'm not sure I'm skilled enough to build MLT with all the appropriate settings. The stable and svn Ubuntu versions that I downloaded both exhibited this problem. Perhaps those who are building the binaries (i.e. the links listed here: ... ing#Ubuntu

) should be notified.

At any rate, thanks for at least identifying the problem.

adibudeen wrote:
Unfortunately, I'm not sure I'm skilled enough to build MLT with all the appropriate settings.

Use kdenlive_builder script, it builds all ffmpeg, mlt and kdenlive with recommended options.
You need to be skilled just to run a command from commandline :)

A new version of MLT will be released with Kdenlive 0.5

It looks like that did the trick for me. Everything seems to be working. The script wasn't quite as automatic with ffmpeg as I'd hoped (some weird problems with FAAD), but after getting through that, everything compiled fine. The choppy sounds problem is gone.

Thanks for helping out. This is definitely the best free and open source video editor.

I've been trying to follow this post because I have the problem with the sound running ahead of the video - not double speed, but definitely ahead, and it grows the more clips you try to put together. I am running Ubuntu Linux version 7.10 ("Gutsy").

Following the suggestions, I got the svn for ffmpeg and got it made, then the mlt-0.2.3 and got it made. I then got the svn for mlt++ and ran into an error. The output from the configure and make follows. It should also be noted that when I ran the configure for ffmpeg I added the --disable-mpegaudio-hp as the --help indicated it was faster but less accurate (I assume they mean when it is on?), just in case the "less accurate" could translate into sync problems with the video.

Any help with this would be greatly appreciated!

Dave ;)

dave@dave-desktop:~/mlt++-0.2.2$ ./configure --prefix=/usr --enable-gpl --disable-mmx --avformat-swscale --enable-motion-est
MLT++ configured - will be installed in /usr.
dave@dave-desktop:~/mlt++-0.2.2$ make
make DESTDIR= -C src all
make[1]: Entering directory `/home/dave/mlt++-0.2.2/src'
g++ -pthread -Wall -fPIC -I/usr/include -I/usr/include/mlt -D_REENTRANT -c -o MltConsumer.o MltConsumer.cpp
g++ -pthread -Wall -fPIC -I/usr/include -I/usr/include/mlt -D_REENTRANT -c -o MltDeque.o MltDeque.cpp
g++ -pthread -Wall -fPIC -I/usr/include -I/usr/include/mlt -D_REENTRANT -c -o MltEvent.o MltEvent.cpp
g++ -pthread -Wall -fPIC -I/usr/include -I/usr/include/mlt -D_REENTRANT -c -o MltFactory.o MltFactory.cpp
g++ -pthread -Wall -fPIC -I/usr/include -I/usr/include/mlt -D_REENTRANT -c -o MltField.o MltField.cpp
g++ -pthread -Wall -fPIC -I/usr/include -I/usr/include/mlt -D_REENTRANT -c -o MltFilter.o MltFilter.cpp
g++ -pthread -Wall -fPIC -I/usr/include -I/usr/include/mlt -D_REENTRANT -c -o MltFilteredConsumer.o MltFilteredConsumer.cpp
g++ -pthread -Wall -fPIC -I/usr/include -I/usr/include/mlt -D_REENTRANT -c -o MltFrame.o MltFrame.cpp
g++ -pthread -Wall -fPIC -I/usr/include -I/usr/include/mlt -D_REENTRANT -c -o MltGeometry.o MltGeometry.cpp
g++ -pthread -Wall -fPIC -I/usr/include -I/usr/include/mlt -D_REENTRANT -c -o MltMiracle.o MltMiracle.cpp
g++ -pthread -Wall -fPIC -I/usr/include -I/usr/include/mlt -D_REENTRANT -c -o MltMultitrack.o MltMultitrack.cpp
g++ -pthread -Wall -fPIC -I/usr/include -I/usr/include/mlt -D_REENTRANT -c -o MltParser.o MltParser.cpp
g++ -pthread -Wall -fPIC -I/usr/include -I/usr/include/mlt -D_REENTRANT -c -o MltPlaylist.o MltPlaylist.cpp
g++ -pthread -Wall -fPIC -I/usr/include -I/usr/include/mlt -D_REENTRANT -c -o MltProducer.o MltProducer.cpp
g++ -pthread -Wall -fPIC -I/usr/include -I/usr/include/mlt -D_REENTRANT -c -o MltProperties.o MltProperties.cpp
g++ -pthread -Wall -fPIC -I/usr/include -I/usr/include/mlt -D_REENTRANT -c -o MltPushConsumer.o MltPushConsumer.cpp
g++ -pthread -Wall -fPIC -I/usr/include -I/usr/include/mlt -D_REENTRANT -c -o MltResponse.o MltResponse.cpp
g++ -pthread -Wall -fPIC -I/usr/include -I/usr/include/mlt -D_REENTRANT -c -o MltService.o MltService.cpp
g++ -pthread -Wall -fPIC -I/usr/include -I/usr/include/mlt -D_REENTRANT -c -o MltTokeniser.o MltTokeniser.cpp
g++ -pthread -Wall -fPIC -I/usr/include -I/usr/include/mlt -D_REENTRANT -c -o MltTractor.o MltTractor.cpp
g++ -pthread -Wall -fPIC -I/usr/include -I/usr/include/mlt -D_REENTRANT -c -o MltTransition.o MltTransition.cpp
g++ -shared -Wl,-soname, -o MltConsumer.o MltDeque.o MltEvent.o MltFactory.o MltField.o MltFilter.o MltFilteredConsumer.o MltFrame.o MltGeometry.o MltMiracle.o MltMultitrack.o MltParser.o MltPlaylist.o MltProducer.o MltProperties.o MltPushConsumer.o MltResponse.o MltService.o MltTokeniser.o MltTractor.o MltTransition.o -L/usr/lib -lmlt -L/usr/lib -lmiracle
ln -sf
make[1]: Leaving directory `/home/dave/mlt++-0.2.2/src'
make -C test all
make[1]: Entering directory `/home/dave/mlt++-0.2.2/test'
g++ -pthread -Wall -fPIC -I/usr/include -I/usr/include/mlt -D_REENTRANT -Wall -g `mlt-config --cflags` -I ../src -c -o play.o play.cpp
c++ -L/usr/lib -lmlt -L/usr/lib -lmiracle -L../src -lmlt++ -lmiracle -lvalerie `mlt-config --libs` play.o -o play
/usr/bin/ld: warning:, needed by /usr/lib/, may conflict with
/usr/bin/ld: warning:, needed by /usr/lib/, may conflict with
/usr/bin/ld: warning:, needed by /usr/lib/, may conflict with
/usr/bin/ld: warning:, needed by /usr/lib/, may conflict with
/usr/bin/ld: warning:, needed by /usr/bin/../lib/, may conflict with
play.o: In function `main':
/home/dave/mlt++-0.2.2/test/play.cpp:7: undefined reference to `Mlt::Factory::init(char*)'
/home/dave/mlt++-0.2.2/test/play.cpp:8: undefined reference to `Mlt::Producer::Producer(char*, char*)'
collect2: ld returned 1 exit status
make[1]: *** [play] Error 1
make[1]: Leaving directory `/home/dave/mlt++-0.2.2/test'
make: *** [all] Error 2