使用librtmp编译ffmpeg

时间:2013-04-22 02:52:46

标签: ios ffmpeg openssl rtmp

为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上的opensslios-openssl通过librtmp

为ios编译了rtmpdump

1 个答案:

答案 0 :(得分:2)

我最后使用librtmpopenssl,使用ios-librtmp安装ios-opensslrtmpdump来编译opensslbrewexport PKG_CONFIG_PATH=/usr/local/lib/pkgconfig,然后更改/usr/local/lib/pkgconfig libcrypto.pclibssl.pcopenssl.pclibrtmp.pc中的文件以指向iOS i386,armv7 &安培; armv7s编译库。