Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 145393 - media-video/mplayer v1.0_pre8 until v1.0_pre20060810 - 2pass curve failed to converge
Summary: media-video/mplayer v1.0_pre8 until v1.0_pre20060810 - 2pass curve failed to ...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-28 12:11 UTC by Thomas Kohler
Modified: 2006-09-02 15:42 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
patch for testing the reason of error (ratecontrol_test_mplayer.patch,998 bytes, text/plain)
2006-08-30 12:49 UTC, Thomas Kohler
Details
a short patch with does it on my amd64 (patch,460 bytes, patch)
2006-09-01 03:44 UTC, phl0ri4n
Details | Diff
bad and good converge (using test-patch) (mplayer-output.txt,3.30 KB, text/plain)
2006-09-01 12:28 UTC, Thomas Kohler
Details
patch for amd64 and x86 - plot a warning (ratecontrol_NowWarning.patch,592 bytes, patch)
2006-09-01 13:06 UTC, Thomas Kohler
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Kohler 2006-08-28 12:11:44 UTC
Portage 2.1-r2 (default-linux/amd64/2006.0, gcc-3.4.6, glibc-2.3.6-r4, 2.6.17-gentoo-r4 x86_64)
=================================================================
System uname: 2.6.17-gentoo-r4 x86_64 AMD Athlon(tm) 64 Processor 3200+
Gentoo Base System version 1.12.4
app-admin/eselect-compiler: [Not Present]
dev-lang/python:     2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.13-r3
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=k8 -pipe -fomit-frame-pointer -mmmx -msse -msse3 -m3dnow"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo "
LANG="de_DE.utf8"
LINGUAS="de"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="amd64 X aac alsa avi berkdb bitmap-fonts cdr cli crypt cups dlloader dri dvd dvdread eds emboss encode ffmpeg foomaticdb fortran gif gimp gnome gpm gstreamer gtk gtk2 imagemagick imlib ipv6 isdnlog jack jpeg kde lzw lzw-tiff mad mp3 mpeg ncurses nls nptl nptlonly nsplugin nvidia opengl oss pam pcre pdflib perl png ppds pppd python qt qt3 qt4 quicktime readline reflection sdl session spell spl ssl tcpd tiff truetype-fonts type1-fonts unicode usb userlocales v4l v4l2 xorg xpm xv xvid zlib elibc_glibc input_devices_keyboard input_devices_mouse kernel_linux linguas_de userland_GNU video_cards_nv video_cards_nvidia video_cards_v4l"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS

******************************************************************************
I have installed:
media-video/ffmpeg-0.4.9_p20051216
media-video/mplayer-1.0_pre8

At a two-pass encoding following error was produced:
"[mpeg4 @ 0xa60390]Error: 2pass curve failed to converge"

Relating problems from www see:
http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/34234
http://itdp.fh-biergarten.de/mplayer-users/2006-08/msg00210.html

There is also something like a patch at, but I don't know how to use it:
http://article.gmane.org/gmane.comp.video.mencoder.user/3706
Comment 1 Thomas Kohler 2006-08-28 13:11:43 UTC
Same with:
media-video/ffmpeg-0.4.9_p20051216
media-video/mplayer-1.0_pre8-r1
Comment 2 Luca Barbato gentoo-dev 2006-08-28 13:16:16 UTC
update ffmpeg and mplayer and report back. the currently masked snapshot are in p.mask just because the other programs hadn't update x264 bindings...
Comment 3 Thomas Kohler 2006-08-28 22:10:55 UTC
Same with:
media-video/ffmpeg-0.4.9_p20051216
media-video/mplayer-1.0_pre20060810 (masked by package.mask and ~amd64 keyword)

In reply to Comment #2: Do you mean the mplayer version above?

In my opinion the problem is located in ffmpeg. Therefore I will test now the other versions of ffmpeg wich I can find in the actual portage tree.
Comment 4 Thomas Kohler 2006-08-29 11:41:36 UTC
Same with:
media-video/ffmpeg-0.4.9_p20050226-r3
media-video/mplayer-1.0_pre20060810 (masked by package.mask and ~amd64 keyword)
Comment 5 Thomas Kohler 2006-08-29 12:11:54 UTC
Same with:
media-video/ffmpeg-0.4.9_p20060302
media-video/mplayer-1.0_pre20060810 (masked by package.mask and ~amd64 keyword)
Comment 6 Thomas Kohler 2006-08-29 14:21:02 UTC
Now I have tested the patch from www (see above).
With that the function abs() should change to a better one: fabs().
I had tested some modifications but nothing was successfully. Allways the same error: "Error: 2pass curve failed to converge"

Last I have modified the patched line to : "if (1>10) {...}" but the error persist.

Summary: The patch don't modify the right line.
Comment 7 Thomas Kohler 2006-08-30 12:49:38 UTC
Created attachment 95508 [details]
patch for testing the reason of error
Comment 8 Thomas Kohler 2006-08-30 12:58:44 UTC
(In reply to comment #6)
> Summary: The patch don't modify the right line.

Yes and that's because mplayer (I'm used for testing) don't use the ffmpeg-librarys as link but his own included ffmpeg sources during compile!

Ok, now I have made a look into the file "ratecontrol.c" of mplayer and find out that the abs-> fabs patch is allways there. Now I had make my own patch file (see attachement). After applying this patch you will see that the error-string is absolutly correct: curve don't converge

In my case "expected_bits/all_available_bits" is "0.193" but it should be near "1". I don't know why the curve should converge. Also I don't know about the background of the complete problem. Even though I had removed the line with "return -1". Therfore the second pass now will finished successfully.
Comment 9 phl0ri4n 2006-09-01 03:44:44 UTC
Created attachment 95635 [details, diff]
a short patch with does it on my amd64

try it out
Comment 10 Matthias Schwarzott gentoo-dev 2006-09-01 03:56:20 UTC
Changed topic to mplayer it has its own ffmpeg-version and is not related to ffmpeg-ebuild.
Comment 11 phl0ri4n 2006-09-01 04:24:33 UTC
the patch is for mplayer version:

media-video/mplayer-1.0_pre20060810
Comment 12 Thomas Kohler 2006-09-01 12:26:54 UTC
(In reply to comment #11)
> the patch is for mplayer version:
> 
> media-video/mplayer-1.0_pre20060810
Thank you for your patch, but this solves only the reaction of the problem, not the problem itself. Of course, the process dont interrupt now (see also my shorter patch ;o}). But in my opinion the result can't be a valid videofile (I know it will be played correctly with mplayer). 

Functions are defined as:
* int     abs ( int n ); (n -> integer) [http://www.cplusplus.com/ref/cmath/abs.html]
* double  fabs ( double x ); (x -> double) [http://www.cplusplus.com/ref/cmath/fabs.html]

I have attached a file with outputs of a incorrect converge and a correct converge (generated with my testing-patch).
Comment 13 Thomas Kohler 2006-09-01 12:28:52 UTC
Created attachment 95668 [details]
bad and good converge (using test-patch)
Comment 14 Thomas Kohler 2006-09-01 12:37:04 UTC
(In reply to comment #10)
The contens of the directory "libavcodec" looks nearly same in mplayer and ffmpeg. Therefore I'm suggesting open a new bug for ffmpeg after testing the same with ffmpeg and the same file. I can do it, but I,m not trained with ffmpeg. Do someone send me the commandline wich equal with mencoder 2-pass encoding?
Comment 15 Thomas Kohler 2006-09-01 12:40:16 UTC
(In reply to comment #9)
The error exist on "amd64" and the same on "x86", I have tested.
Comment 16 Thomas Kohler 2006-09-01 13:06:17 UTC
Created attachment 95669 [details, diff]
patch for amd64 and x86 - plot a warning

Not smaller :O[ , but better ;o}

Inform the user with two possibilities, but don't interrupt.

At me tested with mplayer-1.0_pre8. Should also work with versions above.
Comment 17 Thomas Kohler 2006-09-02 11:15:45 UTC
(In reply to comment #14)
> (In reply to comment #10)
Today I'm testing the ffmpeg-0.4.9_p20051216. I was first exposed there is no bug. I looked into the sources to understand what's better in ffmpeg-ratecontrol. It's not better! There is the abs-bug in it.

After that I make the patch doing the fabs and also the warning like mpeg-patch above. Then I test with that patched version the mpeg4-code and get the message. Now I'm sure the same bug is inside the ffmpeg-code.

ffmpeg -t 4 -pass 1 -i Infile.avi -vcodec mpeg4 -s 352x144 OutFilep1.avi
ffmpeg -t 4 -pass 2 -i Infile.avi -vcodec mpeg4 -s 352x144 OutFilep2.avi

The problem don't exist anymore if I remove the -s Option. In my opinion in that case the higher bitrate correlate better to framesize (704x288).
Comment 18 Jakub Moc (RETIRED) gentoo-dev 2006-09-02 14:35:24 UTC
*** Bug 146017 has been marked as a duplicate of this bug. ***
Comment 19 Luca Barbato gentoo-dev 2006-09-02 15:42:41 UTC
Please move this discussion to upstream, something similar will added to the rc1.