简体   繁体   English

在为iOS5编译FFMPEG时遇到大问题

[英]Big problems while compiling FFMPEG for iOS5

I'm trying to compile the ffmpeg library for iOS5. 我正在尝试为iOS5编译ffmpeg库。 I tried different options but none works. 我尝试了其他选项,但是没有用。

I downloaded this: https://github.com/ciphor/ffmpeg4ios . 我下载了这个: https : //github.com/ciphor/ffmpeg4ios

I tried the original build_armv7 but it didn't work. 我尝试了原始的build_armv7,但没有成功。 I edited the build_arm7 file and now it looks like this: 我编辑了build_arm7文件,现在看起来像这样:

#!/bin/tcsh -f

if (! -d armv7) mkdir armv7
if (! -d lib) mkdir lib

rm armv7/*.a

make clean

./configure --disable-network --disable-mpegaudio-hp --disable-lpc --disable-vaapi 
--disable-vdpau --disable-hwaccels --disable-mmx --disable-mmx2 --disable-sse 
--disable-ssse3 --disable-avx --disable-amd3dnow --disable-amd3dnowext --disable-vis 
--disable-mmi --disable-doc --disable-yasm --disable-ffmpeg --disable-ffplay 
--disable-ffprobe --disable-ffserver --disable-rdft --disable-dxva2 --disable-encoders 
--disable-decoders --enable-decoder=h264 --disable-bsfs --disable-protocols 
--disable-indevs --disable-outdevs --disable-devices --disable-filters --disable-demuxers --enable-demuxer=h264 
--disable-muxers --disable-parsers --enable-parser=h264 --enable-cross-compile --arch=arm 
--target-os=darwin 
--cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 --as='gas-preprocessor/gas-preprocessor.pl /Aplications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2' 
--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk --cpu=cortex-a8 
--extra-cflags='-pipe -Os -gdwarf-2 -issysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk -m${thumb_opt:-no-thumb} 
-mthumb-interwork' --extra-ldflags='-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk' --enable-pic


make

mv libavcodec/libavcodec.a armv7/
mv libavdevice/libavdevice.a armv7/
mv libavformat/libavformat.a armv7/
mv libavutil/libavutil.a armv7/
mv libswscale/libswscale.a armv7/

rm lib/*.a

cp armv7/*.a lib/

But i get this error: 但是我得到这个错误:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 is unable to create an executable file. /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2无法创建可执行文件。 C compiler test failed. C编译器测试失败。

I looked all over the Internet. 我看了遍整个互联网。 I have read all the posts on stackoverflow about this but none helped me. 我已经阅读了关于stackoverflow的所有帖子,但是没有一个帮助我。 Please tell me what i'm doing wrong and please don't post me links: trust me, i saw them all! 请告诉我我做错了什么,请不要发布链接:相信我,我看到了所有这些!

That worked for me with iOS 5.0 and Snow Leopard. 这适用于iOS 5.0和Snow Leopard。 You have to change ldflags, sysroot and cc to provide valid paths to files in Mountain Lion for Xcode was moved to antoher folder. 您必须更改ldflags,sysroot和cc,以提供将Mountain Lion for Xcode中的文件的有效路径移至另一个文件夹的功能。

./configure \
--extra-ldflags=-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/lib/system \
    --disable-muxers \
    --disable-demuxers \
    --disable-devices \
    --disable-parsers \
    --disable-protocols \
    --disable-filters \
    --disable-bsfs \
    --disable-doc \
    --disable-ffmpeg \
    --disable-ffplay \
    --disable-avfilter \
    --disable-avformat \
    --disable-ffserver \
    --disable-decoders \
    --disable-encoders \
    --disable-network \
    --enable-decoder=h261 \
    --enable-decoder=h263 \
    --enable-decoder=h263p \
    --enable-encoder=h261 \
    --enable-encoder=h263 \
    --enable-encoder=h263p \
    --enable-cross-compile \
    --enable-hardcoded-tables \
    --enable-memalign-hack \
    --enable-neon \
    --arch=arm \
    --target-os=darwin \
    --cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc \
    --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk \
    --cpu=cortex-a8 \
    --extra-cflags='-arch armv7 -mno-thumb -mfpu=neon -mfloat-abi=softfp' \
    --extra-ldflags='-arch armv7 -mno-thumb -mfpu=neon -mfloat-abi=softfp' 2>&1 | tee configure.log

    make clean 
    make

Inspect config.log file in your root compilation directory and search for "C compiler test failed.`' You will find right there the command that was tried and the exact reason why it failed (ie, the compiler output). 检查您的根编译目录中的config.log文件,并搜索“ C编译器测试失败。”,您将在此处找到尝试过的命令及其失败的确切原因(即,编译器输出)。

It could be that the compiler installation directory is not /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/, or that some library cannot be found, etc... 可能是编译器安装目录不是/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/,或者找不到某些库,等等。

Actually, what I see is that you are specifying on the configure command line a few paths. 实际上,我看到的是您在configure命令行上指定了一些路径。 Have you checked that they are correct for your Xcode version? 您是否检查过它们对于您的Xcode版本是正确的?

If you require ffmpeg 11 You may need to use snow leopard or lion, Mountain lion seems to be missing critical gcc compiler components. 如果您需要ffmpeg 11,则可能需要使用雪豹或狮子,美洲狮似乎缺少重要的gcc编译器组件。 We are looking into fixing our build scripts for this 我们正在考虑为此修复我们的构建脚本

If version isn't all that important to you, we have a pre-built framework for ffmpeg 8, really we don't find any great difference between using the two and find that ffmpeg 8 has less performance issues. 如果版本对您而言并不那么重要,那么我们为ffmpeg 8提供了一个预先构建的框架,实际上,我们发现两者之间并没有太大的区别,并且发现ffmpeg 8的性能问题较少。

https://github.com/mooncatventures-group/ffmpegDecoder https://github.com/mooncatventures-group/ffmpegDecoder

If you have a build box with lion or snow leopard you can probably modify our build script and build ffmpeg 11 , others have done this. 如果您有一个带有狮子或雪豹的构建箱,则可能可以修改我们的构建脚本并构建ffmpeg 11,其他人已经做到了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM