Skip to content

Commit 94efbf3

Browse files
committed
add some picture decoders.
1 parent 104be8c commit 94efbf3

File tree

4 files changed

+109
-10
lines changed

4 files changed

+109
-10
lines changed

README.md

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
**What's MRFFToolChain?**
44

5-
MRFFToolChain products was built for my FFmepg tutorial : https://github.com/debugly/FFmpegTutorial.
5+
MRFFToolChain products was built for my FFmepg tutorial : [https://github.com/debugly/FFmpegTutorial](https://github.com/debugly/FFmpegTutorial).
66

77
At present MRFFToolChain contained OpenSSL、FFmpeg 、libyuv、libopus、libbluray、etc.
88

@@ -34,6 +34,7 @@ At present MRFFToolChain contained OpenSSL、FFmpeg 、libyuv、libopus、libblu
3434
│   ├── module-lite.sh
3535
│   └── module.sh -> module-full.sh
3636
├── init-any.sh #初始化源码仓库
37+
├── download-pre.sh #从github下载预编好的库
3738
├── init-cfgs #三方库的配置,包括库名,git仓库地址等信息
3839
│   ├── bluray
3940
│   ├── dav1d
@@ -53,6 +54,19 @@ At present MRFFToolChain contained OpenSSL、FFmpeg 、libyuv、libopus、libblu
5354
└── pull-repo-ref.sh
5455
```
5556

57+
## ## Download Pre Compiled
58+
59+
可以跳过自己编译,直接从github上下载预编译好的库,节省时间!
60+
61+
```bash
62+
#下载 iOS 平台的预编译库
63+
./download-pre.sh ios
64+
#下载 macOS 平台的预编译库
65+
./download-pre.sh macos
66+
#下载 ios 和 macOS 平台的预编译库
67+
./download-pre.sh all
68+
```
69+
5670
## Init Lib Repo
5771

5872
脚本参数比较灵活,可根据需要搭配使用,常用方式举例:
@@ -132,17 +146,17 @@ cd macos
132146

133147
如果 github 上的仓库克隆较慢,或者需要使用内网私有仓库,可在执行编译脚本前声明对应的环境变量!
134148

135-
| 名称 | 默认仓库 | 使用镜像 |
136-
| --- | --- | --- |
137-
| FFmpeg | https://github.com/bilibili/FFmpeg.git | export GIT_FFMPEG_UPSTREAM=git@xx:yy/ffmpeg.git |
138-
| libYUV | https://github.com/lemenkov/libyuv.git | export GIT_FDK_UPSTREAM=git@xx:yy/libyuv.git |
139-
| OpenSSL | https://github.com/openssl/openssl.git | export GIT_OPUS_UPSTREAM=git@xx:yy/openssl.git |
140-
| Opus | [Xiph.Org / Opus · GitLab](https://gitlab.xiph.org/xiph/opus.git) | export GIT_OPUS_UPSTREAM=git@xx:yy/opusfile.git |
141-
| libbluray | [VideoLAN / libbluray · GitLab](https://code.videolan.org/videolan/libbluray.git) | export GIT_BLURAY_UPSTREAM=git@xx:yy/libbluray.git |
142-
| dav1d | https://code.videolan.org/videolan/dav1d.git | GIT_DAV1D_UPSTREAM=git@xx:yy/dav1d.git |
149+
| 名称 | 默认仓库 | 使用镜像 |
150+
| --------- | ------------------------------------------------ | -------------------------------------------------- |
151+
| FFmpeg | https://github.com/bilibili/FFmpeg.git | export GIT_FFMPEG_UPSTREAM=git@xx:yy/ffmpeg.git |
152+
| libYUV | https://github.com/lemenkov/libyuv.git | export GIT_FDK_UPSTREAM=git@xx:yy/libyuv.git |
153+
| OpenSSL | https://github.com/openssl/openssl.git | export GIT_OPUS_UPSTREAM=git@xx:yy/openssl.git |
154+
| Opus | https://gitlab.xiph.org/xiph/opus.git | export GIT_OPUS_UPSTREAM=git@xx:yy/opusfile.git |
155+
| libbluray | https://code.videolan.org/videolan/libbluray.git | export GIT_BLURAY_UPSTREAM=git@xx:yy/libbluray.git |
156+
| dav1d | https://code.videolan.org/videolan/dav1d.git | GIT_DAV1D_UPSTREAM=git@xx:yy/dav1d.git |
143157

144158
## Platform Configuration
145159

146160
1、如果不同的平台需要编译不同的库,只需要在 apple/compile-cfgs 目录下,建立 list_PLAT.txt 文件即可,PLAT 为对应的平台,比如 ios,macos 等;默认情况下按照 list.txt 里声明的顺序编译各个库。
147161

148-
2、ffmpeg 的配置需要分平台指定,只需要在 ffconfig 目录下创建 module_PLAT.sh 文件即可,PLAT 为对应的平台,比如 ios,macos 等;默认情况下根据 module.sh 声明的配置进行编译 ffmpeg。
162+
2、ffmpeg 的配置需要分平台指定,只需要在 ffconfig 目录下创建 module_PLAT.sh 文件即可,PLAT 为对应的平台,比如 ios,macos 等;默认情况下根据 module.sh 声明的配置进行编译 ffmpeg。

download-pre.sh

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#! /usr/bin/env bash
2+
#
3+
# Copyright (C) 2022 Matt Reach<qianlongxu@gmail.com>
4+
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
PLAT=$1
19+
VER=$2
20+
21+
if test -z $VER ;then
22+
VER='V1.0-104be8c'
23+
fi
24+
25+
set -e
26+
27+
cd $(dirname "$0")
28+
c_dir="$PWD"
29+
30+
function usage() {
31+
echo " useage:"
32+
echo " $0 [ios,macos,all]"
33+
}
34+
35+
function download() {
36+
local plat=$1
37+
echo "===[download $plat $VER]===================="
38+
mkdir -p build/pre
39+
cd build/pre
40+
echo "https://github.com/debugly/MRFFToolChainBuildShell/releases/download/$VER/$plat-universal-$VER.zip"
41+
curl -LO https://github.com/debugly/MRFFToolChainBuildShell/releases/download/$VER/$plat-universal-$VER.zip
42+
mkdir -p ../product/$plat/universal
43+
unzip -oq $plat-universal-$VER.zip -d ../product/$plat/universal
44+
tree -L 2 ../product/$plat/universal
45+
echo "===================================="
46+
cd - >/dev/null
47+
}
48+
49+
if [[ "$PLAT" == 'ios' || "$PLAT" == 'macos' ]]; then
50+
download $PLAT
51+
elif [[ "$PLAT" == 'all' ]]; then
52+
plats="ios macos"
53+
for plat in $plats; do
54+
download $plat
55+
done
56+
else
57+
usage
58+
fi

ffconfig/module-full.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,14 @@ export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-decoder=vp7"
305305
export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-decoder=fic"
306306
# export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-decoder=ilbc"
307307

308+
# picture
309+
export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-decoder=bmp"
310+
export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-decoder=tiff"
311+
export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-decoder=psd"
312+
export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-decoder=webp"
313+
export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-decoder=targa"
314+
export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-decoder=pcx"
315+
308316
# subtitle
309317
export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-decoder=ass"
310318
export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-decoder=srt"

ffconfig/module-program.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#! /usr/bin/env bash
2+
3+
# module 文件是通过 source 的方式加载的,因此 $0 指的是调用方:./do-compile/ffmpeg.sh
4+
# BASH_SOURCE 是个栈,里面存了调用时文件列表
5+
# source 执行好处是在当前进程里执行的,因此所有上下文共用,声明的环境变量等在执行完文件后,仍旧有效
6+
# "副作用": 覆盖同名变量,$0 不是当前文件路径,修改了自己的工作目录就等于修改调用者的目录等。
7+
8+
enter_path=$PWD
9+
dir=$(dirname ${BASH_SOURCE[0]}) && pwd
10+
source $dir/module-full.sh
11+
cd ${enter_path}
12+
13+
# enable programs
14+
export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-avdevice"
15+
export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-avfilter"
16+
export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-sdl2"
17+
export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-ffmpeg"
18+
export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-ffplay"
19+
export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-ffprobe"

0 commit comments

Comments
 (0)