安装

  1. # 创建目录
  2. $ mkdir /www/server/ffmpeg
  3. # 进入目录
  4. $ cd /www/server/ffmpeg
  5. # 下载安装包
  6. $ wget https://johnvansickle.com/ffmpeg/release-source/ffmpeg-4.1.tar.xz
  7. # 解压
  8. $ tar -Jxvf ffmpeg-4.1.tar.xz
  9. # 进入解压后目录
  10. $ cd ffmpeg-4.1/
  11. # 配置,开启openssl,因为我要用来解析远程URL视频
  12. $ ./configure --enable-openssl
  13. # 编译&安装
  14. $ make & make install
  15. # 查看当前目录,ffmpeg为可执行文件,可以将其加入环境变量
  16. $ pwd && ls
  17. /www/server/ffmpeg/ffmpeg-4.1
  18. Changelog COPYING.GPLv2 ffbuild INSTALL.md libavutil Makefile tools
  19. compat COPYING.GPLv3 ffmpeg libavcodec libpostproc presets VERSION
  20. config.asm COPYING.LGPLv2.1 ffmpeg_g libavdevice libswresample README.md
  21. config.h COPYING.LGPLv3 ffprobe libavfilter libswscale RELEASE
  22. configure CREDITS ffprobe_g libavformat LICENSE.md RELEASE_NOTES
  23. CONTRIBUTING.md doc fftools libavresample MAINTAINERS tests

测试

  1. # 进入可执行文件的目录,我没有加入环境变量
  2. $ cd /www/server/ffmpeg/ffmpeg-4.1
  3. $ ./ffmpeg -version
  4. ffmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers
  5. built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-44)
  6. configuration: --enable-openssl
  7. libavutil 56. 22.100 / 56. 22.100
  8. libavcodec 58. 35.100 / 58. 35.100
  9. libavformat 58. 20.100 / 58. 20.100
  10. libavdevice 58. 5.100 / 58. 5.100
  11. libavfilter 7. 40.101 / 7. 40.101
  12. libswscale 5. 3.100 / 5. 3.100
  13. libswresample 3. 3.100 / 3. 3.100

如果 ./configure 报错请安装 yasm

  1. $ yum install yasm