Any attempt at H.264 fails to produce video


Using the latest SVN Kdenlive and git MLT (as of the time of this writing), attempting to render anything using libx264 produces a tiny file containing audio only. My x264 --version is "0.75.1251M e553a4c" and ffmpeg is built with --enable-libx264. libx264 shows up in the supported codecs in Kdenlive as well.

Using the "File rendering" destination I can render MPEG-2, MPEG-4, XVid4, Flash and Theora with success. The RealVideo files also have no video, but I'm not concerned about that (I'm on amd64 and Real stuff usually doesn't work anyway).

Please let me know what else I can try or what info I can provide to help. Thanks.


I am using latest versions as well, except x264. I just updated x264 from Git (I had been using a April checkout), and I can confirm this is a bug somewhere between ffmpeg and the Kdenlive render profiles. I think some x264 parameter requirements changed and ffmpeg needs updating for sensible defaults. Some of the ffmpeg command line -vpre presets work, and others do not. x264 wants some particular combination that is hard to come up with. -vpre is supposed to help that, but apparantly they too have fallen out-of-sync with x264 requirments. MLT and Kdenlive do not support ffmpeg utility's -vpre presets. So, we have to figure out what the magic incantation of options to make it work or wait for ffmpeg's libx264 integration to catch up with supplying more sensible defaults.

What you can do today is locate libx264-default.ffpreset (which does work at the command line) and put its options into a custom Kdenlive render profile: $ cat ffpresets/libx264-default.ffpreset | xargs

coder=1 flags=+loop cmp=+chroma partitions=+parti8x8+parti4x4+partp8x8+partb8x8 me_method=hex subq=7 me_range=16 g=250 keyint_min=25 sc_threshold=40 i_qfactor=0.71 b_strategy=1 qcomp=0.6 qmin=10 qmax=51 qdiff=4 bf=3 refs=3 directpred=1 trellis=1 flags2=+mixed_refs+wpred+dct8x8+fastpskip

...but I still could not get that to work. You just need to downgrade x264 and rebuild ffmpeg, but I can not give you a specific latest x264 version that will at this time.

Ah-ha, thanks for the research. The x264 version I'm using is apparently a snapshot from 20090908. Gentoo has three earlier ebuilds in Portage (going as far back as October 2008) so I will try those later today and report back any success/failure and try to figure out where the breakage started.

Okay, I went back to an x264 from 20090629 (x264 --version: x264 0.67.1173M f6d3166) and now it works! Thank you very much for your help.

The .so name for the September build (the one that didn't work) was but the older version is so they've obviously changed some things. I also had to rebuild everything that depended on libx264 to ensure it was using the older .so (ffmpeg, mplayer, vlc, transcode and libquicktime).

Thanks again.

A new chapter in the saga, beginning today ffmpeg from SVN requires the newest libx264 version. So I guess this problem will become a problem for more people.

OK, after much trial and error exploring the ffpreset files, I have determined that I need to add the following to the Kdenlive profiles to get it to work:
subq=7 qmin=10 qcomp=0.6 qdiff=4

Some of lossless ones require qmax=51 in addition to them.
I will have to test the updated Kdenlive profiles against older versions of ffmpeg/x264 before committing.

It works! I had been trying various things but it was basically an exercise in the "infinite monkeys" theory. :) I appreciate your help and hard work, thanks.

Just a note to say the Render profiles have been in Subversion for the next release.