XCODE5 next ffmpeg Static library configuration

Source: Internet
Author: User

1 , to install the Xcode command-line tool

1). XCODE5 Installation Command line tool method:

Run command at Terminal Using Xcode-select--install

2). XCODE5 before installing the command line tool method:

2 , XCODE5 was once compiled by gcc and clang compiled after xcode5 . reflected in the script

3 ,Xcode5 has also downloaded the gas-preprocessor.pl script package and then copied it to usr/bin using the CP command .

there is no need to download this gas-preprocessor.pl script after XCODE5

4 , Download the ffmpeg source code, and place the source code into the/usr/bin/build/src/file

Run cd/usr/bin/build/src/ffmpeg-2.2.3 into the FFmpeg directory at the terminal


5 , arm7 script (Generate ARM7. a file)

1) sudo./configure--disable-ffmpeg--disable-ffplay--disable-ffprobe--disable-ffserver-- Enable-cross-compile--sysroot= "/applications/xcode.app/contents/developer/platforms/iphoneos.platform/ Developer/sdks/iphoneos7.1.sdk "--target-os=darwin--cc="/applications/xcode.app/contents/developer/ Toolchains/xcodedefault.xctoolchain/usr/bin/clang"--extra-cflags="-arch armv7 "--extra-ldflags="-arch armv7 " --extra-ldflags=-l/applications/xcode.app/contents/developer/platforms/iphoneos.platform/developer/sdks/ Iphoneos7.1.sdk/usr/lib/system--arch=arm--cpu=cortex-a8--enable-pic--disable-asm--disable-everything-- enable-decoder=h264--enable-decoder=rv40--ENABLE-DECODER=AAC

2) Make clean

3) Make

4) Make install assumes that the run failed. Run sudo make install

5) make clean

6) run the resulting . A file cut into the desktop ffmpeg directory under arm7 subdirectory


6 , arm7s script (Generate arm7s. a file)

1) sudo./configure--disable-ffmpeg--disable-ffplay--disable-ffprobe--disable-ffserver-- Enable-cross-compile--sysroot= "/applications/xcode.app/contents/developer/platforms/iphoneos.platform/ Developer/sdks/iphoneos7.1.sdk "--target-os=darwin--cc="/applications/xcode.app/contents/developer/ Toolchains/xcodedefault.xctoolchain/usr/bin/clang"--extra-cflags="-arch Armv7s-mfpu=neon- miphoneos-version-min=7.1 "--extra-ldflags="-arch armv7s-isysroot/applications/xcode.app/contents/developer/ platforms/iphoneos.platform/developer/sdks/iphoneos7.1.sdk-miphoneos-version-min=7.1 "--arch=arm--cpu=cortex-a9 --enable-pic--disable-asm--disable-everything--enable-decoder=h264--enable-decoder=rv40--ENABLE-DECODER=AAC

2) Make clean

3) Make

4) Make install assumes that the run failed. Run sudo make install

5) make clean

6) run the resulting . A file cut into the desktop ffmpeg directory under arm7s subdirectory


7 , i386 compilation: (Generate i386 . a file)

1) sudo./configure--disable-ffmpeg--disable-ffplay--disable-ffprobe--disable-ffserver--enable-avresample-- Enable-cross-compile--sysroot= "/applications/xcode.app/contents/developer/platforms/iphonesimulator.platform/ Developer/sdks/iphonesimulator7.1.sdk "--target-os=darwin--cc="/applications/xcode.app/contents/developer/ Toolchains/xcodedefault.xctoolchain/usr/bin/clang"--extra-cflags="-arch I386-mfpu=neon- miphoneos-version-min=7.0 "--extra-ldflags="-arch i386-isysroot/applications/xcode.app/contents/developer/ platforms/iphonesimulator.platform/developer/sdks/iphonesimulator7.1.sdk-miphoneos-version-min=7.0 "--arch=i386 --cpu=i386--enable-decoder=h264--enable-decoder=rv40

2) Make clean

3) Make

4) Make install assumes that the run failed, run sudo make install

5) make clean

6) run the resulting . A file cut into the desktop ffmpeg directory under the SIM sub-directory

Note: Do not configure this --enable-pic--disable-asm

--enable-pic//build position-independent Code

--disable-asm//disable all Assembler optimizations

The yellow font in the script shows the path to the compiler. This is not the same as Xcode5 once.



8 , The same name file under the i386,arm7,arm7s directory is merged into the next file in the iOS file

1), three libswscale.a files synthesize a file libswscale.a

lipo-create/users/chang/desktop/ffmpeg/sim/libswscale.a/users/chang/desktop/ffmpeg/arm7/libswscale.a/users/ Chang/desktop/ffmpeg/arm7s/libswscale.a-output/users/chang/desktop/ffmpeg/ios/libswscale.a

2), three libswresample.a files synthesize a file libswresample.a

LIPO-CREATE/USERS/CHANG/DESKTOP/FFMPEG/SIM/LIBSWRESAMPLE.A/USERS/CHANG/DESKTOP/FFMPEG/ARM7/LIBSWRESAMPLE.A/ Users/chang/desktop/ffmpeg/arm7s/libswresample.a-output/users/chang/desktop/ffmpeg/ios/libswresample.a

3), three libavutil.a files synthesize a file LIBAVUTIL.A

Lipo-create/users/chang/desktop/ffmpeg/sim/libavutil.a/users/chang/desktop/ffmpeg/arm7/libavutil.a/users/chang /desktop/ffmpeg/arm7s/libavutil.a-output/users/chang/desktop/ffmpeg/ios/libavutil.a

4), three libavformat.a files synthesize a file libavformat.a

lipo-create/users/chang/desktop/ffmpeg/sim/libavformat.a/users/chang/desktop/ffmpeg/arm7/libavformat.a/users/ Chang/desktop/ffmpeg/arm7s/libavformat.a-output/users/chang/desktop/ffmpeg/ios/libavformat.a

5), three libavfilter.a files synthesize a file libavfilter.a

lipo-create/users/chang/desktop/ffmpeg/sim/libavfilter.a/users/chang/desktop/ffmpeg/arm7/libavfilter.a/users/ Chang/desktop/ffmpeg/arm7s/libavfilter.a-output/users/chang/desktop/ffmpeg/ios/libavfilter.a

6), three libavdevice.a files synthesize a file libavdevice.a

lipo-create/users/chang/desktop/ffmpeg/sim/libavdevice.a/users/chang/desktop/ffmpeg/arm7/libavdevice.a/users/ Chang/desktop/ffmpeg/arm7s/libavdevice.a-output/users/chang/desktop/ffmpeg/ios/libavdevice.a

7), three libavcodec.a files synthesize a file libavcodec.a

lipo-create/users/chang/desktop/ffmpeg/sim/libavcodec.a/users/chang/desktop/ffmpeg/arm7/libavcodec.a/users/ Chang/desktop/ffmpeg/arm7s/libavcodec.a-output/users/chang/desktop/ffmpeg/ios/libavcodec.a


Note: There are 8 . A files under thei386,arm7 directory, but there are only 7arm7s in the directory, and the principle is unknown.

Test. I built a directory on the desktop ffmpeg, there are three subdirectories sim (that i386 the resulting compilation. a file. Emulator debugging), ARM7 (that ARM7 compiled the generated file environment), arm7s (that arm7s compiled the generated file environment). After the above command operation, the contents of the latter in iOS will be synthesized. A file, which makes it possible to use the real machine and simulator normally.

XCODE5 next ffmpeg Static library configuration

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.