Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ffmpeg: error while loading shared libraries: libopenh264.so.5

I am using ffmpeg and getting this error

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

I have already checked if the library exists and it does. I added it to /etc/ld.so.conf as mentioned in this previous question but it doesn't work.

like image 959
ESZ Avatar asked Jun 05 '20 10:06

ESZ


2 Answers

I faced this error when I run ffmpeg 4.2.2 under python 3.8 environment.

The root cause is that libopen264.so from python 3.8 is too new for ffmpeg 4.2.2. I can find libopen264.so.6 under the ~/anaconda3/envs/py38/lib/ (py38 is my conda virtual environment), but we only need an older version libopen264.so.5.

To solve the problem, I just make a softlink from my existing anaconda environment (python 3.7) as follows - and it works.

ln -s ~/anaconda3/lib/libopenh264.so ~/anaconda3/envs/py38/lib/libopenh264.so.5

like image 186
william007 Avatar answered Sep 21 '22 09:09

william007


Another approach that seemed easier and worked for me on Ubuntu 16.04 and python 3.8 was just calling:

conda update ffmpeg

from this post.

like image 22
dzubke Avatar answered Sep 20 '22 09:09

dzubke