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

使用ffmpeg将图片转为视频时报错

ffmpeg: error while loading shared libraries: libopenh264.so.5: cannot open shared object file: No such file or directory
我的环境是ubuntu20.4,通过docker部署在centos服务器上

步骤一

通过以下命令查看ffmpeg库发现,我的ffmpeg是与pytorch挂钩,是在安装pytorch_1.8.1时一起安装的ffmpeg_4.3

conda list

在这里插入图片描述

步骤二

通过查阅网友的解决办法,可以确定是libopenh264.so.5版本太高,在对应 conda/env/lib 下仅发现libopenh264.so.6,一种比较直接的方法是直接重命名将6->5,但这样会导致 conda list 中丢失 ffmpeg,不过能正常运行,稳妥的办法是copy一份,重命名为libopenh264.so.5

cp ~/conda_env_path/lib/libopenh264.so.6 ~/conda_env_path/lib/libopenh264.so.5

通过这种方式,既保留了conda list中的ffmpeg,也能解决bug。

步骤三

测试命令

ffmpeg -i "image_path/%06d.png"  -r 30  -vf scale=-1:480 ./test.mp4

其它方法

由于bug本质是ffmpeg版本问题,所以替换当前版本即可。

# ffmpeg 4
conda install x264=='1!152.20180717' ffmpeg=4.0.2 -c conda-forge
# ffmpeg 3.4.1
conda install ffmpeg x264=20131218 -c conda-forge
  • 19
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
OpenH264 是思科公司发布的一个开源的 H.264 编码和解码器。编码器特性Constrained Baseline Profile up to Level 5.2 (4096x2304)Arbitrary resolution, not constrained to multiples of 16x16Rate control with adaptive quantization, or constant quantizationSlice options: 1 slice per frame, N slices per frame, N macroblocks per slice, or N bytes per sliceMultiple threads automatically used for multiple slicesTemporal scalability up to 4 layers in a dyadic hierarchySpatial simulcast up to 4 resolutions from a single inputLong Term Reference (LTR) framesMemory Management Control Operation (MMCO)Reference picture list modificationSingle reference frame for inter predictionMultiple reference frames when using LTR and/or 3-4 temporal layersPeriodic and on-demand Instantaneous Decoder Refresh (IDR) frame insertionDynamic changes to bit rate, frame rate, and resolutionAnnex B byte stream outputYUV 4:2:0 planar input解码器特性Constrained Baseline Profile up to Level 5.2 (4096x2304)Arbitrary resolution, not constrained to multiples of 16x16Single thread for all slicesLong Term Reference (LTR) framesMemory Management Control Operation (MMCO)Reference picture list modificationMultiple reference frames when specified in Sequence Parameter Set (SPS)Annex B byte stream inputYUV 4:2:0 planar output支持的操作系统Windows 64-bit and 32-bit (initial release is only 32-bit, 64-bit will follow soon)Mac OS X 64-bit (initial release does not include this target, will follow soon)Linux 64-bit and 32-bit (initial release is only 32-bit, 64-bit will follow soon)Android 32-bit (initial release does not include this target, will follow soon)iOS 64-bit and 32-bit (not supported yet, may be added in the future)支持的处理器Intel x86 optionally with MMX/SSE (no AVX yet, help is welcome)ARMv7 optionally with NEON (initial release does not include this target, will follow later)Any architecture using C/C fallback functions 标签:OpenH264

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值