43

My question originates from my problem in getting ffmpeg started. I have installed ffmpeg and it is displayed as installed:

whereis ffmpeg 
ffmpeg: /usr/bin/ffmpeg /usr/bin/X11/ffmpeg /usr/share/ffmpeg /usr/share/man/man1/ffmpeg.1.gz

Later, I figured out, that some programs depend on libraries that do not come with the installation itself, so I checked with ldd command what is missing:

# ldd /usr/bin/ffmpeg
    linux-vdso.so.1 =>  (0x00007fff71fe9000)
    libavfilter.so.0 => not found
    libpostproc.so.51 => not found
    libswscale.so.0 => not found
    libavdevice.so.52 => not found
    libavformat.so.52 => not found
    libavcodec.so.52 => not found
    libavutil.so.49 => not found
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f5f20bdf000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f5f209c0000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f5f205fb000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f5f20f09000)

As it turns out my ffmpeg is cut off from 7 libraries too work. I first thought that each of those libraries have to be installed, but than I figured out, that some or all might be installed, but their location unknown to ffmpeg. I read that /etc/ld.so.conf and /etc/ld.so.cache contain the paths to the libraries, but I was confused, because, there was only one line in

/etc/ld.so.conf
 cat /etc/ld.so.conf
include /etc/ld.so.conf.d/*.conf

but a very long /etc/ld.so.cache.

I am now at a point where I feel lost how to investigate further, It might be a helpful next step to figure out, how I can determine if a given library is indeed installed even if its location unknown to ffmpeg.

---------Output---of----apt-cache-policy-----request---------
apt-cache policy
Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 http://archive.canonical.com/ubuntu/ trusty/partner Translation-en
 500 http://archive.canonical.com/ubuntu/ trusty/partner i386 Packages
     release v=14.04,o=Canonical,a=trusty,n=trusty,l=Partner archive,c=partner
     origin archive.canonical.com
 500 http://archive.canonical.com/ubuntu/ trusty/partner amd64 Packages
     release v=14.04,o=Canonical,a=trusty,n=trusty,l=Partner archive,c=partner
     origin archive.canonical.com
 500 http://security.ubuntu.com/ubuntu/ trusty-security/universe Translation-en
 500 http://security.ubuntu.com/ubuntu/ trusty-security/restricted Translation-en
 500 http://security.ubuntu.com/ubuntu/ trusty-security/multiverse Translation-en
 500 http://security.ubuntu.com/ubuntu/ trusty-security/main Translation-en
 500 http://security.ubuntu.com/ubuntu/ trusty-security/multiverse i386 Packages
     release v=14.04,o=Ubuntu,a=trusty-security,n=trusty,l=Ubuntu,c=multiverse
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu/ trusty-security/universe i386 Packages
     release v=14.04,o=Ubuntu,a=trusty-security,n=trusty,l=Ubuntu,c=universe
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu/ trusty-security/restricted i386 Packages
     release v=14.04,o=Ubuntu,a=trusty-security,n=trusty,l=Ubuntu,c=restricted
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu/ trusty-security/main i386 Packages
     release v=14.04,o=Ubuntu,a=trusty-security,n=trusty,l=Ubuntu,c=main
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu/ trusty-security/multiverse amd64 Packages
     release v=14.04,o=Ubuntu,a=trusty-security,n=trusty,l=Ubuntu,c=multiverse
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu/ trusty-security/universe amd64 Packages
     release v=14.04,o=Ubuntu,a=trusty-security,n=trusty,l=Ubuntu,c=universe
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu/ trusty-security/restricted amd64 Packages
     release v=14.04,o=Ubuntu,a=trusty-security,n=trusty,l=Ubuntu,c=restricted
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
     release v=14.04,o=Ubuntu,a=trusty-security,n=trusty,l=Ubuntu,c=main
     origin security.ubuntu.com
 500 http://archive.ubuntu.com/ubuntu/ trusty-updates/universe Translation-en
 500 http://archive.ubuntu.com/ubuntu/ trusty-updates/restricted Translation-en
 500 http://archive.ubuntu.com/ubuntu/ trusty-updates/multiverse Translation-en
 500 http://archive.ubuntu.com/ubuntu/ trusty-updates/main Translation-en
 500 http://archive.ubuntu.com/ubuntu/ trusty-updates/multiverse i386 Packages
     release v=14.04,o=Ubuntu,a=trusty-updates,n=trusty,l=Ubuntu,c=multiverse
     origin archive.ubuntu.com
 500 http://archive.ubuntu.com/ubuntu/ trusty-updates/universe i386 Packages
     release v=14.04,o=Ubuntu,a=trusty-updates,n=trusty,l=Ubuntu,c=universe
     origin archive.ubuntu.com
 500 http://archive.ubuntu.com/ubuntu/ trusty-updates/restricted i386 Packages
     release v=14.04,o=Ubuntu,a=trusty-updates,n=trusty,l=Ubuntu,c=restricted
     origin archive.ubuntu.com
 500 http://archive.ubuntu.com/ubuntu/ trusty-updates/main i386 Packages
     release v=14.04,o=Ubuntu,a=trusty-updates,n=trusty,l=Ubuntu,c=main
     origin archive.ubuntu.com
 500 http://archive.ubuntu.com/ubuntu/ trusty-updates/multiverse amd64 Packages
     release v=14.04,o=Ubuntu,a=trusty-updates,n=trusty,l=Ubuntu,c=multiverse
     origin archive.ubuntu.com
 500 http://archive.ubuntu.com/ubuntu/ trusty-updates/universe amd64 Packages
     release v=14.04,o=Ubuntu,a=trusty-updates,n=trusty,l=Ubuntu,c=universe
     origin archive.ubuntu.com
 500 http://archive.ubuntu.com/ubuntu/ trusty-updates/restricted amd64 Packages
     release v=14.04,o=Ubuntu,a=trusty-updates,n=trusty,l=Ubuntu,c=restricted
     origin archive.ubuntu.com
 500 http://archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
     release v=14.04,o=Ubuntu,a=trusty-updates,n=trusty,l=Ubuntu,c=main
     origin archive.ubuntu.com
 500 http://archive.ubuntu.com/ubuntu/ trusty/universe Translation-en
 500 http://archive.ubuntu.com/ubuntu/ trusty/restricted Translation-en
 500 http://archive.ubuntu.com/ubuntu/ trusty/multiverse Translation-en
 500 http://archive.ubuntu.com/ubuntu/ trusty/main Translation-en
 500 http://archive.ubuntu.com/ubuntu/ trusty/multiverse i386 Packages
     release v=14.04,o=Ubuntu,a=trusty,n=trusty,l=Ubuntu,c=multiverse
     origin archive.ubuntu.com
 500 http://archive.ubuntu.com/ubuntu/ trusty/universe i386 Packages
     release v=14.04,o=Ubuntu,a=trusty,n=trusty,l=Ubuntu,c=universe
     origin archive.ubuntu.com
 500 http://archive.ubuntu.com/ubuntu/ trusty/restricted i386 Packages
     release v=14.04,o=Ubuntu,a=trusty,n=trusty,l=Ubuntu,c=restricted
     origin archive.ubuntu.com
 500 http://archive.ubuntu.com/ubuntu/ trusty/main i386 Packages
     release v=14.04,o=Ubuntu,a=trusty,n=trusty,l=Ubuntu,c=main
     origin archive.ubuntu.com
 500 http://archive.ubuntu.com/ubuntu/ trusty/multiverse amd64 Packages
     release v=14.04,o=Ubuntu,a=trusty,n=trusty,l=Ubuntu,c=multiverse
     origin archive.ubuntu.com
 500 http://archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
     release v=14.04,o=Ubuntu,a=trusty,n=trusty,l=Ubuntu,c=universe
     origin archive.ubuntu.com
 500 http://archive.ubuntu.com/ubuntu/ trusty/restricted amd64 Packages
     release v=14.04,o=Ubuntu,a=trusty,n=trusty,l=Ubuntu,c=restricted
     origin archive.ubuntu.com
 500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
     release v=14.04,o=Ubuntu,a=trusty,n=trusty,l=Ubuntu,c=main
     origin archive.ubuntu.com
 700 http://extra.linuxmint.com/ rebecca/main i386 Packages
     release v=17.1,o=linuxmint,a=rebecca,n=rebecca,l=linuxmint,c=main
     origin extra.linuxmint.com
 700 http://extra.linuxmint.com/ rebecca/main amd64 Packages
     release v=17.1,o=linuxmint,a=rebecca,n=rebecca,l=linuxmint,c=main
     origin extra.linuxmint.com
 700 http://packages.linuxmint.com/ rebecca/import i386 Packages
     release v=17.1,o=linuxmint,a=rebecca,n=rebecca,l=linuxmint,c=import
     origin packages.linuxmint.com
 700 http://packages.linuxmint.com/ rebecca/upstream i386 Packages
     release v=17.1,o=linuxmint,a=rebecca,n=rebecca,l=linuxmint,c=upstream
     origin packages.linuxmint.com
 700 http://packages.linuxmint.com/ rebecca/main i386 Packages
     release v=17.1,o=linuxmint,a=rebecca,n=rebecca,l=linuxmint,c=main
     origin packages.linuxmint.com
 700 http://packages.linuxmint.com/ rebecca/import amd64 Packages
     release v=17.1,o=linuxmint,a=rebecca,n=rebecca,l=linuxmint,c=import
     origin packages.linuxmint.com
 700 http://packages.linuxmint.com/ rebecca/upstream amd64 Packages
     release v=17.1,o=linuxmint,a=rebecca,n=rebecca,l=linuxmint,c=upstream
     origin packages.linuxmint.com
 700 http://packages.linuxmint.com/ rebecca/main amd64 Packages
     release v=17.1,o=linuxmint,a=rebecca,n=rebecca,l=linuxmint,c=main
     origin packages.linuxmint.com
Pinned packages:
karobar
  • 115
  • 10
Abdul Al Hazred
  • 25,760
  • 23
  • 64
  • 88
  • What is your distribution/OS? Is there some reason you are not using the ffmpeg from your distribution? – Faheem Mitha Apr 02 '15 at 20:40
  • I use Linux mint codename Rebecca, ffmpeg was not already installed on my distribution, when I tried to install it by "apt-get install ffmpeg" turned out there was no ffmpeg (only the keyword in other programms), I added a repository where it was included and could install it, but after "ldd /usr/bin/ffmpeg" i discovered ffmpeg was missing some libraries, I tried to install those libraries by typing their names in apt-get but they could not be found this way. – Abdul Al Hazred Apr 02 '15 at 20:46
  • Just saying, ffmpeg can be a real pain in the ass to install. It can be better to use a static install from git. Here is one that was created by a kind soul to save you from headaches: http://johnvansickle.com/ffmpeg/ – Baazigar Apr 02 '15 at 20:48
  • It would help if you would tell us which repository you installed it from. :-) Also, can you paste the output of `apt-get -f install` into your question, please? Note: ubuntu is based on Ubuntu 14.04, so you could look there if ffmpeg is not included in your distribution. – Faheem Mitha Apr 02 '15 at 20:50
  • I can not remember the name of the repository, but it was like the name of a surname that ends in son, when I tried to look it up in /etc/apt/sources.list /etc/apt/sources.list.d/ – Abdul Al Hazred Apr 02 '15 at 21:07
  • # apt-get -f install Reading package lists... Done Building dependency tree Reading state information... Done Correcting dependencies... Done The following packages will be REMOVED: ffmpeg 0 upgraded, 0 newly installed, 1 to remove and 376 not upgraded. 1 not fully installed or removed. After this operation, 852 kB disk space will be freed. Do you want to continue? [Y/n] y (Reading database ... 172386 files and directories currently installed.) Removing ffmpeg (4:0.5.10-1) ... Processing triggers for man-db (2.6.7.1-1ubuntu1) ... – Abdul Al Hazred Apr 02 '15 at 21:07
  • Note, if you want someone to be notified of a comment, you should add @person_name to it, otherwise they won't know about it. Your ffmpeg is fixable with a little work. Can you post the output of `apt-cache policy`, please? In a separate question, you ask about installing a static build. That is certainly an alternative, but I would prefer a proper binary package, other things being equal. – Faheem Mitha Apr 03 '15 at 08:39
  • @FaheemMitha (ok, I did not know this at_name has some real function) – Abdul Al Hazred Apr 03 '15 at 14:18
  • $ apt-cache policy Package files: 100 /var/lib/dpkg/status release a=now I can not post the output of "apt-cache policy" it is like over 6000 characters too long – Abdul Al Hazred Apr 03 '15 at 14:19
  • Are you saying the system won't let you post the contents of `apt-cache policy`? Your question does not look that long. if it does, go ahead and paste it into the question. Otherwise, do a pastebin and paste the link. Incidentally, if your ffmpeg did not install properly from a repos, your system may have other problems. – Faheem Mitha Apr 03 '15 at 14:42

4 Answers4

60

You can use:

ldconfig -p | grep libavfilter

If there is no output library is not installed. I am not sure if this is 100% reliable.
At least in man page of ldconfig for option -p:

Print the lists of directories and candidate libraries stored in the current cache.

taliezin
  • 9,085
  • 1
  • 34
  • 38
9

Look in /usr/lib and /usr/lib64 for those libraries. If you find one of the ones ffmpeg is missing, symlink it so it exists in the other directory.

You can also run a find for 'libm.so.6' and see where that file is at. There is a good chance ffmpeg is looking in the same directory for the missing ones. Symlink them over there once you find them.

If they don't exist on your server, install the package that includes them. If they are included in ffmpeg package but you don't see them, try reinstalling ffmpeg.

Baazigar
  • 732
  • 3
  • 9
  • So if it does not exist in /usr/lib or /usr/lib64 it is definitly 100 percent not installed ? – Abdul Al Hazred Apr 02 '15 at 21:09
  • If it does not exist in /usr/lib or /usr/lib64 it is most likely not installed. ffmpeg installation can be very hard, to get ffmpeg working as people expect, you often need ffmpeg and something else. Sometimes numerous 'something elses'. I highly suggest using a static build unless you prefer to suffer through the manual installation, which is understandable. – Baazigar Apr 02 '15 at 21:12
  • I do not know what a static build is .... – Abdul Al Hazred Apr 02 '15 at 21:13
  • 2
    Static build means ffmpeg and related tools have been compiled to all work together out of just one directory. When you use git to pull that down to your server, you have everything in that one place so there is no question of libraries or anything. It comes all in one 'box' so to speak, all you have to do is set your directives to point at it. Here is where you can read more about it and get it: http://johnvansickle.com/ffmpeg – Baazigar Apr 02 '15 at 21:21
  • also check in /lib/x86_64-linux-gnu – masterxilo Oct 12 '22 at 17:43
4

Use the command file `which ffmpeg` to determine whether ffmpeg is compiled for 64-bit or 32-bit. If it is 64-bit, look for the libraries in /usr/lib64. If it is 32-bit then look for the libraries in /usr/lib. If ffmpeg is statically linked then it doesn't matter...it won't use any shared libraries and the output of file will tell you that as well.

Do not symbolically link libraries between /usr/lib and /usr/lib64. This will not help you because a 64-bit program will need 64-bit libraries (found in /usr/lib64) and a 32-bit program will need 32-bit libraries (found in /usr/lib32).

If the libraries don't exist on your server, install the package that provides them (making sure you choose the 32-bit package if ffmpeg is 32-bit, etc).

gmorganVA
  • 41
  • 3
2

You could use the find command to search for the package, e.g.the following returns all libavfilter.so that are available on your system.

sudo find / -iname "libavfilter.so.*"

Note the ldconfig command may not work for you if you just installed the package and it's not loaded to ldd yet. So a more complete answer would be:

sudo ldconfig
ldconfig -p | grep libavfilter
Zstack
  • 121
  • 1