1. Introduction of FFmpeg

Github address of FFmpeg

FFmpeg official website

FFmpeg is a collection of libraries and tools for processing multimedia content such as audio, video, subtitles, and associated metadata;

Provides: recording/conversion/audio and video streaming processing solutions;

FFmpeg -> (Fast Forward MPEG),MPEG is an audio and video coding standard.

2. Compile FFmpeg

If you don’t want to compile it yourself, you can simply download the compiled FFmpeg static library

stp1: FFmpeg script download

The script has been written to download FFmpeg source script code, you can not download their own source code, very convenient.

Download stp2:gas-preprocessor

This file is required for compiling FFmpeg. Run the following command to copy it to bin

cp -f /xxx/gas-preprocessor.pl /usr/local/bin/
Copy the code
Stp3: installationyasm

The terminal is installed using the following command

brew install yasm
Copy the code
Stp4: Start compiling

Open terminal CD and go to script folder:

Execute the following command to compile:

./build-ffmpeg.sh
Copy the code

After compiling successfully, you can get the file as shown below:

3. Import the FFmpeg static library to the project

Import compiled FFMPEG-ios into the project; Several dependency libraries need to be added as well:

Libiconv. 2.4.0. TBD libbz2.1.0. TBD libz. 1.2.5. TBDCopy the code

Set the location of the header file and library in Build Setting

IOS manual compilation and construction of FFmpeg iOS – FFmpeg compilation + H264 decoding + YUV rendering iOS development – ultra detailed integration of FFmpeg steps