Audio & video developmentHistorical technical note

Building FFmpeg-iOS on a Mac

Records preparing gas-preprocessor and yasm on a Mac, then running the FFmpeg-iOS build script. It explains script locations, dependency installation, and output directories to prepare libraries for the later decoding examples.

Author:

Originally credited to Bison. Content is retained as published.

English translation of the Chinese original, translated on . The article body uses automated translation; app descriptions, historical reading notes and video subtitles receive separate editorial checks. Original publication dates, attribution, code and version notes are retained.

This historical illustration is currently unavailable. The original image URL is retained for reference.

I will not explain FFmpeg's uses in detail here. Interested readers can look them up.

Now for the main instructions:

  1. Download gas-preprocessor

  2. From gas-preprocessor, copy gas-preprocessor.pl into /usr/local/bin/.

  3. Enable permissions.

chmod 777 /usr/local/bin/gas-preprocessor.pl

4. Install yasm.

brew install yasm

After installation, the result looks like this:

==> Downloading https://homebrew.bintray.com/bottles/yasm-1.3.0.el_capitan.bottl
######################################################################## 100.0%
==> Pouring yasm-1.3.0.el_capitan.bottle.1.tar.gz
🍺  /usr/local/Cellar/yasm/1.3.0: 44 files, 3.1M

5. Download the Mac FFmpeg build script

6. In Terminal, use cd followed by the folder path to enter the downloaded folder, then run the build script.

./build-ffmpeg.sh

You can now take a drink and wait for compilation. If FFmpeg is not installed, this command installs it automatically, which may take a while. When all compilation completes, it produces the FFmpeg-iOS file.


Recommended reading: A beginner developer's review of 2015