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 line Preferences -> Downloads -> Components Tools 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 execution brew 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:

// 下载 FFmpeg 源码:$ git clone ffmpeg// 编译:$ 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/lib try.

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

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.