Zinetz Victor, Please, can you send me the avcodec, avutil and avformat header translation? Thanks, Fernando Afonso fernando.afonso at co.sapo.pt
This was reported on mplayer-user (http://lists.mplayerhq.hu/pipermail/mplayer-users/2006-July/061556.html). I want to bring it up here because it is really a ffmpeg problem. Basically, when one does two-pass encoding with mpeg4, he will sometimes get the error "2pass curve failed to converge" in the second pass. It depends on the source and the bitrate used. See the following example: ftp://ftp.mplayerhq.hu/MPlayer/samples/MPEG1/zelda%20first%20commercial.mpeg ffmpeg -i "zelda first commercial.mpeg" -b 812 -pass 1 -vcodec mpeg4 -acodec copy -y test.avi ffmpeg -i "zelda first commercial.mpeg" -b 812 -pass 2 -vcodec mpeg4 -acodec copy -y test.avi If I change the bitrate from 812 to 811, the encoding goes through. Someone already suggested a temporary fix. Change the following line in libavcodec/ratecontrol.c - if(fabs(expected_bits/all_available_bits - 1.0) > 0.01 ){ + if(abs(expected_bits/all_available_bits - 1.0) > 0.01 ){ av_log(s->avctx, AV_LOG_ERROR, "Error: 2pass curve failed to converge\n"); return -1; } After changing fabs to abs, the problem goes away. However, it is important to find out why the threshold 0.01 fails. Changing fabs to abs basically increases it to 1. ================================================================================ [xichen at shire 13:29:39 ~]# ffmpeg -i "zelda first commercial.mpeg" -b 812 -pass 1 -vcodec mpeg4 -acodec copy -y test.avi FFmpeg version SVN-r5845, Copyright (c) 2000-2004 Fabrice Bellard configuration: --enable-mp3lame --enable-shared --enable-gpl --enable-a52 --enable-pthreads --enable-faad --enable-faadbin --enable-xvid --enable-libogg --enable-a52bin --enable-vorbis --enable-dts --enable-pp --enable-x264 --enable-faac --enable-libgsm libavutil version: 49.0.0 libavcodec version: 51.10.0 libavformat version: 50.5.0 built on Jul 29 2006 12:00:21, gcc: 4.0.4 20060507 (prerelease) (Debian 4.0.3-3) Input #0, mpeg, from 'zelda first commercial.mpeg': Duration: 00:00:27.0, start: 0.070267, bitrate: 758 kb/s Stream #0.0[0x1e0]: Video: mpeg1video, yuv420p, 160x120, 614 kb/s, 29.97 fps(r) Stream #0.1[0x1c0]: Audio: mp2, 44100 Hz, mono, 64 kb/s Output #0, avi, to 'test.avi': Stream #0.0: Video: mpeg4, yuv420p, 160x120, q=2-31, pass 1, 812 kb/s, 29.97 fps(c) Stream #0.1: Audio: mp2, 44100 Hz, mono, 64 kb/s Stream mapping: Stream #0.0 -> #0.0 Stream #0.1 -> #0.1 Press [q] to stop encoding frame= 894 q=2.0 Lsize= 3008kB time=29.8 bitrate= 828.1kbits/s video:2717kB audio:232kB global headers:0kB muxing overhead 1.961417% [xichen at shire 13:30:20 ~]# ffmpeg -i "zelda first commercial.mpeg" -b 812 -pass 2 -vcodec mpeg4 -acodec copy -y test.avi FFmpeg version SVN-r5845, Copyright (c) 2000-2004 Fabrice Bellard configuration: --enable-mp3lame --enable-shared --enable-gpl --enable-a52 --enable-pthreads --enable-faad --enable-faadbin --enable-xvid --enable-libogg --enable-a52bin --enable-vorbis --enable-dts --enable-pp --enable-x264 --enable-faac --enable-libgsm libavutil version: 49.0.0 libavcodec version: 51.10.0 libavformat version: 50.5.0 built on Jul 29 2006 12:00:21, gcc: 4.0.4 20060507 (prerelease) (Debian 4.0.3-3) Input #0, mpeg, from 'zelda first commercial.mpeg': Duration: 00:00:27.0, start: 0.070267, bitrate: 758 kb/s Stream #0.0[0x1e0]: Video: mpeg1video, yuv420p, 160x120, 614 kb/s, 29.97 fps(r) Stream #0.1[0x1c0]: Audio: mp2, 44100 Hz, mono, 64 kb/s Output #0, avi, to 'test.avi': Stream #0.0: Video: mpeg4, yuv420p, 160x120, q=2-31, pass 2, 812 kb/s, 29.97 fps(c) Stream #0.1: Audio: mp2, 44100 Hz, mono, 64 kb/s Stream mapping: Stream #0.0 -> #0.0 Stream #0.1 -> #0.1 [mpeg4 @ 0xb7e2e048]Error: 2pass curve failed to converge Error while opening codec for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height
participants (2)
-
fernando.afonso@co.sapo.pt -
xichen71@163.com