This article is shared by Forum member sun_t89
If you do not know what is ffmepg, please go to the http://ffmpeg.org first to understand :)
Compile the ffmepg Simulator version:
1. Download ffmpeg-iphone-build from https://github.com/gabriel el/ffmpeg-iphone-build.
2. First copy the gas-preprocessor.pl to the/usr/sbin/directory.
3. Download The FFMPEG source code from the FFMPEG official website.
4. Locate the FFMPEG directory on the terminal and run it.
. /Configure -- disable-doc -- disable-FFMPEG -- disable-ffplay -- disable-ffserver -- disable-avfilter -- disable-Debug -- disable-encoders -- enable-Cross-compile -- disable-decoders -- disable-armv5te -- enable-decoder = h264 -- enable-pic -- cc =/developer/platforms/iphonesimulator. platform/developer/usr/bin/GCC -- As = 'Gas-Preprocessor/gas-preprocessor.pl/developer/platforms/iphonesimulator. platform/developer/usr/bin/GCC '-- extra-ldflags =-L/developer/platforms/iphonesimulator. platform/developer/sdks/iphonesimulator4.3.sdk/usr/lib/System -- sysroot =/developer/platforms/iphonesimulator. platform/developer/sdks/iphonesimulator4.3.sdk -- target-OS = Darwin -- arch = i386 -- CPU = i386 -- extra-cflags = '-arch i386' -- extra-ldflags = '-arch i386'
5. Enter the make command
6. Copy libavcodec. A, libavdevice. A, libavformat. A, libavutil. A, and libswscale. A to the corresponding directory.
7. You can use it in the project. You can refer to the open-source example iframeextractor (GIT clone git: // github.com/lajos/iframeextractor.git) to replace the FFMPEG folder library of the project with your compiled FFMPEG source code folder and create a lib directory under the FFMPEG directory, copy the static library you just copied. Open the project and add the libbz2.1.0.dylib system library file. Click compile to run.
8. Note that if ffmpeg0.8.5 is used, the codec_type in iframeextractor must be changed to avmedia_type_video. (Same below)
Compile the version and the version found on the Internet by following the steps below. You can compile the library of 7.7.
1. Download:
Git clone git: // github.com/lajos/iframeextractor.git
2. Edit:
Build_armv6 and build_armv7. Modify the parameters following./configure, mainly the SDK version. My version is 4.3 and changed:
. /Configure -- disable-doc -- disable-FFMPEG -- disable-ffplay -- disable-ffserver -- enable-Cross-compile -- arch = arm -- target-OS = Darwin -- cc =/developer/ platforms/iphoneos. platform/developer/usr/bin/GCC -- As = 'Gas-Preprocessor/gas-preprocessor.pl/developer/platforms/iphoneos. platform/developer/usr/bin/GCC '-- sysroot =/developer/platforms/iphoneos. platform/developer/sdks/iphoneos4.3.sdk -- CPU = arm1176jzf-s -- extra-cflags = '-arch armv6' -- extra-ldflags = '-arch armv6'
3. Compile:
Error, prompt:
/Developer/platforms/iphoneos. Platform/developer/usr/bin/GCC is unable to create an executable file.
C Compiler Test failed.
View the config. Err file. The last prompt is:
Ld: file not found:/usr/lib/system/libcache. dylib for architecture armv7
Collect2: LD returned 1 exit status
4. Modify the configure parameter again as follows:
. /Configure -- disable-doc -- disable-FFMPEG -- disable-ffplay -- disable-ffserver -- enable-Cross-compile -- arch = arm -- target-OS = Darwin -- cc =/developer/ platforms/iphoneos. platform/developer/usr/bin/GCC -- As = 'Gas-Preprocessor/gas-preprocessor.pl/developer/platforms/iphoneos. platform/developer/usr/bin/GCC '-- sysroot =/developer/platforms/iphoneos. platform/developer/sdks/iphoneos4.3.sdk -- CPU = cortex-a8 -- extra-cflags = '-arch armv7' -- extra-ldflags ='-arch armv7-isysroot/developer/platforms/iphoneos. platform/developer/sdks/iphoneos4.3.sdk '-- enable-pic
5. Compile:
Build_armv7
Finally, the static library is generated in the lib directory and armv7 directory.
6. Use xcode to open iframeextractor. xcodeproj. An error occurs during compilation. You need to modify the following:
Select the project on the left, target in the middle, build settings in the right, and set the parameters to optimized (armv7) on the ubuntures tab, and set the base SDK to latest IOS (IOS 4.3) Valid ubuntures to armv7.
Select iOS device as the compilation target. Of course, if you have devices connected to your computer, you can select devices.
Compile, prompt:
Undefined symbols for architecture armv7:
"_ Bz2_bzdecompressinit", referenced from:
_ Matroska_decode_buffer in libavformat. A (matroskadec. O)
"_ Bz2_bzdecompressend", referenced from:
_ Matroska_decode_buffer in libavformat. A (matroskadec. O)
"_ Bz2_bzdecompress", referenced from:
_ Matroska_decode_buffer in libavformat. A (matroskadec. O)
Add library libbz2.1.0.dylib, compile again, OK through
Current location: homepage> development channel> iPhone development> open-source SDK simulator and FFMPEG compilation method on a real machine (Summary) 2011-10-
0
Comment
Reading: 1329Separate windowPrintEnlarge font sizeShrink font size
This article is shared by the Forum member sun_t89 if you do not know what is ffmepg, please move to the http://ffmpeg.org first understand :) compile ffmepg Simulator version: 1. To prepare 2. First will be gas-prepr
This article is shared by Forum member sun_t89
If you do not know what is ffmepg, please go to the http://ffmpeg.org first to understand :)
Compile the ffmepg Simulator version:
1. Download ffmpeg-iphone-build from https://github.com/gabriel el/ffmpeg-iphone-build.
2. First copy the gas-preprocessor.pl to the/usr/sbin/directory.
3. Download The FFMPEG source code from the FFMPEG official website.
4. Locate the FFMPEG directory on the terminal and run it.
. /Configure -- disable-doc -- disable-FFMPEG -- disable-ffplay -- disable-ffserver -- disable-avfilter -- disable-Debug -- disable-encoders -- enable-Cross-compile -- disable-decoders -- disable-armv5te -- enable-decoder = h264 -- enable-pic -- cc =/developer/platforms/iphonesimulator. platform/developer/usr/bin/GCC -- As = 'Gas-Preprocessor/gas-preprocessor.pl/developer/platforms/iphonesimulator. platform/developer/usr/bin/GCC '-- extra-ldflags =-L/developer/platforms/iphonesimulator. platform/developer/sdks/iphonesimulator4.3.sdk/usr/lib/System -- sysroot =/developer/platforms/iphonesimulator. platform/developer/sdks/iphonesimulator4.3.sdk -- target-OS = Darwin -- arch = i386 -- CPU = i386 -- extra-cflags = '-arch i386' -- extra-ldflags = '-arch i386'
5. Enter the make command
6. Copy libavcodec. A, libavdevice. A, libavformat. A, libavutil. A, and libswscale. A to the corresponding directory.
7. You can use it in the project. You can refer to the open-source example iframeextractor (GIT clone git: // github.com/lajos/iframeextractor.git) to replace the FFMPEG folder library of the project with your compiled FFMPEG source code folder and create a lib directory under the FFMPEG directory, copy the static library you just copied. Open the project and add the libbz2.1.0.dylib system library file. Click compile to run.
8. Note that if ffmpeg0.8.5 is used, the codec_type in iframeextractor must be changed to avmedia_type_video. (Same below)
Compile the version and the version found on the Internet by following the steps below. You can compile the library of 7.7.
1. Download:
Git clone git: // github.com/lajos/iframeextractor.git
2. Edit:
Build_armv6 and build_armv7. Modify the parameters following./configure, mainly the SDK version. My version is 4.3 and changed:
. /Configure -- disable-doc -- disable-FFMPEG -- disable-ffplay -- disable-ffserver -- enable-Cross-compile -- arch = arm -- target-OS = Darwin -- cc =/developer/ platforms/iphoneos. platform/developer/usr/bin/GCC -- As = 'Gas-Preprocessor/gas-preprocessor.pl/developer/platforms/iphoneos. platform/developer/usr/bin/GCC '-- sysroot =/developer/platforms/iphoneos. platform/developer/sdks/iphoneos4.3.sdk -- CPU = arm1176jzf-s -- extra-cflags = '-arch armv6' -- extra-ldflags = '-arch armv6'
3. Compile:
Error, prompt:
/Developer/platforms/iphoneos. Platform/developer/usr/bin/GCC is unable to create an executable file.
C Compiler Test failed.
View the config. Err file. The last prompt is:
Ld: file not found:/usr/lib/system/libcache. dylib for architecture armv7
Collect2: LD returned 1 exit status
4. Modify the configure parameter again as follows:
. /Configure -- disable-doc -- disable-FFMPEG -- disable-ffplay -- disable-ffserver -- enable-Cross-compile -- arch = arm -- target-OS = Darwin -- cc =/developer/ platforms/iphoneos. platform/developer/usr/bin/GCC -- As = 'Gas-Preprocessor/gas-preprocessor.pl/developer/platforms/iphoneos. platform/developer/usr/bin/GCC '-- sysroot =/developer/platforms/iphoneos. platform/developer/sdks/iphoneos4.3.sdk -- CPU = cortex-a8 -- extra-cflags = '-arch armv7' -- extra-ldflags ='-arch armv7-isysroot/developer/platforms/iphoneos. platform/developer/sdks/iphoneos4.3.sdk '-- enable-pic
5. Compile:
Build_armv7
Finally, the static library is generated in the lib directory and armv7 directory.
6. Use xcode to open iframeextractor. xcodeproj. An error occurs during compilation. You need to modify the following:
Select the project on the left, target in the middle, build settings in the right, and set the parameters to optimized (armv7) on the ubuntures tab, and set the base SDK to latest IOS (IOS 4.3) Valid ubuntures to armv7.
Select iOS device as the compilation target. Of course, if you have devices connected to your computer, you can select devices.
Compile, prompt:
Undefined symbols for architecture armv7:
"_ Bz2_bzdecompressinit", referenced from:
_ Matroska_decode_buffer in libavformat. A (matroskadec. O)
"_ Bz2_bzdecompressend", referenced from:
_ Matroska_decode_buffer in libavformat. A (matroskadec. O)
"_ Bz2_bzdecompress", referenced from:
_ Matroska_decode_buffer in libavformat. A (matroskadec. O)
Add library libbz2.1.0.dylib, compile again, OK through
Original post address: http://www.cocoachina.com/bbs/read.php? Tid-79169.html