Skip to content

yellowei/FFmpeg-iOS-build-script

 
 

Repository files navigation

FFmpeg iOS build script

Build Status

This is a shell script to build FFmpeg libraries for iOS and tvOS apps.

Tested with:

  • FFmpeg 3.4
  • Xcode 9

Requirements

Usage

Use build-ffmpeg-tvos.sh for tvOS.

  • To build everything:

      ./build-ffmpeg.sh
    
  • To build arm64 libraries:

      ./build-ffmpeg.sh arm64
    
  • To build fat libraries for armv7 and x86_64 (64-bit simulator):

      ./build-ffmpeg.sh armv7 x86_64
    
  • To build fat libraries from separately built thin libraries:

      ./build-ffmpeg.sh lipo
    

Download

You can download a binary for FFmpeg 3.4 release at https://downloads.sourceforge.net/project/ffmpeg-ios/ffmpeg-ios-master.tar.bz2

External libraries

You should link your app with

  • libz.dylib
  • libbz2.dylib
  • libiconv.dylib

Influences

Build Samba Support

FFmpeg 编入Samba

1.首先kxsmb或者samba-iOS 编译4.0.26的ios库

2.编译好的smb库放入usr/local/Cellar下, smb库放入之前手动分为include和lib两个子文件夹

3.ln -s 刚才已经放入Cellar文件夹下的include和lib所有文件到usr/local/include和usr/local/lib下

4.没有pkg-config的同学, 先安装此神器, 按照图片目录创建  .pc配置文件, 

prefix=/usr/local/Cellar/smbclient
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: smbclient
Description: Samba library
Version: 4.0.26
Libs: -L${exec_prefix}/lib -lsmbclient -ltalloc -ltdb -ltevent -lwbclient -liconv -lz -lresolv -framework Foundation
Libs.private: -lpthread -lm -ldl
Cflags: -I${prefix}/include

5.pkg-config —cflags smbclient 搜索得到就正确了, 接下来就去ffmpeg里面的.sh的”CONFIGURE_FLAGS”内加入 --enable-gpl --enable-version3 --enable-libsmbclient"

6.开始跑脚本

Build x264 Support

方法同上, 但是3.4.2兼容的x264版本需要下载20171224以及之前的, 20171230不行, 大致如下这些都行

x264-snapshot-20171008-2245.tar.bz2
x264-snapshot-20171130-2245.tar.bz2
x264-snapshot-20171214-2245.tar.bz2
x264-snapshot-20171224-2245.tar.bz2

Build fdk-aac Support

方法同上 本例使用的是0

fdk-aac-0.1.6.zip

About

Shell scripts to build FFmpeg for iOS and tvOS

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 78.9%
  • Shell 21.1%