linux获取ffmpeg安装目录,linux 安装ffmpeg 并用php获取视频封面

本文介绍了如何在Linux系统中安装FFmpeg,包括下载、编译和解决依赖问题。通过运行`ffmpeg -version`确认安装成功。若遇到`libavdevice.so.57`错误,需编辑`ld.so.conf`并执行`ldconfig`。同时,当需要在PHP中使用FFmpeg时,可以使用`php-ffmpeg/php-ffmpeg`库,配置FFmpeg和ffprobe的路径,并通过示例代码展示如何获取视频帧。
摘要由CSDN通过智能技术生成

安装ffmpeg

http://ffmpeg.org/download.html下载包

tar -jxvf ffmpeg-x.x.tar.bz2

cd ffmpeg-x.x

./configure --enable-shared --enable-libfreetype && make && make install

(如果编译报错,请加选项(报错会提示选项内容)./configure --enable-shared  --选项 && make && make install

安装完成使用 ffmpeg -version查看安装信息

如果出现ffmpeg: error while loading shared libraries: libavdevice.so.57: cannot open shared object file: No such file or directory

则编辑/etc/ld.so.conf文件中的:include ld.so.conf.d/*.conf 这行下面加入如下内容

/usr/local/ffmpeg-4.0.2

保存退出后执行ldconfig命令

报错nasm/yasm not found or too old则先安装yasm

tar -zxvf yasm.tar.gz

cd yasm-1.3.0/

./configure

make && make install

生成文字水印

ffmpeg-ia.mp4-vfdrawtext=fontfile=/usr/share/fonts/dejavu/DejaVuSans.ttf:text=welcome:x=10:y=10:fontsize=48:fontcol

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值