Monday, February 22, 2010

ffmpeg: error while loading shared libraries: libswscale.so.0: cannot open shared object file: No such file or directory

2 other solutions. Begin by making sure that you indeed have the libraries installed. Run the command locate libavdevice.so.52 and you should have the specific file path showing up in the list.

I will assume that the location of these libraries is /usr/local/lib/ such as /usr/local/lib/libavdevice.so.52 .

- Now that we know that the libraries are there, The first solution to fix this problem is to create symlinks of the missing libraries from /usr/lib to /usr/local/lib

ln -s /usr/local/lib/libavdevice.so.52 /usr/lib/libavdevice.so.52
ln -s /usr/local/lib/libavformat.so.52 /usr/lib/libavformat.so.52
etc ...

Not a very elegant solution.

- My preferred solution: there's a file called /etc/ld.so.conf. In my ubuntu install it contains a single line that includes the content of the directory /etc/ld.so.conf.d/

That directory in turn should normally have a couple of files. One of them should be /etc/ld.so.conf.d/libc.conf, which contains the line /usr/local/lib . If this is the case, then simply run the command sudo ldconfig -v to reload the libraries cache and your problem should be fixed.

If the file doesn't exist you could create one called /etc/ld.so.conf.d/ffmpeg.conf (or even libc.conf) and add the line /usr/local/lib in it, then run sudo ldconfig -v.

No comments:

Post a Comment