Compiling the FFmpeg on Mac OS

Source: Internet
Author: User

Tags: amp other next Automake solve class master lame eset

This article turns from: Compiling FFmpeg on Mac OS | Www.samirchen.com

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 https://developer.apple.com/.

Installing Brew

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

-e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
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 http://source.ffmpeg.org/git/ffmpeg.git 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:

http://devimages.apple.com.edgekey.net/streaming/examples/bipbop_16x9/gear5/prog_index.m3u8
Other

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

Compiling the FFmpeg on Mac OS

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: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

Tags Index: