ffmpeg生成视频截图时,报错:找不到libiconv.so.2

执行生成截图命令:

ffmpeg -i path_to_video -y -f mjpeg -ss 1 -t 0.001 path_to_cover_img 2>&1

结果报错:

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

原因:

明显就是没有 libiconv.so.2


解决办法:

#下载libiconv

wget https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.16.tar.gz

tar -zxvf libiconv-1.16.tar.gz

cd libiconv-1.16

#编译安装

./configure --prefix=/usr/local

make

make_install

ln -s /usr/local/lib/libiconv.so.2 /usr/lib/libiconv.so.2

ldconfig

你可能感兴趣的:(ffmpeg生成视频截图时,报错:找不到libiconv.so.2)