为 iOS 5 编译 x264

发布于 2025-01-06 19:42:29 字数 166 浏览 0 评论 0原文

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

2010 年中期,Gabriel 构建脚本开始工作。

现在不再这样了。

它显示“未找到可用的 C 编译器”。

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

I'm trying to compile the latest version of libx264 to iOS 5 arm.

In mid-2010, the Gabriel script for building worked.

It doesn't anymore.

It says "No working C compiler found."

Can anyone give me straight answer?
It's 2012 and no one in google seems to have compiled it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

看轻我的陪伴 2025-01-13 19:42:29

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

我拿了 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/开发人员/平台/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

Update:
I've added the needed files to the github repository below.
https://github.com/rodisbored/ffmpeg_x264_iOS5_build

I took gabriel's script and modified it. I've been meaning to post the complete script online, but here's the part(s) you need. Pop it into Gabriel's script. This works with XCode 4.2. I haven't updated to 4.3 to test whether the path names are still valid, but I think you can figure out where to update from the below.

For 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

For 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

To link these to ffmpeg, make sure you put the path of the library and and headers into the --extra-cflags and --extra-ldflags. If you don't, it'll complain about not finding the libx264 library. The below is what you need to turn this all on.

--enable-libx264 \
--enable-encoder=libx264 \
--enable-encoder=libx264rgb \
--enable-gpl
天生の放荡 2025-01-13 19:42:29

您只需尝试以下几行:

# 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.

Simply you can try these lines:

# 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.
憧憬巴黎街头的黎明 2025-01-13 19:42:29

我更新了 Gabriel/rodisbored build_x264 脚本,以便它可以与 Xcode 4.6 和 iOS SDK 6.1 配合使用。我的版本还构建了库,以便它可以在模拟器中运行。请参阅https://github.com/kristopherjohnson/kxmovie/blob/master/build_x264

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

I've updated the Gabriel/rodisbored build_x264 script so that it works with Xcode 4.6 and iOS SDK 6.1. My version also builds the library such that it can run in the simulator. See https://github.com/kristopherjohnson/kxmovie/blob/master/build_x264

Unfortunately, I gave up on trying to fix the accompanying build_ffmpeg_x264.sh script, and instead updated the Rakefile from https://github.com/kolyvan/kxmovie. So, to see my scripts for building x264 and FFmpeg, look at https://github.com/kristopherjohnson/kxmovie

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文