FFmpeg static library configuration in xcode5

Source: Internet
Author: User

Tag: IOS FFMPEG

1. Install the xcode command line tool

1). How to install the command line tool in xcode5:

Execute the command using xcode-select -- install on the terminal

2) install the command line tool before xcode5:

2. xcode5 was previously compiled by GCC and clang after xcode5, which is reflected in the script.

3, xcode5 before you need to download the gas-preprocessor.pl script package, and then use the CP command to copy to usr/bin,

No need to download this gas-preprocessor.pl script after xcode5

4. Download The FFMPEG source code and place it in the/usr/bin/build/src/file.

Run CD/usr/bin/build/src/ffmpeg-2.2.3 on the terminal to enter the FFMPEG folder


5. Input a script to generate the. A file under the same account)

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 if the execution fails, execute sudo make install

5) make clean

6) run the command to cut the. A file to the top folder in the FFMPEG folder.


6. arm7s script (generate the. A file in arm7s)

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 if the execution fails, execute sudo make install

5) make clean

6) run the command to cut the. A file to the arm7s subfolder in the ffmpeg folder on the desktop.


7. i386 Compilation: (generate the. A file under i386)

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 if the execution fails, execute sudo make install

5) make clean

6) run the command to cut the. A file to the sim subfolder under the FFMPEG folder on the desktop.

Note: you do not need to configure this -- enable-pic -- disable-ASM.

-- Enable-pic // build position-independent code

-- Disable-ASM // disable all scheduler Optimizations

The yellow font in the script shows the compiler path, which is different from that before xcode5.



8. Merge the same name files in the i386, arm7s, and arm7s folders to the next file in the IOS file.

1) combine the libswscale. A file with the libswscale. A file.

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) combine the libswresample. A file with the libswresample. A file.

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) combine the libavutil. A file with the libavutil. A file.

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) combine the libavformat. A file with the libavformat. A file.

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) combine the libavfilter. A file with the libavfilter. A file.

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) combine the libavdevice. A file with the libavdevice. A file.

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) combine the libavcodec. A file with the libavcodec. A file.

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: i386, there are 8. A files in the arm7s folder, but only 7 files in the arm7s folder. The principle is unknown.

During the test, I created a folder FFMPEG on the desktop. the following three sub-folders are SIM (obtained by i386 compilation. file a, used for simulator debugging), ARM7 (the files compiled in the arm7s environment), and arm7s (the files compiled in the arm7s environment ). After the above command operation, the. A file after synthesis will be obtained in the IOS folder, so that it can be used properly on the real machine and simulator.

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.