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

Michael Niedermayer michaelni
Wed Aug 9 12:15:27 CEST 2006


On Wed, Aug 09, 2006 at 11:44:44AM +0200, Sven Over wrote:
> Am Friday 04 August 2006 00:45 schrieb Corey Hickey:
> > > [mpeg4 @ 0xc840d0]Error: 2pass curve failed to converge
> [...]
> > Can anybody fix this? The problem gets reported somewhat regularly on
> > the mplayer/mencoder user lists. If I could fix it myself I would, but
> > the bug is out of my league...
> >
> > I don't want to advocate reverting r5422, since doing so would only mask
> > the bug, but functionally it would still be an improvement over what has
> > been happening.
> Hello.
> I yesterday encountered the "2pass curve failed to converge" problem 
> yesterday, when recoding DVB recorded material with a 528x768 resolution to a 
> PAL-DVD compliant 720x768 resolution. Since I have plenty of space on the DVD 
> and the original material has already poor quality (video bitrates around 
> 2000kbit/s are quite usual), I want to do whatever I can in order not to 
> degrade the quality even more. Therefore I use 2pass encoding and increase 
> the bitrate for the recoding process, depending on how much space I have on 
> the DVD. It turns out that sometimes I can increase the video bitrate by 70% 
> or so.
> In this scenario, I find it quite natural, that ffmpeg cannot spend all the 
> bits I offer. There is simply not enough information in the original video 
> material that it can be encoded in such high bitrates. I guess reencoding 
> with a 70% higher bitrate is a ridiculous idea itself. Anyway, in this case I 
> don't want ffmpeg to exit with an error. Instead it should just use as many 
> bits as needed, and so the resulting file will be smaller than calculated, 
> but is of optimal quality.
> In order to have it like this, I changed the relevant part in ratecontrol.c 
> (compare 'r5422') like so:
> if(fabs(expected_bits/all_available_bits - 1.0) > 0.01 ){
>   if (expected_bits<all_available_bits){
>     const double percent_too_low=(1.-(expected_bits/all_available_bits))*100.;
>     av_log(s->avctx, AV_LOG_INFO, "INFO: 2pass curve failed to converge 
> (expected_bits %.1f%% too low)\n",
>            percent_too_low );
>   }else{
>     const double 
> percent_too_high=((expected_bits/all_available_bits)-1.)*100.;
>     av_log(s->avctx, AV_LOG_ERROR, "ERROR: 2pass curve failed to converge 
> (expected_bits %.1f%% too high)\n",
>            percent_too_high);
>     return -1;
>   }
> }

code contributions must be in the form of a patch, as generated by diff -u
see our manual at ffmpeg.org


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is

More information about the ffmpeg-devel mailing list