Missing libavcodec library in ffmpeg port
I just downloaded ffmpeg and it appears to be missing the libavcodec.dylib.51.9.0 library: $ port contents ffmpeg Port ffmpeg contains: /opt/local/bin/ffmpeg /opt/local/bin/ffplay /opt/local/bin/ffserver /opt/local/include/ffmpeg/adler32.h /opt/local/include/ffmpeg/avcodec.h /opt/local/include/ffmpeg/avformat.h /opt/local/include/ffmpeg/avio.h /opt/local/include/ffmpeg/avutil.h /opt/local/include/ffmpeg/common.h /opt/local/include/ffmpeg/fifo.h /opt/local/include/ffmpeg/integer.h /opt/local/include/ffmpeg/intfloat_readwrite.h /opt/local/include/ffmpeg/log.h /opt/local/include/ffmpeg/mathematics.h /opt/local/include/ffmpeg/md5.h /opt/local/include/ffmpeg/opt.h /opt/local/include/ffmpeg/rational.h /opt/local/include/ffmpeg/rtp.h /opt/local/include/ffmpeg/rtsp.h /opt/local/include/ffmpeg/rtspcodes.h /opt/local/include/ffmpeg/swscale.h /opt/local/lib/libavcodec.a /opt/local/lib/libavformat.a /opt/local/lib/libavutil.a /opt/local/lib/pkgconfig/libavcodec.pc /opt/local/lib/pkgconfig/libavformat.pc /opt/local/lib/pkgconfig/libavutil.pc /opt/local/share/doc/ffmpeg/faq.html /opt/local/share/doc/ffmpeg/ffmpeg-doc.html /opt/local/share/doc/ffmpeg/ffmpeg_powerpc_performance_evaluation_howto.txt /opt/local/share/doc/ffmpeg/ffplay-doc.html /opt/local/share/doc/ffmpeg/ffserver-doc.html /opt/local/share/doc/ffmpeg/hooks.html /opt/local/share/doc/ffmpeg/optimization.txt /opt/local/share/doc/ffmpeg/soc.txt /opt/local/share/doc/ffmpeg/TODO /opt/local/share/man/man1/ffmpeg.1.gz /opt/local/share/man/man1/ffplay.1.gz /opt/local/share/man/man1/ffserver.1.gz A friend tells me I should be seeing this: /opt/local/lib/libavcodec.dylib -> libavcodec.dylib.51.9.0 /opt/local/lib/libavcodec.dylib.51.9.0 I'm trying to build transcode but it fails because this library is missing. Suggestions? Cheers, Dave
David Liontooth wrote:
I just downloaded ffmpeg and it appears to be missing the libavcodec.dylib.51.9.0 library:
$ port contents ffmpeg Port ffmpeg contains: /opt/local/bin/ffmpeg /opt/local/bin/ffplay /opt/local/bin/ffserver /opt/local/include/ffmpeg/adler32.h /opt/local/include/ffmpeg/avcodec.h /opt/local/include/ffmpeg/avformat.h /opt/local/include/ffmpeg/avio.h /opt/local/include/ffmpeg/avutil.h /opt/local/include/ffmpeg/common.h /opt/local/include/ffmpeg/fifo.h /opt/local/include/ffmpeg/integer.h /opt/local/include/ffmpeg/intfloat_readwrite.h /opt/local/include/ffmpeg/log.h /opt/local/include/ffmpeg/mathematics.h /opt/local/include/ffmpeg/md5.h /opt/local/include/ffmpeg/opt.h /opt/local/include/ffmpeg/rational.h /opt/local/include/ffmpeg/rtp.h /opt/local/include/ffmpeg/rtsp.h /opt/local/include/ffmpeg/rtspcodes.h /opt/local/include/ffmpeg/swscale.h /opt/local/lib/libavcodec.a /opt/local/lib/libavformat.a /opt/local/lib/libavutil.a /opt/local/lib/pkgconfig/libavcodec.pc /opt/local/lib/pkgconfig/libavformat.pc /opt/local/lib/pkgconfig/libavutil.pc /opt/local/share/doc/ffmpeg/faq.html /opt/local/share/doc/ffmpeg/ffmpeg-doc.html
/opt/local/share/doc/ffmpeg/ffmpeg_powerpc_performance_evaluation_howto.txt /opt/local/share/doc/ffmpeg/ffplay-doc.html /opt/local/share/doc/ffmpeg/ffserver-doc.html /opt/local/share/doc/ffmpeg/hooks.html /opt/local/share/doc/ffmpeg/optimization.txt /opt/local/share/doc/ffmpeg/soc.txt /opt/local/share/doc/ffmpeg/TODO /opt/local/share/man/man1/ffmpeg.1.gz /opt/local/share/man/man1/ffplay.1.gz /opt/local/share/man/man1/ffserver.1.gz
A friend tells me I should be seeing this:
/opt/local/lib/libavcodec.dylib -> libavcodec.dylib.51.9.0 /opt/local/lib/libavcodec.dylib.51.9.0
To be precise, according to /opt/local/lib/pkgconfig/libavcodec.pc, the version missing is 51.16.0: prefix=/opt/local exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include Name: libavcodec Description: FFmpeg codec library Version: 51.16.0 Requires: ogg >= 1.1 libavutil = 49.0.1 Conflicts: Libs: -L${libdir} -lavcodec -lz -lmp3lame -logg -lxvidcore Cflags: -I${includedir} -I${includedir}/ffmpeg Any suggestions why this is not building? Dave
David Liontooth wrote:
I just downloaded ffmpeg and it appears to be missing the libavcodec.dylib.51.9.0 library:
$ port contents ffmpeg Port ffmpeg contains: /opt/local/bin/ffmpeg /opt/local/bin/ffplay /opt/local/bin/ffserver /opt/local/include/ffmpeg/adler32.h /opt/local/include/ffmpeg/avcodec.h /opt/local/include/ffmpeg/avformat.h /opt/local/include/ffmpeg/avio.h /opt/local/include/ffmpeg/avutil.h /opt/local/include/ffmpeg/common.h /opt/local/include/ffmpeg/fifo.h /opt/local/include/ffmpeg/integer.h /opt/local/include/ffmpeg/intfloat_readwrite.h /opt/local/include/ffmpeg/log.h /opt/local/include/ffmpeg/mathematics.h /opt/local/include/ffmpeg/md5.h /opt/local/include/ffmpeg/opt.h /opt/local/include/ffmpeg/rational.h /opt/local/include/ffmpeg/rtp.h /opt/local/include/ffmpeg/rtsp.h /opt/local/include/ffmpeg/rtspcodes.h /opt/local/include/ffmpeg/swscale.h /opt/local/lib/libavcodec.a /opt/local/lib/libavformat.a /opt/local/lib/libavutil.a /opt/local/lib/pkgconfig/libavcodec.pc /opt/local/lib/pkgconfig/libavformat.pc /opt/local/lib/pkgconfig/libavutil.pc /opt/local/share/doc/ffmpeg/faq.html /opt/local/share/doc/ffmpeg/ffmpeg-doc.html
/opt/local/share/doc/ffmpeg/ffmpeg_powerpc_performance_evaluation_howto.txt /opt/local/share/doc/ffmpeg/ffplay-doc.html /opt/local/share/doc/ffmpeg/ffserver-doc.html /opt/local/share/doc/ffmpeg/hooks.html /opt/local/share/doc/ffmpeg/optimization.txt /opt/local/share/doc/ffmpeg/soc.txt /opt/local/share/doc/ffmpeg/TODO /opt/local/share/man/man1/ffmpeg.1.gz /opt/local/share/man/man1/ffplay.1.gz /opt/local/share/man/man1/ffserver.1.gz
A friend tells me I should be seeing this:
/opt/local/lib/libavcodec.dylib -> libavcodec.dylib.51.9.0 /opt/local/lib/libavcodec.dylib.51.9.0
To be precise, according to /opt/local/lib/pkgconfig/libavcodec.pc, the version missing is 51.16.0: prefix=/opt/local exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include Name: libavcodec Description: FFmpeg codec library Version: 51.16.0 Requires: ogg >= 1.1 libavutil = 49.0.1 Conflicts: Libs: -L${libdir} -lavcodec -lz -lmp3lame -logg -lxvidcore Cflags: -I${includedir} -I${includedir}/ffmpeg Any suggestions why this is not building? Dave _______________________________________________ macports-users mailing list macports-users@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo/macports-users
Hi David,
I just downloaded ffmpeg and it appears to be missing the libavcodec.dylib.51.9.0 library:
I've finally got around to looking at it, and the answer is quite simple: the ffmpeg port isn't configured to build shared libraries at the moment -- static libraries only is the default setting for the ffmpeg source. Unfortunately, just adding "--enable-shared" isn't working, as I'm then getting build failures; I'll email the maintainer once I get something working and I'll keep you posted.
A friend tells me I should be seeing this:
/opt/local/lib/libavcodec.dylib -> libavcodec.dylib.51.9.0 /opt/local/lib/libavcodec.dylib.51.9.0
FYI, that's not quite the naming convention on Mac OS X. On Linux at least, shared libraries (a.k.a. dynamic libraries) have the extension ".so" and their version numbers come after that if they are explicitly given in the filename, e.g.: libavcodec.so libavcodec.so.51.9.0 Your friend is half-right with respect to Mac OS X: the shared libraries have the extension ".dylib", but the version number comes before that extension, e.g.: libavcodec.dylib libavcodec.51.9.0.dylib But that's just by-the-by :-) Kind regards, Maun Suang -- Boey Maun Suang (Boey is my surname) Email: boeyms@macports.org
David Liontooth <liontooth@cogweb.net> on Monday, April 16, 2007 at 5:06 PM -0800 wrote:
A friend tells me I should be seeing this:
/opt/local/lib/libavcodec.dylib -> libavcodec.dylib.51.9.0 /opt/local/lib/libavcodec.dylib.51.9.0
To be precise, according to /opt/local/lib/pkgconfig/libavcodec.pc, the version missing is 51.16.0:
prefix=/opt/local exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include
Name: libavcodec Description: FFmpeg codec library Version: 51.16.0 Requires: ogg >= 1.1 libavutil = 49.0.1 Conflicts: Libs: -L${libdir} -lavcodec -lz -lmp3lame -logg -lxvidcore Cflags: -I${includedir} -I${includedir}/ffmpeg
Any suggestions why this is not building?
The port is unmaintained so the only thing to do is to experiment. The latest svn rev is 8743, so 6399 is probably pretty old. Also, the FreeBSD port's configure args are quite a bit different. Does that give any clues? You may also file a bug report but perhaps you can find the problem and report so it can be fixed. http://www.freebsd.org/cgi/cvsweb.cgi/~checkout~/ports/multimedia/ffmpeg/Mak... Mark
Hi Maun Suang, Boey Maun Suang wrote:
Hi David,
I just downloaded ffmpeg and it appears to be missing the libavcodec.dylib.51.9.0 library:
I've finally got around to looking at it, and the answer is quite simple: the ffmpeg port isn't configured to build shared libraries at the moment -- static libraries only is the default setting for the ffmpeg source. Unfortunately, just adding "--enable-shared" isn't working, as I'm then getting build failures; I'll email the maintainer once I get something working and I'll keep you posted. Thank you for looking at this! ffmpeg is of course a complex project and they don't do formal releases. The reason I was hopeful is that someone else successfully built transcode using macports libraries, though from a previous macports release. The problem appears to be recent.
On the other hand, as Mark Duling points out, the latest svn rev is 8743, so our version 6399 may be better retired, especially if you're seeing build failures with shared libraries. Perhaps the ffmpeg-devel list would help out with build problems -- cf. http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/45610/focus=45617 for a recent discussion. I didn't realize FreeBSD uses the port package manager -- I don't know enough about this to comment on Mark Duling's link to the FreeBSD port file. I was expecting .so files; thanks for the details on the naming conventions. I usually work on Linux, and am just trying to get an idling XServe to be put to some useful work. For fun, I tried this: svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg ./configure --enable-shared --disable-vhook make Looks like it compiled fine -- that's version 8743. Cheers, David
A friend tells me I should be seeing this:
/opt/local/lib/libavcodec.dylib -> libavcodec.dylib.51.9.0 /opt/local/lib/libavcodec.dylib.51.9.0
FYI, that's not quite the naming convention on Mac OS X. On Linux at least, shared libraries (a.k.a. dynamic libraries) have the extension ".so" and their version numbers come after that if they are explicitly given in the filename, e.g.:
libavcodec.so libavcodec.so.51.9.0
Your friend is half-right with respect to Mac OS X: the shared libraries have the extension ".dylib", but the version number comes before that extension, e.g.:
libavcodec.dylib libavcodec.51.9.0.dylib
But that's just by-the-by :-)
Kind regards,
Maun Suang
--Boey Maun Suang (Boey is my surname) Email: boeyms@macports.org
Hi David,
For fun, I tried this:
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg ./configure --enable-shared --disable-vhook make
Looks like it compiled fine -- that's version 8743.
I've updated the ffmpeg port to revision 8743, which builds for me; try it in 12 hours after a selfupdate and let me know how it goes. We really need to add a note to it to explain that they're not making stable releases at the moment, and to fix the version reported by MacPorts to reflect this, but I'll have to leave that for another time. By the way, do you fancy submitting a Portfile for transcode so that we can share your good work? Have a look at other Portfiles (port cat <portname>) and reading portfile(7) for help on how to write one. Kind regards, Maun Suang -- Boey Maun Suang (Boey is my surname) Email: boeyms@macports.org
Boey Maun Suang wrote:
Hi David,
For fun, I tried this:
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg ./configure --enable-shared --disable-vhook make
Looks like it compiled fine -- that's version 8743.
I've updated the ffmpeg port to revision 8743, which builds for me; try it in 12 hours after a selfupdate and let me know how it goes. We really need to add a note to it to explain that they're not making stable releases at the moment, and to fix the version reported by MacPorts to reflect this, but I'll have to leave that for another time. Fantastic -- and you're right, this is how we're going to have to deal with ffmpeg. They say upfront not to wait around for an official release. Christian Marillat's multimedia packages for Debian typically release a new version off ffmpeg from SVN once a month; macports might aim for a couple of times a year at a minimum. While they don't release official versions, they are great at keeping the main branch stable.
By the way, do you fancy submitting a Portfile for transcode so that we can share your good work? Have a look at other Portfiles (port cat <portname>) and reading portfile(7) for help on how to write one. Chuck Remes and I might be able to cobble something together if nobody else steps up to the plate; we'll keep you posted.
Cheers, Dave
Boey Maun Suang wrote:
Hi David,
For fun, I tried this:
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg ./configure --enable-shared --disable-vhook make
Looks like it compiled fine -- that's version 8743.
I've updated the ffmpeg port to revision 8743, which builds for me; try it in 12 hours after a selfupdate and let me know how it goes. We really need to add a note to it to explain that they're not making stable releases at the moment, and to fix the version reported by MacPorts to reflect this, but I'll have to leave that for another time. The name of the mp3 library used by ./configure has changed to libmp3lame and we need a couple more flags (at least when including lame and/or xvid):
--- Portfile 2007-04-21 00:46:30.000000000 -0700 +++ /opt/local/var/db/dports/sources/rsync.rsync.darwinports.org_dpupdate_dports/multimedia/ffmpeg/Portfile 2007-04-21 00:41:52.000000000 -0700 @@ -42,6 +42,7 @@ platforms darwin configure.cflags-append -DHAVE_LRINTF configure.args --prefix=${prefix} --disable-vhook \ --mandir=${prefix}/share/man \ + --extra-cflags="-I/opt/local/include" --extra-ldflags="-L/opt/local/lib" \ --enable-gpl --enable-shared --enable-pthreads --enable-pp post-destroot { @@ -55,7 +56,7 @@ post-destroot { # Adds MP3 support variant lame { depends_lib-append port:lame - configure.args-append --enable-mp3lame + configure.args-append --enable-libmp3lame } variant libogg { I discovered this at http://lists.mplayerhq.hu/pipermail/ffmpeg-user/2007-April/008205.html. ffmpeg +lame +xvid now compiles. Dave
Ryan Schmidt wrote:
On Apr 21, 2007, at 02:54, David Liontooth wrote:
+ --extra-cflags="-I/opt/local/include" --extra-ldflags="-L/opt/local/lib" \
Should not need either of those since MacPorts now includes those automatically for all ports.
That makes sense, but if I leave them out I get this: ERROR: LAME not found Same for xvid. It may be my environment is non-standard, but afaik I've followed the usual procedures. Dave
David Liontooth wrote:
Ryan Schmidt wrote:
On Apr 21, 2007, at 02:54, David Liontooth wrote:
+ --extra-cflags="-I/opt/local/include" --extra-ldflags="-L/opt/local/lib" \
Should not need either of those since MacPorts now includes those automatically for all ports.
That makes sense, but if I leave them out I get this:
ERROR: LAME not found
Same for xvid. It may be my environment is non-standard, but afaik I've followed the usual procedures. Let me rephrase: what could be wrong with my build environment that makes ./configure not see the relevant libraries? What is the equivalent of /etc/ld.so.conf (a list of shared /dynamic library locations) and ldconfig (dynamic linker configuration) on OSX?
Dave
Hi Dave, On 22/04/2007, at 05:02, David Liontooth wrote:
David Liontooth wrote:
Ryan Schmidt wrote:
On Apr 21, 2007, at 02:54, David Liontooth wrote:
+ --extra-cflags="-I/opt/local/include" --extra-ldflags="-L/opt/local/lib" \
Should not need either of those since MacPorts now includes those automatically for all ports.
That makes sense, but if I leave them out I get this:
ERROR: LAME not found
Same for xvid. It may be my environment is non-standard, but afaik I've followed the usual procedures. Let me rephrase: what could be wrong with my build environment that makes ./configure not see the relevant libraries?
The problem is that MacPorts currently sets "-I/opt/local/include" only in CPPFLAGS, which is where it should properly go, but ffmpeg only looks at CFLAGS, so we need to add the contents of CPPFLAGS to CFLAGS to make ffmpeg happy; I'm sure that I've seen other packages that behave the same way. I've committed a patch to fix this [1]; let me know how it works for you.
What is the equivalent of /etc/ld.so.conf (a list of shared /dynamic library locations) and ldconfig (dynamic linker configuration) on OSX?
Neither of those exist on Mac OS X, and I don't believe that it has an equivalent command/configuration file technique to specify other directories to search for shared libraries. The closest you can get is to set the DYLD_LIBRARY_PATH, DYLD_FALLBACK_LIBRARY_PATH and/or (for frameworks) DYLD_FALLBACK_FRAMEWORK_PATH environment variables, but you probably know that there are dangers associated with this route. In the case of this port, however, this is moot, because the problem was that ffmpeg couldn't find the headers, not the shared libraries. Kind regards, Maun Suang [1] http://trac.macports.org/projects/macports/changeset/24349 -- Boey Maun Suang (Boey is my surname) Email: boeyms@macports.org
Boey Maun Suang wrote:
Hi Dave,
On 22/04/2007, at 05:02, David Liontooth wrote:
David Liontooth wrote:
Ryan Schmidt wrote:
On Apr 21, 2007, at 02:54, David Liontooth wrote:
+ --extra-cflags="-I/opt/local/include" --extra-ldflags="-L/opt/local/lib" \
Should not need either of those since MacPorts now includes those automatically for all ports.
That makes sense, but if I leave them out I get this:
ERROR: LAME not found
Same for xvid. It may be my environment is non-standard, but afaik I've followed the usual procedures. Let me rephrase: what could be wrong with my build environment that makes ./configure not see the relevant libraries?
The problem is that MacPorts currently sets "-I/opt/local/include" only in CPPFLAGS, which is where it should properly go, but ffmpeg only looks at CFLAGS, so we need to add the contents of CPPFLAGS to CFLAGS to make ffmpeg happy; I'm sure that I've seen other packages that behave the same way. Hi Maun Suang,
Thank you for the fix and the explanation; it is much appreciated. In the case of the flag fix, it would be very useful if you could report this to the ffmpeg-user list at http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user, since the misbehavior appears to be general for the platform rather than being MacPorts-specific. Best, Dave
participants (4)
-
Boey Maun Suang
-
David Liontooth
-
markd@macports.org
-
Ryan Schmidt