[Phash-support] Phash on Mac OS X

Evan Klinger eklinger at phash.org
Wed Dec 23 11:26:37 PST 2009


Sebastian,
I believe FFmpeg needs to be built specifically with shared libraries
enabled (as part of the ./configure). That is probably why you are
missing the .so files but you do have the static archives (.a) files.
Can you see if the package you installed contains the shared
libraries?


On Wed, Dec 23, 2009 at 11:14 AM, Sebastian Gallese
<sebastiangallese at gmail.com> wrote:
> Thank you for your response!
>
> Let me pretext the following by saying that I am OK with running PHash
> without video support (I'd like to play around with images).
>
> I'm also open to using a Windows or Linux system if this is a problem with
> FFMpeg on the Mac.  If you know of a specific version of Windows or a
> distribution of Linux that works well with this, I can install that.
>
> Lastly, let me know if you compile FFMpeg with any special options (I just
> did the default install).
>
> And now onto my snooping around....
>
> On Macs, I found out we have .dylibs instead of .so files.
>
> I found a libavcodec.dylib which points to libavcodec.52.20.0.dylib
> This is from the FFMpeg files I installed from MacPorts, located in
> /opt/local/var/macports/software/ffmpeg/0.5_5/opt/local/lib
>
> Nothing shows up when I run "strings libavcodec.dylib | grep
> avcodec_alloc_frame"
>
> When I run "strings libavcodec.dylib | grep avcodec", I get the following:
>
> macbook-de-sebastian-gallese:lib kdge$ strings libavcodec.dylib | grep
> avcodec
> Compiler did not align stack variables. Libavcodec has been miscompiled
> and may be very slow or crash. This is not a bug in libavcodec,
> pic->data[0]!=NULL in avcodec_default_get_buffer
> insufficient thread locking around avcodec_open/close()
> libavcodec/motion_est.c
> libavcodec/motion_est_template.c
> libavcodec/ratecontrol.c
> libavcodec/dvdsubenc.c
> libavcodec/flacdec.c
> FFmpeg v%d.%d.%d / libavcodec build: %d
> libavcodec/mpegvideo_xvmc.c
> libavcodec/qcelpdec.c
> libavcodec/snow.c
> libavcodec/svq1enc.c
> libavcodec/vc1.c
> libavcodec/vorbis_dec.c
> libavcodec/vorbis_enc.c
> libavcodec/wmaenc.c
> libavcodec/libdiracenc.c
>
> I found nothing similar to libavcodec in /usr/lib
>
> In the directory /usr/local/lib, I found libavcodec.a, which outputs the
> following:
>
> macbook-de-sebastian-gallese:lib kdge$ strings libavcodec.a | grep
> avcodec_alloc_frame
> _avcodec_alloc_frame
> avcodec_alloc_frame
> avcodec_alloc_frame
>
> These are the other files I found in /usr/local/lib:
>
> macbook-de-sebastian-gallese:lib kdge$ pwd
> /usr/local/lib
> macbook-de-sebastian-gallese:lib kdge$ ls -l
> total 60920
> drwxr-xr-x  84 root  wheel      2856 Nov 17 03:20 codecs
> -rw-r--r--   1 root  wheel  22336032 Dec 23 10:32 libavcodec.a
> -rw-r--r--   1 root  wheel     31424 Dec 23 10:32 libavdevice.a
> -rw-r--r--   1 root  wheel   6686464 Dec 23 10:32 libavformat.a
> -rw-r--r--   1 root  wheel    226080 Dec 23 10:32 libavutil.a
> -rwxr-xr-x   1 root  wheel    254036 Dec 22 20:05 libjpeg.7.dylib
> -rw-r--r--   1 root  wheel   1160680 Dec 22 20:05 libjpeg.a
> lrwxr-xr-x   1 root  wheel        15 Dec 22 20:05 libjpeg.dylib ->
> libjpeg.7.dylib
> -rwxr-xr-x   1 root  wheel       912 Dec 22 20:05 libjpeg.la
> -rw-r--r--   1 root  wheel    469592 Dec 23 10:32 libswscale.a
> drwxr-xr-x   8 root  wheel       272 Dec 23 10:32 pkgconfig
>
> I also found the shared library in a folder for MPlayer on my computer, but
> I received an odd response (perhaps that is the response I should get?):
>
> macbook-de-sebastian-gallese:lib kdge$ pwd
> /Applications/MPlayer OSX
> Extended.app/Contents/Resources/External_Binaries/mplayer.app/Contents/MacOS/lib
> macbook-de-sebastian-gallese:lib kdge$ strings libavcodec.dylib | grep
> avcodec_alloc_frame
> strings: for architecture x86_64 object: libavcodec.dylib malformed object
> (unknown load command 5)
>
> After searching for all of these libavcodec, I figured it couldn't hurt to
> try to place a couple of them in the /usr/lib path and try to ./configure
> pHash again.  So I placed each of the libavcodec's, one at a time, in
> /usr/lib using the following type of commands:
>
> macbook-de-sebastian-gallese:lib kdge$ cd
> /opt/local/var/macports/software/ffmpeg/0.5_5/opt/local/lib
> macbook-de-sebastian-gallese:lib kdge$ sudo ln -s libavcodec.dylib
> /usr/lib/libavcodec.so && sudo ln -s libavcodec.dylib
> /usr/lib/libavcodec.dylib
>
> and for each different libavcodec, I still received this in the pHash
> ./configure
>
> checking whether FFmpeg is present... checking for avcodec_alloc_frame in
> -lavcodec... no
> configure: error:
>
> *** libavcodec not found.
>
> Thanks,
> -Seb
>
> On Wed, Dec 23, 2009 at 12:13 PM, Evan Klinger <eklinger at phash.org> wrote:
>>
>> Sebastian,
>> Can you please locate the libavcodec.so library on your system and run:
>>
>> strings libavcodec.so|grep avcodec_alloc_frame
>>
>> If that string is present, please also make sure the library is in a
>> standard system path where the linker can find it. In Linux this is
>> usually /usr/lib or /usr/local/lib, although the latter requires a
>> change to /etc/ld.so.conf to recognize libraries in /usr/local/lib.
>>
>> Thanks
>> Evan
>>
>> On Wed, Dec 23, 2009 at 8:14 AM, Sebastian Gallese
>> <sebastiangallese at gmail.com> wrote:
>> > Hello,
>> >
>> > I'm having trouble compiling Phase 0.7.1 on Mac OS X 10.5.8
>> >
>> > Please excuse me if I'm missing something obvious.
>> >
>> > I first installed FFMpeg from MacPorts.  I then downloaded CImg 1.3.2
>> > and
>> > placed CImg.h and the plugins and resources folders inside the Phase
>> > 0.7.1
>> > folder.
>> >
>> > Upon compiling, I was then prompted to install FFMpeg.  I figured the
>> > path
>> > that MacPort installs to can be funky, so I just downloaded the FFMpeg
>> > source and installed it from the GIT code.  While compiling, the program
>> > returned the output below.
>> >
>> > If you need any more information about where things are installed or
>> > output,
>> > I'll post it to the list-serv.
>> >
>> > It looks like people have had problems compiling with Mac OS X in the
>> > past.
>> > I'd be happy to try to resolve this issue, but I can also move to a
>> > Windows
>> > machine or install a flavor of Linux if you think that might be easier
>> > to
>> > get this to work.
>> >
>> > Any help is great!
>> >
>> > Thanks,
>> >
>> > Seb
>> >
>> > I received the following error:
>> >
>> > [...]
>> >
>> > checking whether the gcj linker
>> > (/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld) supports shared
>> > libraries...
>> > yes
>> > checking how to hardcode library paths into programs... immediate
>> >
>> > *** Configuring image hash ***
>> >
>> > checking CImg.h usability... no
>> > checking CImg.h presence... no
>> > checking for CImg.h... no
>> > checking whether CImg.h is in the current or src directory.... yes
>> >
>> > *** Configuring video Hash ***
>> >
>> > checking whether FFmpeg is present... checking for avcodec_alloc_frame
>> > in
>> > -lavcodec... no
>> > configure: error:
>> >
>> > *** libavcodec not found.
>> > You need FFmpeg. Get it at <http://ffmpeg.org/>
>> >
>> >
>> > _______________________________________________
>> > pHash-support mailing list
>> > pHash-support at lists.phash.org
>> > http://lists.phash.org/listinfo.cgi/phash-support-phash.org
>> >
>> >
>> _______________________________________________
>> pHash-support mailing list
>> pHash-support at lists.phash.org
>> http://lists.phash.org/listinfo.cgi/phash-support-phash.org
>
>



More information about the pHash-support mailing list