您现在的位置是:首页 > 博客日记 > Liunx Liunx

window和liunx安装ffmpeg

2019-09-19 17:34:39 【Liunx】 人已围观

多媒体视频处理工具FFmpeg有非常强大的功能包括视频采集功能、视频格式转换、视频抓图、给视频加水印等。很多剪辑软件的后台都是使用ffmpeg来处理数据!

ffmpeg官网

liunx下载安装

  1. wget http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
  2. #解压
  3. tar -jxvf ffmpeg-snapshot.tar.bz2
  4. #进入目录
  5. cd ffmpeg

编译安装

  1. ./configure --enable-shared --prefix=/usr/local/ffmpeg && make && make install
如果报错
  1. [root@iZj6c4ty14huv1ncu5e9axZ ffmpeg]# ./configure --enable-shared --prefix=/usr/local/ffmpeg && make && make install
  2. nasm/yasm not found or too old. Use --disable-x86asm for a crippled build.
  3. If you think configure made a mistake, make sure you are using the latest
  4. version from Git. If the latest version fails, report the problem to the
  5. ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
  6. Include the log file "ffbuild/config.log" produced by configure as this will help
  7. solve the problem.

那就这样安装

  1. ./configure --enable-shared --disable-x86asm --prefix=/usr/local/ffmpeg && make && make install

添加软链

  1. cp /usr/local/ffmpeg/bin/ffmpeg /usr/local/bin/ffmpeg

安装完成之后 执行 ffmpeg -version

如果能够出现类似下列信息,说明ffmpeg安装成功。

  1. [root@iZbp153yczpm4pp9pjs0u3Z local]# ffmpeg -version
  2. ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
  3. built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-36)
  4. configuration: --enable-shared --disable-yasm --prefix=/usr/local/ffmpeg
  5. libavutil 56. 14.100 / 56. 14.100
  6. libavcodec 58. 18.100 / 58. 18.100
  7. libavformat 58. 12.100 / 58. 12.100
  8. libavdevice 58. 3.100 / 58. 3.100
  9. libavfilter 7. 16.100 / 7. 16.100
  10. libswscale 5. 1.100 / 5. 1.100
  11. libswresample 3. 1.100 / 3. 1.100

如果报错 libavdevice.so.57: cannot open shared object file: No such file or directory
执行命令:vim /etc/ld.so.conf.d/ffmpeg.conf 然后添加一行内容: /usr/local/ffmpeg/lib 之后保存并退出,然后执行 ldconfig 使配置生效,现在再次执行 ffmpeg -version 显示就正常了

windows下载安装

  1. https://www.gyan.dev/ffmpeg/builds/ffmpeg-git-full.7z

解压到 D://ffmpeg 下面

添加环境变量

安装成功



关注TinyMeng博客,更多精彩分享,敬请期待!
 

很赞哦! ()