Compiling the FFmpeg on Mac OS

Source: Internet
Author: User
Tags git clone

This article turns from: Compiling FFmpeg on Mac OS |

Install Xcode and Command line Tools

Install Xcode from the App Store and make sure that Command linePreferences -> Downloads -> ComponentsTools is installed under Xcode.

Of course you can also download Xcode and Command line Tools from

Installing Brew

Homebrew is a very useful package management tool on your MAC, and the installation method allows the following commands:

-e "$(curl -fsSL"
Using Brew to install dependent libraries
install automake fdk-aac git libtool libvorbis libvpx opus sdl shtool yasm texi2html theora wget x264 xvid lame libass

When you install these libraries, you can try again if an error occurs, and sometimes the installation fails due to network reasons that caused the download to be incomplete. You can install a single library in this way:

Install x264 with brew.$ brew install x264

If the library is always installed unsuccessfully, then you can try to upgrade the update under Brew first:

brew update

The tragedy is, sometimes after the executionbrew update, brew may be error, most of the reason is the local brew warehouse (usually in the/usr/local/directory) conflict, it is necessary to perform the next git command to deal with the conflict and then update Brew, the command is as follows:

$ cd $(brew --prefix)$ git reset --hard HEAD$ brew update

If you still encounter other problems, Google to solve it first.

Compiling FFmpeg

Next, download the FFmpeg source code and compile it with the following command:

// Download FFmpeg source code:
$ git clone ffmpeg
// Compile:
$ cd ffmpeg
$ ./configure --prefix=/usr/local --enable-gpl --enable-nonfree --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus - -enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --extra-ldflags=-L/usr/local/lib
$ make && make install 

When your config is sometimes an error to find some libraries, you can add a--extra-ldflags=-L/usr/local/libtry.

Test it.

Compile the completion of the error, then you can try to take a video to play the test, in the FFmpeg directory, execute the following command to let FFmpeg playback a video:

If you want to compile FFmpeg for IOS projects, you can look at Ffmpegcompiletool.

Compiling the FFmpeg on Mac OS

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.