@@ -10,66 +10,68 @@ At present MRFFToolChain contained OpenSSL、FFmpeg 、libyuv、libopus、libblu
10
10
11
11
```
12
12
├── README.md
13
- ├── apple #apple平台通用编译脚本
13
+ ├── apple #apple平台通用编译脚本
14
14
│ ├── compile-any.sh
15
15
│ ├── compile-cfgs
16
16
│ ├── do-compile
17
17
│ └── init-env.sh
18
- ├── build #编译目录
19
- │ ├── product #编译产物
20
- │ └── src #构建时源码仓库
21
- ├── extra #ffmpeg,openssl 等库的源码
22
- │ ├── bluray
23
- │ ├── dav1d
24
- │ ├── ffmpeg
25
- │ ├── libyuv
26
- │ ├── openssl
27
- │ ├── opus
28
- │ └── patches #打的补丁
29
- ├── ffconfig #ffmpeg 功能裁剪配置
18
+ ├── build #编译目录
19
+ │ ├── extra #源码仓库
20
+ │ ├── pre #下载的预编译库
21
+ │ ├── product #编译产物
22
+ │ └── src #构建时源码仓库
23
+ ├── ffconfig #ffmpeg 功能裁剪配置
30
24
│ ├── configure.md
31
25
│ ├── module-default.sh
32
26
│ ├── module-full.sh
33
27
│ ├── module-lite-hevc.sh
34
28
│ ├── module-lite.sh
29
+ │ ├── module-program.sh
35
30
│ └── module.sh -> module-full.sh
36
- ├── init-any.sh #初始化源码仓库
37
- ├── download-pre.sh #从github下载预编好的库
38
- ├── init-cfgs #三方库的配置,包括库名,git仓库地址等信息
31
+ ├── init-any.sh #初始化源码仓库
32
+ ├── init-cfgs #三方库的配置,包括库名,git仓库地址等信息
39
33
│ ├── bluray
40
34
│ ├── dav1d
41
35
│ ├── ffmpeg
42
36
│ ├── libyuv
43
37
│ ├── openssl
44
38
│ └── opus
45
- ├── ios #ios 平台编译脚本
39
+ ├── install-pre-any.sh #直接从github下载预编译好的lib
40
+ ├── ios #ios 平台编译脚本
46
41
│ └── compile-any.sh
47
- ├── macos #macos 平台编译脚本
42
+ ├── macos #macos 平台编译脚本
48
43
│ └── compile-any.sh
49
- └── tools #初始化仓库依赖的脚本
50
- ├── copy-local-repo.sh
51
- ├── env_assert.sh
52
- ├── init-repo.sh
53
- ├── pull-repo-base.sh
54
- └── pull-repo-ref.sh
44
+ ├── patches #补丁
45
+ │ ├── README.md
46
+ │ ├── dav1d
47
+ │ ├── ffmpeg -> ffmpeg-release-5.1
48
+ │ ├── ffmpeg-n4.0
49
+ │ └── ffmpeg-release-5.1
50
+ ├── tools #基础脚本
51
+ │ ├── copy-local-repo.sh
52
+ │ ├── env_assert.sh
53
+ │ ├── init-repo.sh
54
+ │ ├── install-pre-lib.sh
55
+ │ ├── pull-repo-base.sh
56
+ │ └── pull-repo-ref.sh
57
+ └── version.sh
55
58
```
56
59
57
- ## Download Precompiled Edition
60
+ ## Download Pre-compiled libs
58
61
59
62
可以跳过自己编译,直接从github上下载预编译好的库,节省时间!
60
- 预编译库分为 ijk 版和 github 版,其区别是 ijk 版本打了 extra/patches/ffmpeg 目录下的补丁。
63
+ 预编译库已经打了 extra/patches/ 目录下的补丁,调用示例:
61
64
62
- - 下载 ijk 版预编译库:./download-pre.sh ijk
63
- - 下载 github 版预编译库:./download-pre.sh github
64
-
65
- 可指定平台:
65
+ ``` bash
66
+ ./install-pre-any.sh all
67
+ ./install-pre-any.sh ios ' libyuv openssl opus bluray dav1d'
68
+ ./install-pre-any.sh macos ' openssl'
69
+ ./install-pre-any.sh macos ' openssl ffmpeg'
70
+ ```
66
71
67
- - 下载 ijk 版 iOS 平台的预编译库:./download-pre.sh ijk ios
68
- - 下载 ijk 版 macOS 平台的预编译库:./download-pre.sh ijk macos
69
- - 下载 github 版 iOS 平台的预编译库:./download-pre.sh github ios
70
- - 下载 github 版 macOS 平台的预编译库:./download-pre.sh github macos
72
+ ## Compile by yourself
71
73
72
- ## Init Lib Repo
74
+ ### Init lib repos
73
75
74
76
脚本参数比较灵活,可根据需要搭配使用,常用方式举例:
75
77
@@ -90,80 +92,76 @@ At present MRFFToolChain contained OpenSSL、FFmpeg 、libyuv、libopus、libblu
90
92
/init-any.sh all "openssl ffmpeg"
91
93
```
92
94
93
- 高级选项:
94
-
95
- 设置环境变量 export SKIP_FFMPEG_PATHCHES=1 不打 FFmpeg 补丁;
96
- 设置环境变量 export SKIP_PULL_BASE=1 不从远程拉取最新代码;
97
-
98
- ## Compile
95
+ ### Compile
99
96
100
97
根据编译的平台,进入相应的目录,比如编译 macos 平台:
101
98
102
99
```
103
- cd macos
104
100
# 编译 macos arm64 架构下的所有库
105
- ./compile-any.sh build all arm64
101
+ ./macos/ compile-any.sh build all arm64
106
102
# 编译 macos x86_64 架构下的所有库
107
- ./compile-any.sh build all x86_64
103
+ ./macos/ compile-any.sh build all x86_64
108
104
# 编译 macos 所有架构下的所有库
109
- ./compile-any.sh build all
105
+ ./macos/ compile-any.sh build all
110
106
```
111
107
112
108
编译指定库,比如 openssl,ffmpeg
113
109
114
110
```
115
- cd macos
116
- # 编译 macos arm64 架构
117
- ./compile-any.sh build "openssl ffmpeg" arm64
111
+ # 编译 macos arm64 架构 debug 版
112
+ ./macos/compile-any.sh build "openssl ffmpeg" arm64 debug
118
113
# 编译 macos x86_64 架构
119
- ./compile-any.sh build "openssl ffmpeg" x86_64
114
+ ./macos/ compile-any.sh build "openssl ffmpeg" x86_64
120
115
# 编译 macos 所有架构
121
- ./compile-any.sh build "openssl ffmpeg"
116
+ ./macos/ compile-any.sh build "openssl ffmpeg"
122
117
```
123
118
124
119
清理 macos 平台编译产物
125
120
126
121
```
127
- cd macos
128
122
# 清理 macos arm64 架构下的所有库的产物
129
- ./compile-any.sh clean all arm64
123
+ ./macos/ compile-any.sh clean all arm64
130
124
# 清理 macos x86_64 架构下的所有库的产物
131
- ./compile-any.sh clean all x86_64
125
+ ./macos/ compile-any.sh clean all x86_64
132
126
# 清理 macos 所有架构下的所有库的产物
133
- ./compile-any.sh clean all
127
+ ./macos/ compile-any.sh clean all
134
128
```
135
129
136
130
将 macos 平台编译产物合并成 fat 版本放到 universal 文件夹下(build 所有架构时会自动lipo,只有手动编译不同架构时才会用到 lipo)
137
131
138
132
```
139
- cd macos
140
133
# 合并 macos 所有架构下的所有库的产物
141
- ./compile-any.sh lipo all
134
+ ./macos/ compile-any.sh lipo all
142
135
# 将 macos arm64 架构下的所有库的产物复制到 universal
143
- ./compile-any.sh lipo all arm64
136
+ ./macos/ compile-any.sh lipo all arm64
144
137
# 将 macos x86_64 架构下的所有库的产物复制到 universal
145
- ./compile-any.sh lipo all x86_64
138
+ ./macos/ compile-any.sh lipo all x86_64
146
139
```
147
140
148
- 编译 ios 平台跟 macos 是一样的流程,只需要 cd 到 ios 目录操作即可 。
141
+ 编译 ios 平台跟 macos 是一样的流程,只需要将 macos 改成 ios 即可 。
149
142
150
- 实际上 ios 和 macos 均调用了 apple 目录下的脚本。
151
-
152
- ## Use Your Mirror
143
+ ### Support Mirror
153
144
154
145
如果 github 上的仓库克隆较慢,或者需要使用内网私有仓库,可在执行编译脚本前声明对应的环境变量!
155
146
156
147
| 名称 | 默认仓库 | 使用镜像 |
157
148
| --------- | ------------------------------------------------ | -------------------------------------------------- |
158
149
| FFmpeg | https://github.com/bilibili/FFmpeg.git | export GIT_FFMPEG_UPSTREAM=git@xx: yy /ffmpeg.git |
159
- | libYUV | https://github.com/lemenkov/libyuv.git | export GIT_FDK_UPSTREAM =git@xx: yy /libyuv.git |
160
- | OpenSSL | https://github.com/openssl/openssl.git | export GIT_OPUS_UPSTREAM =git@xx: yy /openssl.git |
150
+ | libYUV | https://github.com/lemenkov/libyuv.git | export GIT_LIBYUV_UPSTREAM =git@xx: yy /libyuv.git |
151
+ | OpenSSL | https://github.com/openssl/openssl.git | export GIT_OPENSSL_UPSTREAM =git@xx: yy /openssl.git |
161
152
| Opus | https://gitlab.xiph.org/xiph/opus.git | export GIT_OPUS_UPSTREAM=git@xx: yy /opusfile.git |
162
153
| libbluray | https://code.videolan.org/videolan/libbluray.git | export GIT_BLURAY_UPSTREAM=git@xx: yy /libbluray.git |
163
- | dav1d | https://code.videolan.org/videolan/dav1d.git | GIT_DAV1D_UPSTREAM=git@xx: yy /dav1d.git |
154
+ | dav1d | https://code.videolan.org/videolan/dav1d.git | export GIT_DAV1D_UPSTREAM=git@xx: yy /dav1d.git |
155
+
156
+ ## Advanced Configuration
164
157
165
- ## Platform Configuration
158
+ 1、初始化代码仓库时:
159
+
160
+ ```
161
+ 设置环境变量 export SKIP_FFMPEG_PATHCHES=1 不打 FFmpeg 补丁;
162
+ 设置环境变量 export SKIP_PULL_BASE=1 不从远程拉取最新代码;
163
+ ```
166
164
167
- 1 、如果不同的平台需要编译不同的库,只需要在 apple/compile-cfgs 目录下,建立 list_PLAT.txt 文件即可,PLAT 为对应的平台,比如 ios,macos 等;默认情况下按照 list.txt 里声明的顺序编译各个库。
165
+ 2 、如果不同的平台需要编译不同的库,只需要在 apple/compile-cfgs 目录下,建立 list_PLAT.txt 文件即可,PLAT 为对应的平台,比如 ios,macos 等;默认情况下按照 list.txt 里声明的顺序编译各个库。
168
166
169
- 2 、ffmpeg 的配置需要分平台指定,只需要在 ffconfig 目录下创建 module_PLAT.sh 文件即可,PLAT 为对应的平台,比如 ios,macos 等;默认情况下根据 module.sh 声明的配置进行编译 ffmpeg。
167
+ 3 、ffmpeg 的配置需要分平台指定,只需要在 ffconfig 目录下创建 module_PLAT.sh 文件即可,PLAT 为对应的平台,比如 ios,macos 等;默认情况下根据 module.sh 声明的配置进行编译 ffmpeg。
0 commit comments