[x264-devel] problem integration libx264 in ffmpeg

Jason Garrett-Glaser darkshikari at gmail.com
Fri Aug 7 06:17:09 CEST 2009


On Thu, Aug 6, 2009 at 8:25 PM, M.A.E.M. Hanson<hansonorders at verizon.net> wrote:
> Jason Garrett-Glaser wrote:
>>>
>>> I can confirm I'm have the same issue as the op. Here is my command line:
>>>
>>> ffmpeg -y -i test_material.mpg -f matroska -an -pass 1 -vcodec libx264
>>> -vpre
>>> lossless_fast -threads 0 /dev/null && ffmpeg -y -i test_material.mpg
>>> -acodec
>>> copy -pass 2 -vcodec libx264 -vpre lossless_fast -threads 0
>>> ffmpeg_2pass_lossless_fast.mkv
>>>
>>> The contents of the lossless_fast preset:
>>>
>>> coder=0
>>> flags=+loop
>>> cmp=+chroma
>>> partitions=-parti8x8+parti4x4+partp8x8-partp4x4-partb8x8
>>> me_method=hex
>>> subq=3
>>> 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
>>> directpred=1
>>> flags2=+fastpskip
>>> cqp=0
>>>
>>> and the specific libx264 error (separated for ease of reading):
>>>
>>> Input #0, mpeg, from 'test_material.mpg':
>>> Duration: 00:00:30.17, start: 0.502000, bitrate: 14787 kb/s
>>> Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 1920x1080 [PAR 1:1 DAR
>>> 16:9], 65000 kb/s, 29.97 tbr, 90k tbn, 59.94 tbc
>>> Stream #0.1[0x80]: Audio: ac3, 48000 Hz, 5.1, s16, 384 kb/s
>>>
>>> [libx264 @ 0x869c760]no ratecontrol method specified
>>>
>>> Output #0, matroska, to 'ffmpeg_2pass_lossless_fast.mkv':
>>> Stream #0.0: Video: libx264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9],
>>> q=10-51,
>>> pass 2, 200 kb/s, 90k tbn, 29.97 tbc
>>> Stream #0.1: Audio: ac3, 48000 Hz, 5.1, s16, 384 kb/s
>>> Stream mapping:
>>> Stream #0.0 -> #0.0
>>> Stream #0.1 -> #0.1
>>> Error while opening encoder for output stream #0.0 - maybe incorrect
>>> parameters such as bit_rate, rate, width or height
>>>
>>> The version of x264 installed (I'm running an Arch Linux derived OS) is a
>>> snapshot from 2009-04-16.
>>>
>>> Any ideas what could be causing x264 to complain about a ratecontrol
>>> method?
>>
>> This error *CANNOT APPEAR* unless ffmpeg has been miscompiled.
>>
>> The most common way for this to happen is to compile against a
>> different libx264 than you linked to.  You can check by using "ldd" on
>> your copy of ffmpeg and comparing the x264 API version number against
>> the X264_BUILD specified in the x264.h file in your /usr/local/include
>> (or wherever it is on your system).
>
> Thank you for your quick reply.
>
> [root at mythbox-mbe ~]# ldd /usr/bin/ffmpeg | grep x264
>        libx264.so.67 => /usr/lib/libx264.so.67 (0xb6fec000)
> [root at mythbox-mbe ~]# cat /usr/include/x264.h | grep X264_BUILD
> #define X264_BUILD 67
>
> It seems things are ok... Unless that # is not supposed to be there. Any
> other things I can check?

That looks like it's fine... have you tried compiling ffmpeg+x264 yourself?

Also, note that 2-pass mode doesn't work with lossless.

Dark Shikari


More information about the x264-devel mailing list