Compiling the FFmpeg on Mac OS

Source: Internet
Author: User
Tags git clone

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 linePreferences -> Downloads -> ComponentsTools 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 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 http://source.ffmpeg.org/git/ffmpeg.git 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:

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

Related Article
Large-Scale Price Reduction
  • 59% Max. and 23% Avg.
  • Price Reduction for Core Products
  • Price Reduction in Multiple Regions
undefined. /
Connect with us on Discord
  • Secure, anonymous group chat without disturbance
  • Stay updated on campaigns, new products, and more
  • Support for all your questions
undefined. /
Free Tier
  • Start free from ECS to Big Data
  • Get Started in 3 Simple Steps
  • Try ECS t5 1C1G
undefined. /

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.

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.