FFmpeg compilation: mac compile iOS platform FFmpeg library (support armv7, arm64, i386, x86_64)

Environment:
FFmpeg 3.4.6
Xcode 10.3
macOS 10.14.6
iOS SDK 12.4

A. Preparations

1. Download FFmpeg
I used here is the 3.4.6 version of FFmpeg, FFmpeg can from the official website to download the latest ( http://www.ffmpeg.org ) or historical version ( http://www.ffmpeg.org/releases/ ) the FFmpeg.

2. Download the latest gas-preprocessor.pl
made here ( https://github.com/libav/gas-preprocessor latest gas-preprocessor.pl) download, the download is complete after gas-preprocessor.pl copy to / usr / under local / bin directory, and modify the permissions make it executable.

// Go to the directory 
cd / usr / local / bin
 // modify access 
chmod  777 gas-preprocessor.pl

3. Check whether mac Command Line Tools already installed
For details, see: https://www.cnblogs.com/yongdaimi/p/11723573.html

4. Download build scripts
from https://github.com/kewlbear/FFmpeg-iOS-build-script  download the iOS version of the compiler script here.

II. Ready to compile

1. FFmpeg3.4.6 downloaded archive copy to the same directory compiled scripts, and unpack the archive:

 

2. Modify the compiled version of the script FFmpeg
open build-ffmpeg.sh, modified version back FF_VERSION, so to download the FFmpeg version numbers consistent.

 

3. Return to the terminal, execute ./build-ffmpeg.sh, began to compile

 

The whole process lasts about 5 to 8 minutes, patiently waiting for the end of the compiler. After the compiler will generate FFmpeg-iOS folders in the current directory, which contains the header files and libraries we will use:

 

The compiled script has been automatically armv7, arm64, i386, x86_64 platform library integrated into the four together, we can use the lipo command to view the details of the static library:

 

 

other

1. The resources used above
link: https://pan.baidu.com/s/1oWt8GqxA34PfSIzYnL1Mjw extraction code: aphj 

 

Guess you like

Origin www.cnblogs.com/yongdaimi/p/11729942.html
Recommended