【安装】Linux安装ffmpeg

ffmpeg

下载地址

Index of /releases (ffmpeg.org)

下载

wget https://ffmpeg.org//releases/ffmpeg-6.1.1.tar.gz
tar -zxvf ffmpeg-6.1.1.tar.gz

进入解压后目录,输入如下命令/usr/local/ffmpeg为自己指定的安装目录

cd ffmpeg-6.1.1
./configure --prefix=/usr/local/ffmpeg
make && make install

这里可能会遇到问题, 可以参考下边对应的解决方案

配置环境变量

vi /etc/profile
# 在最后PATH添加环境变量:
export PATH=$PATH:/usr/local/ffmpeg/bin

# 保存退出
:wq

# 查看是否生效
source /etc/profile  设置生效

查看版本

ffmpeg -version    查看版本


遇到的问题

问题一

nasm/yasm not found or too old. Use --disable-x86asm for a crippled build.

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.libera.chat.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.

解决方案

分析:yasm是汇编编译器,ffmpeg为了提高效率使用了汇编指令,如MMX和SSE等。所以系统中未安装yasm时,就会报上面错误。

解决错误:安装yasm编译器。安装方法如下

yasm官网

The Yasm Modular Assembler Project (tortall.net)

Download - The Yasm Modular Assembler Project (tortall.net)

1)下载:​ ​yasm

2)解压:把下载下来的压缩包进行解压

3)切换路径: cd yasm-1.3.0

4)执行配置: ./configure

5)编译:make

6)安装:make install

wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
tar -zxvf yasm-1.3.0.tar.gz
cd yasm-1.3.0
./configure
make && make install

问题二

若运行 ffmpeg -i 报错误:

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

相关推荐

  1. 安装Linux安装ffmpeg

    2024-01-17 00:42:01       41 阅读
  2. Linux安装ffmpeg

    2024-01-17 00:42:01       33 阅读
  3. Linux系统安装ffmpeg & 升级ffmpeg

    2024-01-17 00:42:01       40 阅读
  4. linux 环境下安装ffmpeg

    2024-01-17 00:42:01       46 阅读
  5. ffmpeg 安装

    2024-01-17 00:42:01       35 阅读
  6. 安装 FFmpeg

    2024-01-17 00:42:01       11 阅读
  7. FFmpeg - 如何在Linux安装支持CUDA的FFmpeg

    2024-01-17 00:42:01       14 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-01-17 00:42:01       16 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-01-17 00:42:01       16 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-01-17 00:42:01       15 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-01-17 00:42:01       18 阅读

热门阅读

  1. HTTP协议学习 可以从这些方面开始

    2024-01-17 00:42:01       33 阅读
  2. Vue待办事项的实现

    2024-01-17 00:42:01       21 阅读
  3. linux系统nginx做负载均衡

    2024-01-17 00:42:01       23 阅读
  4. node 第二十一天 webpack 初见

    2024-01-17 00:42:01       36 阅读
  5. WPF 获取父容器控件的宽度

    2024-01-17 00:42:01       24 阅读
  6. CSS Day6-Day8 浮动和定位

    2024-01-17 00:42:01       33 阅读
  7. .NET学习教程二——.net基础定义+VS常用设置

    2024-01-17 00:42:01       31 阅读
  8. leetcode 1两数之和

    2024-01-17 00:42:01       33 阅读
  9. 记录一下常用的工具类

    2024-01-17 00:42:01       25 阅读
  10. 时间复杂度和空间复杂度

    2024-01-17 00:42:01       33 阅读