View previous topic :: View next topic |
Author |
Message |
tfbb n00b
Joined: 18 Sep 2005 Posts: 25
|
Posted: Sun Jan 21, 2007 2:22 pm Post subject: failure building ffmpeg-0.4.9_p20061016 / performance issues |
|
|
hi there,
just tried to update ffmpeg to 0.4.9; unfortunately, it couldn't be compiled ... see below for details. It would be really great if someone could help me sorting this out ...
I was hoping to resolve a serious performance issue with this update: I mainly need ffmpeg to decode huffyuv-encoded video (without audio) for subsequent use with pure data /gem. with my current build, it takes about 40% cpu time on a p4/2.6ghz to decode a 320x240 video. This just didn't feel right - the corresponding number when running pd/gem under win2k was about 10%.
Upon further investigating the issue, i found that ffmpeg states during the configure run that it won't get optimized :
Quote: | >>> Unpacking ffmpeg-0.4.9-p20061016.tar.bz2 to /var/tmp/portage/ffmpeg-0.4.9_p20061016/work
Applying ffmpeg-libdir.patch ...
Applying ffmpeg-shared-gcc4.1.patch ...
>>> Source unpacked.
>>> Compiling source in /var/tmp/portage/ffmpeg-0.4.9_p20061016/work/ffmpeg ...
[etc ...]
AVISynth enabled no
debug symbols no
strip symbols no
optimize no
static yes
|
Could it be that the "optimize no" statement is liable for ffmpeg's bad performance? And, while we're at it, is there any way to enable AVISynth support? afaik, v3.0 is a complete (and native linux) rewrite of this great app ...
Now, to the compile errors ... first, the call stack:
Quote: | !!! ERROR: media-video/ffmpeg-0.4.9_p20061016 failed.
Call stack:
ebuild.sh, line 1546: Called dyn_compile
ebuild.sh, line 937: Called src_compile
ffmpeg-0.4.9_p20061016.ebuild, line 157: Called die
!!! make failed
|
The actual cause of emerge bailing out seems to be this:
Quote: |
i686-pc-linux-gnu-gcc -O3 -march=pentium4 -fomit-frame-pointer -pipe -fomit-frame-pointer -fomit-frame-pointer -pthread -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Winline -I/var/tmp/portage/ffmpeg-0.4.9_p20061016/work/ffmpeg -I/var/tmp/portage/ffmpeg-0.4.9_p20061016/work/ffmpeg -I/var/tmp/portage/ffmpeg-0.4.9_p20061016/work/ffmpeg/libavutil -I/var/tmp/portage/ffmpeg-0.4.9_p20061016/work/ffmpeg/libavcodec -I/var/tmp/portage/ffmpeg-0.4.9_p20061016/work/ffmpeg/libavformat -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_ISOC9X_SOURCE -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_ISOC9X_SOURCE -I/var/tmp/portage/ffmpeg-0.4.9_p20061016/work/ffmpeg -I/var/tmp/portage/ffmpeg-0.4.9_p20061016/work/ffmpeg -I/var/tmp/portage/ffmpeg-0.4.9_p20061016/work/ffmpeg/libavutil -O3 -march=pentium4 -fomit-frame-pointer -pipe -fomit-frame-pointer -fomit-frame-pointer -pthread -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Winline -fPIC -DPIC -c -o mjpeg.o mjpeg.c
In file included from /var/tmp/portage/ffmpeg-0.4.9_p20061016/work/ffmpeg/libavutil/common.h:188,
from /var/tmp/portage/ffmpeg-0.4.9_p20061016/work/ffmpeg/libavutil/avutil.h:44,
from avcodec.h:34,
from mjpeg.c:36:
/var/tmp/portage/ffmpeg-0.4.9_p20061016/work/ffmpeg/libavutil/internal.h:218: warning: static declaration of 'lrintf' follows non-static declaration
mpegvideo.c: In function `MPV_motion':
mpegvideo.c:3413: warning: inlining failed in call to 'prefetch_motion': --param large-function-growth limit reached
mpegvideo.c:3449: warning: called from here
mpegvideo.c:3195: warning: inlining failed in call to 'obmc_motion': --param large-function-growth limit reached
| followed by a heap of failed inlining warnings (not good for performance either, huh?), and finally:
Quote: |
mjpeg.c:451: warning: called from here
mpegvideo.c: In function `MPV_encode_picture':
/var/tmp/portage/ffmpeg-0.4.9_p20061016/work/ffmpeg/libavutil/internal.h:218: sorry, unimplemented: inlining failed in call to 'lrintf': redefined extern inline functions are not considered for inlining
mpegvideo.c:2605: sorry, unimplemented: called from here
|
my make.conf:
Quote: | CFLAGS="-O3 -march=pentium4 -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j2"
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ "
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="7zip X aac aalib acpi alsa audiofile bash-completion bzip2 cdparanoia cdr curl curlwrappers doc dri dv dvd dvdr dvdread encode -esd ffmpeg fftw flac flash gphoto2 gstreamer ieee1394 jack jpeg libcaca mad matroska mime mmx mp3 mpeg ncurses nptl nptlonly offensive ogg oggvorbis opengl osc png portaudio quicktime sndfile sockets sse sse2 ssl tcl theora threads tiff tk truetype usb v4l vorbis win32codecs x264 xinerama xmms xv xvid zlib"
INPUT_DEVICES="keyboard mouse"
VIDEO_CARDS="nvidia" |
thank you very much for your help & with kind regards,
thoralf.
Last edited by tfbb on Sun Jan 21, 2007 3:27 pm; edited 1 time in total |
|
Back to top |
|
|
Dan Veteran
Joined: 25 Oct 2005 Posts: 1302
|
Posted: Sun Jan 21, 2007 2:52 pm Post subject: |
|
|
Code: | echo media-video/ffmpeg -aac >> /etc/portage/package.use |
_________________ - Failure is not an option. It's bundled with your software. |
|
Back to top |
|
|
didymos Advocate
Joined: 10 Oct 2005 Posts: 4798 Location: California
|
|
Back to top |
|
|
tfbb n00b
Joined: 18 Sep 2005 Posts: 25
|
Posted: Sun Jan 21, 2007 3:23 pm Post subject: |
|
|
thank you for your answers ...
adding media-video/ffmpeg -aac to /etc/portage/package.use didn't help, the error described above still occurs.
please let me know if there is something else i can do to get this straight ... i would also like to know if there is a way to turn on those optimizations. i googled around a bit, but couldn't find any pointers about the usefulness of this option. still, i need to resolve the slow decondig of huffyuvs ...
thank you,
thoralf. |
|
Back to top |
|
|
jmbsvicetto Moderator
Joined: 27 Apr 2005 Posts: 4734 Location: Angra do Heroísmo (PT)
|
Posted: Sun Jan 21, 2007 3:37 pm Post subject: |
|
|
tfbb,
have you read the bug didymos called your attention to? Have you tried using the solution proposed on comment #8?
Have you update your tree with emerge --sync and tried to emerge ffmpeg again? _________________ Jorge.
Your twisted, but hopefully friendly daemon.
AMD64 / x86 / Sparc Gentoo
Help answer || emwrap.sh
|
|
Back to top |
|
|
Dan Veteran
Joined: 25 Oct 2005 Posts: 1302
|
Posted: Sun Jan 21, 2007 3:40 pm Post subject: |
|
|
whats the output of emerge -pvt ffmpeg _________________ - Failure is not an option. It's bundled with your software. |
|
Back to top |
|
|
tfbb n00b
Joined: 18 Sep 2005 Posts: 25
|
Posted: Sun Jan 21, 2007 3:49 pm Post subject: |
|
|
thanks again!
jmbsvicetto: i'm just in the process of patching ffmpeg-0.4.9-p20060530.tar.bz2 as described in the bug report. it strikes me that this solution has been known for more than four months ...
dcoats:
Code: | These are the packages that would be merged, in reverse order:
Calculating dependencies... done!
[ebuild U ] media-video/ffmpeg-0.4.9_p20061016 [0.4.9_p20060530] USE="doc encode ieee1394 imlib mmx ogg oss sdl theora threads truetype v4l vorbis x264 xvid zlib -a52 -aac* (-altivec) -amr -debug -dts -network -test" 0 kB
|
thank you,
thoralf. |
|
Back to top |
|
|
Dan Veteran
Joined: 25 Oct 2005 Posts: 1302
|
Posted: Sun Jan 21, 2007 4:01 pm Post subject: |
|
|
just for grins go edit /etc/portage/package.use and set it up like mine..
Calculating dependencies... done!
[ebuild R ] media-video/ffmpeg-0.4.9_p20061016 USE="aac encode imlib mmx ogg oss sdl test threads truetype vorbis xvid zlib -a52 (-altivec) -amr -debug -doc -dts -ieee1394 -network -theora -v4l -x264" 0 kB
Total: 1 package (1 reinstall), Size of downloads: 0 kB
so try with..
Code: |
media-video/ffmpeg aac encode imlib mmx ogg oss sdl test threads truetype vorbis xvid zlib -a52 (-altivec) -amr -debug -doc -dts -ieee1394 -network -theora -v4l -x264 |
see if that works, i just recompiled ffmpeg successfully _________________ - Failure is not an option. It's bundled with your software. |
|
Back to top |
|
|
tfbb n00b
Joined: 18 Sep 2005 Posts: 25
|
Posted: Sun Jan 21, 2007 4:05 pm Post subject: |
|
|
sorry for being such a gadfly ...
tfbb wrote: | jmbsvicetto: i'm just in the process of patching ffmpeg-0.4.9-p20060530.tar.bz2 as described in the bug report. it strikes me that this solution has been known for more than four months ...
|
so i unbzipped/-tarred /usr/portage/distfiles/ffmpeg-0.4.9-p20061016.tar.bz2 to some other dir, patched .configure, tarred/bzipped the dir again and moved the tar.bz2 back to /usr/portage/distfiles. now emerge is a bit too smart in this case:
Quote: | >>> Emerging (1 of 1) media-video/ffmpeg-0.4.9_p20061016 to /
!!! Previously fetched file: 'ffmpeg-0.4.9-p20061016.tar.bz2'
!!! Reason: Filesize does not match recorded size
!!! Got: 2012431
!!! Expected: 2009859
Refetching...
|
this is the first time i'm doing something like this, so are there any command line switches i'm missing?
thanks again,
thoralf. |
|
Back to top |
|
|
jmbsvicetto Moderator
Joined: 27 Apr 2005 Posts: 4734 Location: Angra do Heroísmo (PT)
|
Posted: Sun Jan 21, 2007 4:12 pm Post subject: |
|
|
Let me give you some instructions:
Code: | # ebuild /usr/portage/media-video/ffmpeg/ffmpeg-0.4.9_p20061016.ebuild unpack
# cd /var/tmp/portage/ffmpeg-0.4.9_p20061016/work/... |
Patch the file as you did before, then:
Code: | # ebuild /usr/portage/media-video/ffmpeg/ffmpeg-0.4.9_p20061016.ebuild install |
If you get no compilation error, do:
Code: | # ebuild /usr/portage/media-video/ffmpeg/ffmpeg-0.4.9_p20061016.ebuild merge |
If you want to know more about ebuild, check it's man page, look at Gentoo's documentation or ask around in one of Gentoo's IRC channels. _________________ Jorge.
Your twisted, but hopefully friendly daemon.
AMD64 / x86 / Sparc Gentoo
Help answer || emwrap.sh
|
|
Back to top |
|
|
tfbb n00b
Joined: 18 Sep 2005 Posts: 25
|
Posted: Sun Jan 21, 2007 4:19 pm Post subject: |
|
|
hi,
dcoats wrote: | just for grins go edit /etc/portage/package.use and set it up like mine.. |
that works: gcc doesn't bail out, but those error messages about not being able to inline code are still there. so exactly what use-flag is to blame here?
i don't have much of a clue about c(++) and gcc, but i'm afraid that the missing inlining will cause a noticeable performance impact ... all in all, that seems to be a somewhat dirty solution to me.
with kind regards,
thoralf. |
|
Back to top |
|
|
tfbb n00b
Joined: 18 Sep 2005 Posts: 25
|
Posted: Sun Jan 21, 2007 4:31 pm Post subject: |
|
|
thank you jorge,
i guess i just got a rough grasp of emerge's inner workings ... unfortunately,
jmbsvicetto wrote: | Let me give you some instructions:
If you get no compilation error, do:
|
i do get the very same error as described in my first post ... hmmm. i'm out of ideas regarding a fix for this issue right now.
thank you all very much indeed,
thoralf. |
|
Back to top |
|
|
jmbsvicetto Moderator
Joined: 27 Apr 2005 Posts: 4734 Location: Angra do Heroísmo (PT)
|
Posted: Mon Jan 22, 2007 12:21 pm Post subject: |
|
|
tfbb,
before you proceed any further, update your Portage tree with emerge --sync and try emerging ffmpeg again. You should also remove the ffmpeg tar.bz2 file from /usr/portage/distfiles, before trying to emerge the package again.
If that doesn't solve your issue, let us know. _________________ Jorge.
Your twisted, but hopefully friendly daemon.
AMD64 / x86 / Sparc Gentoo
Help answer || emwrap.sh
|
|
Back to top |
|
|
Dan Veteran
Joined: 25 Oct 2005 Posts: 1302
|
Posted: Mon Jan 22, 2007 12:27 pm Post subject: |
|
|
tfbb wrote: |
that works: gcc doesn't bail out, but those error messages about not being able to inline code are still there. so exactly what use-flag is to blame here?
|
Those are not errors! they are Warnings. You will see warnings in just about every application you compile.
If you had it build successfully there is no need to do anything more. Unless you really want to try to build it with optimize=yes and in that case you can add extra args by using the EXTRA_ECONF="--something-else=here" line. _________________ - Failure is not an option. It's bundled with your software. |
|
Back to top |
|
|
tfbb n00b
Joined: 18 Sep 2005 Posts: 25
|
Posted: Mon Jan 22, 2007 3:14 pm Post subject: |
|
|
hi there,
jmbsvicetto wrote: | update your Portage tree [...] |
same error: ffmpeg-0.4.9_p20061016 only builds if i explicitly specify the use flags given by dcoats for this package. upon further investigation, it seems that ieee1394 is the one to blame ... putting Code: | media-video/ffmpeg -ieee1394 | into /etc/portage/package.use lets ffmpeg compile in my case. however, the warnings about not being able to inline code still persist.
dcoats wrote: | Those are not errors! they are Warnings. You will see warnings in just about every application you compile. |
doesn't inlining help quite a lot with regard to gcc optimising the bytecode? hope you don't get me wrong, i'm not trying to be mr. know-it-all here ...
i was just hoping that a new build of ffmpeg with all available optimisations activated would remedy my "cpu usage going through the roof when decoding huffyuv-encoded video"-issue. just did a quick test with ffplay: decoding a huffyuv-video consumes about 18% cpu time, whereas the very same video encoded with mpeg4 (xvid) only takes 4%. 320x240 in both cases, p4/2.53ghz. there definitely is something wrong with these numbers (well, with the first actually), since xvid is usually far more demanding than huffyuv in terms of computing power.
i realise that this is probably a quirk in ffdshow itself, i'll bring that to their attention. in any case, how do i go about those extra_econf-options? do i have to add them to /usr/portage/media-video/ffmpeg/ffmpeg-0.4.9_p20061016.ebuild ?
thank you again, and with kind regards,
thoralf. |
|
Back to top |
|
|
Dan Veteran
Joined: 25 Oct 2005 Posts: 1302
|
|
Back to top |
|
|
tfbb n00b
Joined: 18 Sep 2005 Posts: 25
|
Posted: Mon Jan 22, 2007 5:09 pm Post subject: |
|
|
alright ...
browsing the ffmpeg configure-file, I could only find an option to explicitly disable optimisations (--disable-opts), using --enable-opts causes configure to fail.
the ffmpeg people referred me back to the gentoo package maintainer, so i guess i'll just sit and wait until someone fixes the ieee1394 and optimisation issues.
a little bit of a rant: imho, ffmpeg-0.4.9_p20061016 should be masked unstable.
with kind regards,
thoralf. |
|
Back to top |
|
|
didymos Advocate
Joined: 10 Oct 2005 Posts: 4798 Location: California
|
Posted: Mon Jan 22, 2007 7:43 pm Post subject: |
|
|
The inlining warnings are normal. There's a limit on how many functions can be inlined, the default being 600. See the GCC manual for more about this:
http://gcc.gnu.org/onlinedocs/gcc-4.1.1/gcc/Optimize-Options.html
Sorry, there's no in-page link for the section about inlining. _________________ Thomas S. Howard |
|
Back to top |
|
|
didymos Advocate
Joined: 10 Oct 2005 Posts: 4798 Location: California
|
|
Back to top |
|
|
|