1

我正在尝试将最新版本的 libx264 编译到 iOS 5 arm。

2010 年年中,用于构建的 Gabriel 脚本奏效了。

现在没有了。

它说“没有找到工作的 C 编译器”。

谁能给我直接的答案?现在是 2012 年,谷歌似乎没有人编译过它。

4

3 回答 3

5

更新: 我已将所需文件添加到下面的 github 存储库中。 https://github.com/rodisbored/ffmpeg_x264_iOS5_build

我拿了 gabriel 的脚本并修改了它。我一直想在网上发布完整的脚本,但这是您需要的部分。将其放入 Gabriel 的脚本中。这适用于 XCode 4.2。我还没有更新到 4.3 来测试路径名是否仍然有效,但我想你可以从下面找出更新的地方。

对于 armv6

CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc ./configure --host=arm-apple-darwin --sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5 .0.sdk --prefix='dist' --extra-cflags='-arch armv6' --extra-ldflags='-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/ usr/lib/system -arch armv6' --enable-pic --disable-asm --enable-static

对于 armv7

CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc ./configure --host=arm-apple-darwin --sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5 .0.sdk --prefix='dist' --extra-cflags='-arch armv7' --extra-ldflags='-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/ usr/lib/system -arch armv7' --enable-pic --enable-static

要将这些链接到 ffmpeg,请确保将库的路径和标头放入 --extra-cflags 和 --extra-ldflags。如果你不这样做,它会抱怨找不到 libx264 库。以下是您需要打开这一切的内容。

--enable-libx264 \
--enable-encoder=libx264 \
--enable-encoder=libx264rgb \
--enable-gpl
于 2012-02-28T00:51:27.450 回答
1

只需您可以尝试以下几行:

# you are now outside x264 dir.

export SDKVERSION="6.1"

cd x264

make clean

CC=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc \
    ./configure \
        --host=arm-apple-darwin \
        --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${SDKVERSION}.sdk \
        --prefix=build/armv7s \
        --extra-cflags='-arch armv7s' \
        --extra-ldflags="-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${SDKVERSION}.sdk/usr/lib/system -arch armv7s" \
        --enable-pic --enable-static

# ok now, you get the right Makefile.
于 2013-08-08T03:35:20.143 回答
0

我已经更新了 Gabriel/rodisboredbuild_x264脚本,以便它可以与 Xcode 4.6 和 iOS SDK 6.1 一起使用。我的版本还构建了库,以便它可以在模拟器中运行。见https://github.com/kristopherjohnson/kxmovie/blob/master/build_x264

不幸的是,我放弃了尝试修复随附的build_ffmpeg_x264.sh脚本,而是Rakefilehttps://github.com/kolyvan/kxmovie更新了。所以,要查看我构建 x264 和 FFmpeg 的脚本,请查看https://github.com/kristopherjohnson/kxmovie

于 2013-02-11T20:33:06.997 回答