Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
HatsuneMikuFansYSQ
TPBTools
提交
f4dff714
T
TPBTools
项目概览
HatsuneMikuFansYSQ
/
TPBTools
通知
2
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TPBTools
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
f4dff714
编写于
12月 28, 2021
作者:
杨
杨时权
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
【需求】提交ffmpeg构建脚本
上级
3e3f408e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
222 addition
and
0 deletion
+222
-0
ffmpeg/ios/build.sh
ffmpeg/ios/build.sh
+222
-0
未找到文件。
ffmpeg/ios/build.sh
0 → 100755
浏览文件 @
f4dff714
#!/bin/sh
# directories
FF_VERSION
=
"4.3.1"
#FF_VERSION="snapshot-git"
if
[[
$FFMPEG_VERSION
!=
""
]]
;
then
FF_VERSION
=
$FFMPEG_VERSION
fi
SOURCE
=
"ffmpeg-
$FF_VERSION
"
FAT
=
"FFmpeg-iOS"
SCRATCH
=
"scratch"
# must be an absolute path
THIN
=
`
pwd
`
/
"thin"
# absolute path to x264 library
#X264=`pwd`/fat-x264
#FDK_AAC=`pwd`/../fdk-aac-build-script-for-iOS/fdk-aac-ios
CONFIGURE_FLAGS
=
"--enable-cross-compile
\
--disable-shared
\
--enable-static
\
--disable-ffmpeg
\
--disable-ffplay
\
--disable-ffprobe
\
--disable-avdevice
\
--disable-devices
\
--disable-indevs
\
--disable-outdevs
\
--disable-doc
\
--disable-debug
\
--disable-programs
\
--enable-pic
\
--disable-encoders
\
--disable-decoders
\
--enable-decoder=aac
\
--enable-decoder=hevc
\
--enable-decoder=h264
\
--enable-decoder=mp3
\
--enable-decoder=pcm_s16le
\
--disable-encoders
\
--enable-encoder=pcm_s16le
\
--enable-encoder=aac
\
--disable-muxers
\
--disable-demuxers
\
--enable-demuxer=avi
\
--enable-demuxer=aac
\
--enable-demuxer=concat
\
--enable-demuxer=data
\
--enable-demuxer=flv
\
--enable-demuxer=hls
\
--enable-demuxer=rm
\
--enable-demuxer=live_flv
\
--enable-demuxer=mp4,mov
\
--enable-demuxer=mpeg,mpegps
\
--enable-demuxer=mpegts
\
--enable-demuxer=flac
\
--enable-demuxer=hevc
\
--enable-demuxer=mp3,wav
\
--enable-demuxer=apng,png,zlib
\
--enable-demuxer=image2
\
--enable-demuxer=mjpeg
\
--enable-demuxer=mpegvideo
\
--enable-demuxer=m4v
\
--enable-demuxer=webm_dash_manifest
\
--disable-filters
\
--disable-bsfs
\
--enable-bsf=h264_mp4toannexb
\
--disable-protocols
\
--enable-protocol=hls
\
--enable-protocol=http,https,httpproxy
\
--enable-protocol=rtmp,rtmps,rtmpt,rtmpts,rtp
\
--enable-protocol=file,data"
if
[
"
$X264
"
]
then
CONFIGURE_FLAGS
=
"
$CONFIGURE_FLAGS
--enable-gpl --enable-libx264"
fi
if
[
"
$FDK_AAC
"
]
then
CONFIGURE_FLAGS
=
"
$CONFIGURE_FLAGS
--enable-libfdk-aac --enable-nonfree"
fi
# avresample
#CONFIGURE_FLAGS="$CONFIGURE_FLAGS --enable-avresample"
ARCHS
=
"arm64 armv7 x86_64 i386"
COMPILE
=
"y"
LIPO
=
"y"
DEPLOYMENT_TARGET
=
"8.0"
if
[
"
$*
"
]
then
if
[
"
$*
"
=
"lipo"
]
then
# skip compile
COMPILE
=
else
ARCHS
=
"
$*
"
if
[
$#
-eq
1
]
then
# skip lipo
LIPO
=
fi
fi
fi
if
[
"
$COMPILE
"
]
then
if
[
!
`
which yasm
`
]
then
echo
'Yasm not found'
if
[
!
`
which brew
`
]
then
echo
'Homebrew not found. Trying to install...'
ruby
-e
"
$(
curl
-fsSL
https://raw.githubusercontent.com/Homebrew/install/master/install
)
"
\
||
exit
1
fi
echo
'Trying to install Yasm...'
brew
install
yasm
||
exit
1
fi
if
[
!
`
which gas-preprocessor.pl
`
]
then
echo
'gas-preprocessor.pl not found. Trying to install...'
(
curl
-L
https://github.com/libav/gas-preprocessor/raw/master/gas-preprocessor.pl
\
-o
/usr/local/bin/gas-preprocessor.pl
\
&&
chmod
+x /usr/local/bin/gas-preprocessor.pl
)
\
||
exit
1
fi
if
[
!
-r
$SOURCE
]
then
echo
'FFmpeg source not found. Trying to download...'
curl http://www.ffmpeg.org/releases/
$SOURCE
.tar.bz2 |
tar
xj
\
||
exit
1
fi
CWD
=
`
pwd
`
for
ARCH
in
$ARCHS
do
echo
"building
$ARCH
..."
mkdir
-p
"
$SCRATCH
/
$ARCH
"
cd
"
$SCRATCH
/
$ARCH
"
CFLAGS
=
"-arch
$ARCH
"
if
[
"
$ARCH
"
=
"i386"
-o
"
$ARCH
"
=
"x86_64"
]
then
PLATFORM
=
"iPhoneSimulator"
CFLAGS
=
"
$CFLAGS
-mios-simulator-version-min=
$DEPLOYMENT_TARGET
"
else
PLATFORM
=
"iPhoneOS"
CFLAGS
=
"
$CFLAGS
-mios-version-min=
$DEPLOYMENT_TARGET
-fembed-bitcode"
if
[
"
$ARCH
"
=
"arm64"
]
then
EXPORT
=
"GASPP_FIX_XCODE5=1"
fi
fi
XCRUN_SDK
=
`
echo
$PLATFORM
|
tr
'[:upper:]'
'[:lower:]'
`
CC
=
"xcrun -sdk
$XCRUN_SDK
clang"
# force "configure" to use "gas-preprocessor.pl" (FFmpeg 3.3)
if
[
"
$ARCH
"
=
"arm64"
]
then
AS
=
"gas-preprocessor.pl -arch aarch64 --
$CC
"
else
AS
=
"gas-preprocessor.pl --
$CC
"
fi
CXXFLAGS
=
"
$CFLAGS
"
LDFLAGS
=
"
$CFLAGS
"
if
[
"
$X264
"
]
then
CFLAGS
=
"
$CFLAGS
-I
$X264
/include"
LDFLAGS
=
"
$LDFLAGS
-L
$X264
/lib"
fi
if
[
"
$FDK_AAC
"
]
then
CFLAGS
=
"
$CFLAGS
-I
$FDK_AAC
/include"
LDFLAGS
=
"
$LDFLAGS
-L
$FDK_AAC
/lib"
fi
TMPDIR
=
${
TMPDIR
/%\/
}
$CWD
/
$SOURCE
/configure
\
--target-os
=
darwin
\
--arch
=
$ARCH
\
--cc
=
"
$CC
"
\
--as
=
"
$AS
"
\
$CONFIGURE_FLAGS
\
--extra-cflags
=
"
$CFLAGS
"
\
--extra-ldflags
=
"
$LDFLAGS
"
\
--prefix
=
"
$THIN
/
$ARCH
"
\
||
exit
1
make
-j3
install
$EXPORT
||
exit
1
cd
$CWD
done
fi
if
[
"
$LIPO
"
]
then
echo
"building fat binaries..."
mkdir
-p
$FAT
/lib
set
-
$ARCHS
CWD
=
`
pwd
`
cd
$THIN
/
$1
/lib
for
LIB
in
*
.a
do
cd
$CWD
echo
lipo
-create
`
find
$THIN
-name
$LIB
`
-output
$FAT
/lib/
$LIB
1>&2
lipo
-create
`
find
$THIN
-name
$LIB
`
-output
$FAT
/lib/
$LIB
||
exit
1
done
cd
$CWD
cp
-rf
$THIN
/
$1
/include
$FAT
fi
echo
Done
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录