While installing ffmpeg, if you get error like 'ffmpeg: error while loading shared libraries: libavdevice.so.52: cannot open shared object file: No such file or directory' Just use following commands, it will solve your issue.
find / -name 'libavdevice.so.*'
Output will be something like
"/usr/local/lib/libavdevice.so.52
/usr/local/lib/libavdevice.so.52.2.0
After that use following command.
echo "/usr/local/lib/libavdevice.so.52" >> /etc/ld.so.conf
echo "/usr/local/lib/libavdevice.so.52.2.0" >> /etc/ld.so.conf
ldconfig
Enjoy