[x264-devel] problem integration libx264 in ffmpeg

Jason Garrett-Glaser darkshikari at gmail.com
Fri Aug 7 03:40:47 CEST 2009


On Thu, Aug 6, 2009 at 6:27 PM, M.A.E.M. Hanson<hansonorders at verizon.net> wrote:
>>> everything is working (configure, make of both libs), but if you
>>> want to start encoding with a call like:
>>> "ffmpeg -i test.XXX -vcodec libx264 test_new.XXX"
>>> there is an error "Error while opening codec for output stream #0.0 -
>>> maybe incorrect parameters such as bit_rate, rate, width or height "
>>> the error message is thrown by the avcodec_open function of ffmpeg.
>>
>> Look up at the actual error message that x264 prints, not at the line
>> ffmpeg prints, which roughly translates to "x264 printed an error,
>> look up and read it!"
>>
>> Dark Shikari
>
> 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).

Dark Shikari


More information about the x264-devel mailing list