• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            Khan's Notebook GCC/GNU/Linux Delphi/Window Java/Anywhere

            路漫漫,長修遠,我們不能沒有錢
            隨筆 - 173, 文章 - 0, 評論 - 257, 引用 - 0
            數(shù)據(jù)加載中……

            ffmpeg for ios 交叉編譯 (支持i686 armv7 armv7s) 包含lame支持



            由于項目還需要mp3 音頻編碼,  所以先需要下載lame源碼搭建交叉環(huán)境, 在lame目錄下錄入如下編譯腳本  
            build.sh
             1 #! /bin/sh
             2 
             3 
             4 SDK_VERSION="6.0"
             5 
             6 rm -rf build
             7 mkdir build
             8 
             9 function build_lame()
            10 {
            11     make distclean
            12 
            13     ./configure \
            14         CFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/${SDK}.platform/Developer/SDKs/${SDK}${SDK_VERSION}.sdk" \
            15         CC="/Applications/Xcode.app/Contents/Developer/Platforms/${SDK}.platform/Developer/usr/bin/gcc -arch ${PLATFORM}" \
            16         --prefix=/Users/khan/Downloads/lame-3.99.5 \
            17         --host="arm-apple-darwin9" \
            18         --disable-shared \
            19         --enable-static \
            20         --disable-decoder \
            21         --disable-frontend
            22 
            23     make
            24     cp "libmp3lame/.libs/libmp3lame.a" "build/libmp3lame-${PLATFORM}.a"
            25 }
            26 
            27 PLATFORM="i686"
            28 SDK="iPhoneSimulator"
            29 build_lame
            30 
            31 #armv6和armv7 比較難共存
            32 #PLATFORM="armv6"
            33 #SDK="iPhoneOS"
            34 #build_lame
            35 
            36 PLATFORM="armv7"
            37 SDK="iPhoneOS"
            38 build_lame
            39 
            40 PLATFORM="armv7s"
            41 SDK="iPhoneOS"
            42 build_lame
            43 
            44 lipo -create build/* -output build/libmp3lame.a


            首先去https://github.com/yuvi/gas-preprocessor/
            下載gas-preprocessor.pl, 然后 復制到 /usr/sbin/目錄下(當然, 你可以放在任何目錄下, 只要保證--as='/${path}/gas-preprocessor.pl'路徑正確)

            http://ffmpeg.org/download.html 下載ffmpeg源碼, git或者直接下載

            終端執(zhí)行以下指令
            #armv7s
            ./configure --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --enable-pic --enable-cross-compile --enable-decoder=h264 --enable-libmp3lame \
                        --arch=arm --disable-asm \
                        --target-os=darwin --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' \
                        --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk \
                        --cpu=cortex-a8 \
                        --extra-cflags='-arch armv7s -I/Users/khan/Downloads/lame-3.99.5/include ' \
                        --extra-ldflags='-arch armv7s -L/Users/khan/Downloads/lame-3.99.5/build -lmp3lame  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk' \
                        --prefix=/Users/khan/Downloads/ffmpeg/arm7s.lib
            make
            make install

            make clean
            #armv7
            ./configure --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --enable-pic --enable-cross-compile --enable-decoder=h264 --enable-libmp3lame \
                        --disable-asm  --arch=arm \
                        --target-os=darwin --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' \
                        --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk \
                        --cpu=cortex-a8 \
                        --extra-cflags='-arch armv7 -I/Users/khan/Downloads/lame-3.99.5/include ' \
                        --extra-ldflags='-arch armv7 -L/Users/khan/Downloads/lame-3.99.5/build -lmp3lame  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk' \
                        --prefix=/Users/khan/Downloads/ffmpeg/arm7.lib
            make
            make install

            make clean
            #i686
            ./configure --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --enable-pic --enable-cross-compile --enable-decoder=h264 --enable-libmp3lame \
                        --disable-asm --arch=i686 --cpu=i686 --disable-armv5te \
                        --target-os=darwin --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' \
                        --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk \
                        --extra-ldflags=-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk/usr/lib/system \
                        --extra-cflags='-arch i686 -I/Users/khan/Downloads/lame-3.99.5/include ' \
                        --extra-ldflags='-arch i686 -L/Users/khan/Downloads/lame-3.99.5/build -lmp3lame ' \
                        --prefix=/Users/khan/Downloads/ffmpeg/i686.lib

            make
            make install
            make clean

            --prefix=/Users/khan/Downloads/ffmpeg/i686.lib/里為編譯后的目標文件
            然后將各個目錄下的lib lipo一下 就可以同時在模擬器和各種該指令集的真機上運行了

            lipo -create i686.lib/lib/libavcodec.a arm7.lib/lib/libavcodec.a arm7s.lib/lib/libavcodec.a       -output build/libavcodec.a
            lipo -create i686.lib/lib/libavdevice.a arm7.lib/lib/libavdevice.a arm7s.lib/lib/libavdevice.a    -output build/libavdevice.a
            lipo -create i686.lib/lib/libavfilter.a arm7.lib/lib/libavfilter.a arm7s.lib/lib/libavfilter.a           -output build/libavfilter.a
            lipo -create i686.lib/lib/libavformat.a arm7.lib/lib/libavformat.a arm7s.lib/lib/libavformat.a  -output build/libavformat.a
            lipo -create i686.lib/lib/libavutil.a arm7.lib/lib/libavutil.a arm7s.lib/lib/libavutil.a                 -output build/libavutil.a
            lipo -create i686.lib/lib/libswresample.a arm7.lib/lib/libswresample.a arm7s.lib/lib/libswresample.a   -output build/libswresample.a
            lipo -create i686.lib/lib/libswscale.a arm7.lib/lib/libswscale.a arm7s.lib/lib/libswscale.a         -output build/libswscale.a





            posted on 2012-12-13 16:45 Khan 閱讀(5898) 評論(0)  編輯 收藏 引用 所屬分類: GCC/G++

            国产精品国色综合久久| 国内精品久久久久久麻豆| 亚洲欧美一级久久精品| 国产亚洲精久久久久久无码77777| 久久无码AV中文出轨人妻| 久久婷婷五月综合色奶水99啪| 亚洲精品无码久久久久久| 国产一区二区三区久久精品| 亚洲国产精品综合久久一线 | 久久99国产综合精品女同| 国产精品欧美久久久久无广告| 伊人色综合久久天天人守人婷| av午夜福利一片免费看久久| 久久夜色精品国产www| 久久久久99精品成人片欧美| 久久久精品人妻无码专区不卡| 久久精品国产久精国产一老狼| 免费观看久久精彩视频| 欧美熟妇另类久久久久久不卡| 久久综合九色综合欧美就去吻| 久久无码人妻一区二区三区 | 久久久久国产一级毛片高清版| 午夜精品久久久内射近拍高清| .精品久久久麻豆国产精品| 久久亚洲国产最新网站| 日韩精品国产自在久久现线拍 | 51久久夜色精品国产| 一本久道久久综合狠狠爱| 亚洲国产婷婷香蕉久久久久久 | 人妻无码αv中文字幕久久| 久久婷婷五月综合色99啪ak| 日韩一区二区久久久久久| 97久久精品国产精品青草| 久久久久久无码Av成人影院| 色综合久久久久久久久五月| 久久久亚洲欧洲日产国码是AV| 欧美精品丝袜久久久中文字幕 | 久久综合狠狠综合久久综合88| 欧美黑人激情性久久| 久久精品国产亚洲AV蜜臀色欲| 思思久久精品在热线热|