Compile the Simulator version
1 To Snapshot
2. Download The ffmpeg source code.
Http://ffmpeg.org/download.html
Https://github.com/FFmpeg/FFmpeg
3. decompress the source code and cd it to the source code directory.
4. Create the file config_i386.sh with the following content:
#!/bin/tcsh -fset targetDir="../ffmpeg-libs/i386"if (! -d $targetDir ) mkdir $targetDirrm -f $targetDir/*.amake clean#./configure --arch=i386 --extra-cflags='-arch i386' --extra-ldflags='-arch i386' --disable-encoders --disable-debug --disable-mmx./configure \--cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc \--as='gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc' \--nm="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/nm" \--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk \--target-os=darwin \--arch=i386 \--cpu=i386 \--extra-cflags='-arch i386 -miphoneos-version-min=4.3 -mdynamic-no-pic' \--extra-ldflags='-arch i386 -miphoneos-version-min=4.3 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk' \--prefix=compiled/i386 \--enable-cross-compile \--enable-nonfree \--enable-gpl \--disable-armv5te \--disable-swscale-alpha \--disable-doc \--disable-ffmpeg \--disable-ffplay \--disable-ffprobe \--disable-ffserver \--disable-asm \--disable-debugmakemv libavcodec/libavcodec.a $targetDirmv libavdevice/libavdevice.a $targetDirmv libavformat/libavformat.a $targetDirmv libavutil/libavutil.a $targetDirmv libswscale/libswscale.a $targetDir
5. Execute config_i386.sh for configuration and compilation.
After compilation, you can find the corresponding static library file in $ targetDir.
Compile the real machine version
The first three steps are the same as above.
Step 2: Create the file config_armv7. Its content is as follows:
#!/bin/tcsh -fset targetDir="../ffmpeg-libs/armv7"if (! -d $targetDir ) mkdir $targetDirrm -f $targetDir/*.amake clean./configure \--cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc \--as='gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' \--nm="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/nm" \--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk \--target-os=darwin \--arch=arm \--cpu=cortex-a8 \--extra-cflags='-arch armv7 -miphoneos-version-min=4.3 -mdynamic-no-pic' \--extra-ldflags='-arch armv7 -miphoneos-version-min=4.3 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk' \--prefix=compiled/armv7 \--enable-cross-compile \--enable-nonfree \--enable-gpl \--disable-armv5te \--disable-swscale-alpha \--disable-doc \--disable-ffmpeg \--disable-ffplay \--disable-ffprobe \--disable-ffserver \--disable-asm \--disable-debugmakemv libavcodec/libavcodec.a $targetDirmv libavformat/libavformat.a $targetDirmv libavutil/libavutil.a $targetDirmv libswscale/libswscale.a $targetDir
Step 2:
Execute config_armv7 for configuration and compilation. After compilation, you can find the corresponding static library file in $ targetDir.