[Ffmpeg-devel] [BUG] Error: 2pass curve failed to converge

Loren Merritt lorenm
Tue Jul 18 23:18:31 CEST 2006

On Mon, 17 Jul 2006, Corey Hickey wrote:

> This bug is a bit elusive; it only happens with some source videos with
> some parameters, and is not always the same between amd64 and i386. In
> each case, the second pass fails immediately with the error:
> [mpeg4 @ 0xc840d0]Error: 2pass curve failed to converge

The bug turns out to be unrelated to my earlier suggestion.
Uncomment the printf at ratecontrol.c:908 to see what's going on:

predicted_size target_size rate_factor
23365008.042328 24398207 65536.000000
23365008.042328 24398207 98304.000000
23365008.042328 24398207 114688.000000

So the error message is triggering as intended. It's telling you that it 
can't spend that many bits subject to lmin=2.

But pass1 ended up being vqscale=2 at 828 kbit/s, while you're only asking 
for 817 kbit/s on pass2, and the predicted size for pass2 at vqscale=2 is 
782 kbit/s. So the bug is that even if the 2nd pass's quantizer is the 
same as the 1st pass, it does not predict the size to be exactly what was 
observed in the 1st pass.

--Loren Merritt

More information about the ffmpeg-devel mailing list