3

I'm trying to install pHash , but when I execute ./configure this message is returned:

...

*** 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/>

But FFMPEG is correctly installed, in fact executing ffmpeg it returns:

ffmpeg version 3.0.2 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.1)
  configuration: 
  libavutil      55. 17.103 / 55. 17.103
  libavcodec     57. 24.102 / 57. 24.102
  libavformat    57. 25.100 / 57. 25.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 31.100 /  6. 31.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'

Why this happens?

UPDATE:

libavcodec-dev is already installed:

luca@luca-OptiPlex-7040:~/Downloads/pHash-0.9.6$ sudo apt-get install libavcodec-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libavcodec-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 74 not upgraded.

and:

luca@luca-OptiPlex-7040:~/Downloads/pHash-0.9.6$ whereis libavcodec
libavcodec: /usr/local/lib/libavcodec.a /usr/include/libavcodec /usr/share/man/man3/libavcodec.3.gz
2
  • Which Ubuntu version?
    – llogan
    May 17, 2016 at 16:43
  • 14.IDon'tRemember (I'm not from that machine now)
    – user6321
    May 17, 2016 at 16:59

3 Answers 3

5

pHash looks like a dead project and has not been updated since 2013.

It references avcodec_alloc_frame which for years has been deprecated for av_frame_alloc, so it is likely incompatible with the current FFmpeg API.

You'll either have to use an ancient FFmpeg version (not recommended), or update the pHash source to use the current FFmpeg libraries properly.

If you do not need support for perceptual video hashes, then configure pHash with --enable-video-hash=no and it will omit the FFmpeg dependency.

If you're looking for audio fingerprint functionality, I recommend Chromaprint instead since FFmpeg supports it.

0

You can solve this issue by cloning this project from it's GitHub repo:

https://github.com/aetilius/pHash

3
  • does this bump the version past 0.9.7?
    – Michael
    Aug 20, 2021 at 23:09
  • looks like this version isn't backwards compatible
    – Michael
    Aug 21, 2021 at 1:27
  • but cloning the repo I cannot see the ./configure script, how shall I build/compile from sources using the repo? Jun 5, 2022 at 15:32
-1

When you are compiling a software, what you need is the development libraries and not the runtime libraries/tools. Specifically what you are missing here is the libavcodec-dev package. Install it as usual with apt and then run ./configure again. You will likely bump into another error saying you are missing another library. Use apt-cache search or the web to find which package you need to install, then iterate until there is no more error.

4
  • 1
    libavcodec-dev is already installed, look at my updated answer.
    – user6321
    May 17, 2016 at 10:12
  • assuming you are using 64-bit, what do you get from objdump -T /usr/lib/x86_64-linux-gnu/libavcodec.so | grep avcodec_alloc_frame? May 17, 2016 at 10:26
  • 000000000035e880 g DF .text 0000000000000020 LIBAVCODEC_54 avcodec_alloc_frame
    – user6321
    May 17, 2016 at 10:27
  • I have run out of ideas, it's definitely working fine here. May 17, 2016 at 10:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .