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
$ ./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 /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)
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).