My ffmpeg command gives error when I try to convert video format. I have installed ffmpeg manually following this guide.

For above issue I checked ffmpeg: error while loading shared libraries: libtheoraenc.so.1 also but not able to resolve my issue.

My command is : /root/bin/ffmpeg -i /home/pulsebrk/public_html/beta/user_uploads/6/1148a008470721f06c8dc71efa70622f99799e91.avi -acodec libvorbis -ac 2 -ab 96k -ar 44100 -b 345k -s x /home/pulsebrk/public_html/beta/user_uploads/6/1148a008470721f06c8dc71efa70622f99799e91.ogv
and error is:

/root/bin/ffmpeg: error while loading shared libraries: libtheoraenc.so.1: 
   cannot open shared object file: No such file or directory

libtheroa version is : 1.1.1

  • OS, please. And why didn't you use your distribution's binary package? Is none available? – Faheem Mitha Feb 12 '14 at 14:11
  • I assumed you were using CentOS since you referenced the CentOS installation instructions for ffmpeg. Please confirm this and also which version of CentOS, 5 or 6? – slm Feb 12 '14 at 14:53

Your issue sounds like you don't have the correct version of the libtheoraenc library for this particular version of ffmpeg. That's what this message is complaining about:

/root/bin/ffmpeg: error while loading shared libraries: libtheoraenc.so.1: 

Configured + compiled library correctly?

When you built ffmpeg did you also include the "Additional libraries" mentioned on that page as well as include the additional configure switches when you built ffmpeg?

$ ./configure --enable-libtheora ....

Libraries in LD's cache?

If you have done all this the 2 other things to investigate would be did you update your shared library cache?

$ ldconfig -v

Also make sure if you did install libtheoranc manually that the directory it was installed into is present in your shared library .conf file, typically /etc/ld.so.conf or that there's a file present in /etc/ld.so.conf.d/ with the path to the directory.

Shared libraries are accounted for?

Lastly you can see where shared libraries are coming from with the command ldd /path/to/ffmpeg.


$ ldd /usr/bin/ls
    linux-vdso.so.1 =>  (0x00007fffefdfe000)
    libselinux.so.1 => /lib64/libselinux.so.1 (0x0000003d89600000)
    libcap.so.2 => /lib64/libcap.so.2 (0x0000003fa6200000)
    libacl.so.1 => /lib64/libacl.so.1 (0x0000003fa4e00000)
    libc.so.6 => /lib64/libc.so.6 (0x0000003f8ba00000)
    libdl.so.2 => /lib64/libdl.so.2 (0x0000003f8c200000)
    libpcre.so.1 => /lib64/libpcre.so.1 (0x0000003d89200000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003f8c600000)
    /lib64/ld-linux-x86-64.so.2 (0x0000003f8b600000)
    libattr.so.1 => /lib64/libattr.so.1 (0x0000003fa3600000)

Make sure that each dynamic library name (on the left) is pointing to a corresponding file on disk (on the right).

  • I recompiled ffmpeg thrice and added ffmpeg lib path to ld.so.conf.d. and it resolved this issue. Now I'm able to convert video from avi to ogv, if I directly fire command from putty on server, but same command is not working from PHP webpage. – Paks Feb 13 '14 at 4:49
  • I tried giving permission to ffmpeg installation directory as well bin directory but no any luck. – Paks Feb 13 '14 at 4:56
  • @Paks - so wait this solves your original issue, right? You probably should make that a new Q, it's likely something completely unrelated to building ffmpeg, and please remember to mark this as the accepted A so other's know your issue's been resolved w/ building ffmpeg. – slm Feb 13 '14 at 5:46

You need add the libtheoraenc.so.1 file to /usr/lib or /usr/lib64.

  • Welcome to Unix.SE! Please explain how to go about adding this file, that would make the answer useful... – Stephen Kitt Jan 23 '18 at 8:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.