gpt4 book ai didi

ios - 用 librtmp 编译 ffmpeg

转载 作者:行者123 更新时间:2023-11-28 22:35:34 28 4
gpt4 key购买 nike

在为 OSX 编译 ffmpeg 时,我可以简单地使用:

./configure --enable-librtmp --enable-gpl

命令并获得可以使用 rtmp 流进行 I/O 的构建。

如果我尝试为 iOS 编译使用:

./configure \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--disable-mmx \
--enable-gpl \
--enable-shared \
--enable-librtmp \
--enable-avresample \
--enable-cross-compile \
--enable-pic \
--sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs /iPhoneOS6.1.sdk" \
--target-os=darwin \
--cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2" \
--extra-cflags="-arch armv7s -mfpu=neon -miphoneos-version-min=6.1" \
--extra-ldflags="-arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -miphoneos-version-min=6.1" \
--arch=arm \
--cpu=cortex-a9 \
--prefix=compiled/armv7s

错误提示 ERROR: librtmp cannot be found。具体来说:

    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2 -arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -miphoneos-version-min=6.1 --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -Wl,-dynamic,-search_paths_first -I/usr/local/include -L/usr/local/lib -o /var/folders/4m/8hcrycqx777_ksz6d32nrn_m0000gp/T//ffconf.b2zp97z8 /var/folders/4m/8hcrycqx777_ksz6d32nrn_m0000gp/T//ffconf.VhdlpSe1.o -lrtmp -lz -lssl -lcrypto -lm -lbz2 -lz
ld: warning: ld: warning: ignoring file /usr/local/lib/librtmp.dylib, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (armv7s): /usr/local/lib/librtmp.dylibignoring file /usr/local/lib/libz.a, file was built for archive which is not the architecture being linked (armv7s): /usr/local/lib/libz.a

Undefined symbols for architecture armv7s:
"_RTMP_Socket", referenced from:
_check_RTMP_Socket in ffconf.VhdlpSe1.o
(maybe you meant: _check_RTMP_Socket)
ld: symbol(s) not found for architecture armv7s
collect2: ld returned 1 exit status
ERROR: librtmp not found

我已经使用在 github 上找到的 ios-openssl 和通过 rtmpdumplibrtmp 为 ios 编译了 openssl/p>

最佳答案

我最终使用 ios-librtmpios-openssl 编译了 librtmpopenssl,安装了 rtmpdumpopenssl 使用brewexport PKG_CONFIG_PATH=/usr/local/lib/pkgconfig,然后更改文件/usr/local/lib/pkgconfig 用于 libcrypto.pclibssl.pcopenssl.pclibrtmp.pc 指向 iOS i386、armv7 和 armv7s 编译库。

关于ios - 用 librtmp 编译 ffmpeg,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16138718/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com