I was executing ffmpeg from php running inside apache. I used to get the error " error while loading shared libraries: libavdevice.so.52: cannot open shared object file: No such file or directory".
It used to work perfectly if the php script was executed from the command prompt or ffpmeg was directly invoked from the command prompt.
I followed the below steps to fix the apache error:
Step 1: Check if the file “libavdevice.so.52″ exists in the server using the following command.
find / -name ‘libavdevice.so.*’
Step 2: You will get the directory in which the file “libavdevice.so.52″ exists from the above command. Suppose the directory is “/usr/local/lib/” in this example.
Step 3: You have to add the directory name in the file “/etc/ld.so.conf”.
Step 4: Execute the command “ldconfig”.
How did doing the above make a difference to apache?