Re: [問題] ffmpeg + iphone
※ 引述《tocute (小飄)》之銘言:
: 你好 小弟最近剛好也想在 mac 上編譯 ffmpeg
: 剛好看到你有相關的經驗
: 前來討教
: 我在網路上看到
: http://www.waterworld.com.hk/zh-hant/blog/how-compile-ffmpeg-iphone
: 他說要先安裝 http://github.com/yuvi/gas-preprocessor/
: 可是我在這一步就有問題了 當我 perl gas-preprocessor.pl
: 他就說 unrecognized input file type
: 請問你是透過什麼方式編譯 ffmpeg 呢
: 再請教 在mac 上編譯跟在iphone 上編譯 ffmpeg 有什樣的不同呢??
: 謝謝你的指導
: ※ 引述《sinread (電腦真耗錢)》之銘言:
: : 目前已知的是 "/usr/local/lib" 是ffmpeg build時候預設的目的目錄
: : 當程式開啟時候, 由於我的link library是設定require,
: : 所以會馬上去load libavcodec,
: : 但是奇怪的是, 明明我project內部就是使用libavcodec.a,
: : 但是我用otool -L 去看build出來的binary的時候,
: : 卻看到裡面的path 卻是 /usr/local/lib/libavcodec.dylib,
: : 請問我的project設定需要改什麼地方??
Build iDevice用的ffmpeg for armv7
我是把gas-preprocessor放在ffmpeg下面
寫個script如下
#!/bin/tcsh -f
if (! -d armv7) mkdir armv7
rm armv7/*.a
make clean
./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.2.sdk
--cpu=cortex-a8 --extra-cflags='-arch armv7' --extra-ldflags='-arch armv7'
--enable-pic --disable-encoders --disable-decoders --enable-decoder=h264
--disable-parsers --enable-parser=h264 --disable-protocols --disable-network
--enable-hardcoded-tables --disable-bsfs --disable-devices --disable-filters
--enable-fastdiv --disable-aandct --disable-rdft --disable-mdct --disable-fft
--disable-encoders --disable-amd3dnow --disable-amd3dnowext --disable-altivec
--disable-mmx --disable-mmx2 --disable-sse --disable-mmi --disable-neon
--disable-vis --disable-bsfs --disable-mpegaudio-hp
make
mv libavcodec/libavcodec.a armv7/
mv libavcore/libavcore.a armv7/
mv libavdevice/libavdevice.a armv7/
mv libavformat/libavformat.a armv7/
mv libavfilter/libavfilter.a armv7/
mv libavutil/libavutil.a armv7/
mv libswscale/libswscale.a armv7/
打完收工
上面script的重點在於
1. --as='gas-preprocessor/gas-preprocessor.pl
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' 記得
指定gas-preprocessor.pl 的位置
2. --cpu=cortex-a8 這個如果是armv6的話要換 (還有其他很明顯的要換)
3. --sysroot 的地方 要注意你的sdk在哪裡
最後xcode的project 要指定 header search 和 library search的地方
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 124.219.26.209
推
04/13 17:52, , 1F
04/13 17:52, 1F
→
04/13 17:52, , 2F
04/13 17:52, 2F
推
08/18 03:41, , 3F
08/18 03:41, 3F
討論串 (同標題文章)
完整討論串 (本文為第 3 之 3 篇):
MacDev 近期熱門文章
PTT數位生活區 即時熱門文章
52
80