东方耀AI技术分享

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
查看: 3359|回复: 5
打印 上一主题 下一主题

[FFmpeg] ffmpeg下载,编译与安装_FFmpeg音视频核心技术精讲与实战

[复制链接]

1365

主题

1856

帖子

1万

积分

管理员

Rank: 10Rank: 10Rank: 10

积分
14429
QQ
跳转到指定楼层
楼主
发表于 2020-2-12 16:31:45 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式


ffmpeg下载,编译与安装

FFmpeg音视频核心技术精讲与实战


下载地址:https://github.com/FFmpeg/FFmpeg


ffmpeg是高度可定制化的  可以自己配置需要哪些模块功能 ./configure   生成Makefile文件

MAC下:

./configure --prefix=/usr/local/ffmpeg --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libx264 --enable-libx265 --enable-filter=delogo --enable-debug --disable-optimizations --enable-libspeex --enable-videotoolbox --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --cc=clang --host-cflags= --host-ldflags=


然后再编译和安装   make && make install   成功的话会在安装目录下生成文件 bin lib include ...等


编译最好不要在win上 可以选择Linux or mac     



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


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


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


1)下载:[yasm的下载链接](http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz)


http://www.tortall.net/projects/yasm/


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


3)切换路径: cd yasm-1.3.0


4)执行配置: ./configure


5)编译:make


6)安装:make install(提示:Permission denied,就执行sudo make install)




安装成功yasm后再进入到ffmpeg的文件夹下  



Mac OS编译ffmpeg出错ERROR: libfdk_aac not found,安装libfdk后解决

First Try -首先执行如下命令brew install fdk-aac


Failing that you can compile like I do-然后执行如下操作:

git clone git://github.com/mstorsjo/fdk-aac
cd fdk-aac
autoreconf -i
./configure
make install


ERROR: speex not found using pkg-config

brew install speex
brew install pkg-config


ERROR: libx264 not found

brew install x264

ERROR: x265 not found using pkg-config

brew install x265




编译 安装 成功后  执行:


dongfangyaodeMacBook-Pro:~ dongfangyao$ /usr/local/ffmpeg/bin/ffmpeg
ffmpeg version 4.2.git Copyright (c) 2000-2020 the FFmpeg developers
  built with Apple LLVM version 10.0.0 (clang-1000.10.44.4)
  configuration: --prefix=/usr/local/ffmpeg --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libx264 --enable-libx265 --enable-filter=delogo --enable-debug --disable-optimizations --enable-libspeex --enable-videotoolbox --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --cc=clang --host-cflags= --host-ldflags=
  libavutil      56. 39.100 / 56. 39.100
  libavcodec     58. 68.102 / 58. 68.102
  libavformat    58. 38.100 / 58. 38.100
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 75.100 /  7. 75.100
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

为了更方便执行,配置一下环境变量:
vim ~/.bash_profile

# setting ffmpeg
export PATH=$PATH:/usr/local/ffmpeg/bin

保存后退出   重启终端后   直接输入命令ffmpeg 即可


ffmpeg配置.png (235.76 KB, 下载次数: 168)

ffmpeg配置.png

1-7 ffmpeg命令大全文档.png (738.23 KB, 下载次数: 168)

1-7 ffmpeg命令大全文档.png

ffmpeg_help.png (138.42 KB, 下载次数: 162)

ffmpeg_help.png

yasm.png (98.8 KB, 下载次数: 167)

yasm.png

dfy.png (321.29 KB, 下载次数: 167)

dfy.png
让天下人人学会人工智能!人工智能的前景一片大好!
回复

使用道具 举报

1365

主题

1856

帖子

1万

积分

管理员

Rank: 10Rank: 10Rank: 10

积分
14429
QQ
沙发
 楼主| 发表于 2020-2-13 09:43:00 | 只看该作者
nasm/yasm not found or too old. Use --disable-x86asm for a crippled build
让天下人人学会人工智能!人工智能的前景一片大好!
回复

使用道具 举报

1365

主题

1856

帖子

1万

积分

管理员

Rank: 10Rank: 10Rank: 10

积分
14429
QQ
板凳
 楼主| 发表于 2020-2-13 09:47:03 | 只看该作者
ERROR: libfdk_aac not found
让天下人人学会人工智能!人工智能的前景一片大好!
回复

使用道具 举报

1365

主题

1856

帖子

1万

积分

管理员

Rank: 10Rank: 10Rank: 10

积分
14429
QQ
地板
 楼主| 发表于 2020-2-13 09:54:21 | 只看该作者
ERROR: speex not found using pkg-config
让天下人人学会人工智能!人工智能的前景一片大好!
回复

使用道具 举报

1365

主题

1856

帖子

1万

积分

管理员

Rank: 10Rank: 10Rank: 10

积分
14429
QQ
5#
 楼主| 发表于 2020-2-13 09:58:44 | 只看该作者
ERROR: libx264 not found
让天下人人学会人工智能!人工智能的前景一片大好!
回复

使用道具 举报

1365

主题

1856

帖子

1万

积分

管理员

Rank: 10Rank: 10Rank: 10

积分
14429
QQ
6#
 楼主| 发表于 2020-2-13 10:14:29 | 只看该作者
ERROR: x265 not found using pkg-config
让天下人人学会人工智能!人工智能的前景一片大好!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|人工智能工程师的摇篮 ( 湘ICP备2020019608号-1 )

GMT+8, 2024-4-20 19:10 , Processed in 0.190740 second(s), 21 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表