"未定义参考和QUOT;编译FFMPEG在Android librtmp时 [英] "Undefined Reference" when compiling FFMPEG with librtmp on Android

查看:517
本文介绍了"未定义参考和QUOT;编译FFMPEG在Android librtmp时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经搜查,而大厦FFMPEG与librtmp为Android 回答我的问题的一部分,我遇到了其他问题进一步沿着编译过程。

I have searched, and while Building FFMPEG with librtmp for android answered part of my question, I ran into other issues further along in the compilation process.

首先,我想使用这个脚本在这github上回购,改变标志包括:

First, I am trying to use the script in this github repo, changing the flags to include

  --enable-librtmp \
  --extra-cflags=-I/home/bradford/Development/FFMPEG/rtmp/rtmpdump/librtmp/ \
  --extra-ldflags=-L/home/bradford/Development/FFMPEG/rtmp/rtmpdump/librtmp"

我建立librtmp与polarSSL以下S74ck3r的他github上回购指示流记录线程。这似乎正常工作,我有一个librtmp.so,librtmp.a和rtmp.h

I build librtmp with polarSSL following S74ck3r's instructions on his github repo and stream-recorder thread. That appears to work correctly, and I have a librtmp.so, librtmp.a and rtmp.h

当我尝试编译的ffmpeg与librtmp,我得到的错误

When I try to compile ffmpeg with librtmp, I get the error

ERROR: librtmp not found

这太问题帮助和我修改的ffmpeg的配置文件,使它不会看pkg配置为librtmp(即使pkg配置意识到librtmp的...):

This SO question helped, and I modified ffmpeg's config file so that it wouldn't look at pkg-config for librtmp (even though pkg-config was aware of librtmp...):

#enabled librtmp    && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket

当我现在建立,启动成功,我也得到了充满希望的行:

When I build now, it starts successfully, and I get the hopeful line:

librtmp enabled           yes

和后来我看到更多的好消息:

And later on I see more good news:

...
Enabled protocols:
applehttp       http            mmsh
cache           httpproxy       mmst
concat          librtmp         mmsu
crypto          librtmpe        pipe
fd          librtmps        rtp
file            librtmpt        tcp
gopher          librtmpte       udp
hls         md5
...

但最后,编译一切,在安装阶段后,我得到这些类型的错误:

but finally, after compiling everything and during the installation phase, I get these types of errors:

INSTALL   libavutil/libavutil.pc
/tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_get_file_handle:libavformat/librtmp.c:190: error: undefined reference to 'RTMP_Socket'
/tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_read_seek:libavformat/librtmp.c:180: error: undefined reference to 'RTMP_SendSeek'
/tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_read_pause:libavformat/librtmp.c:161: error: undefined reference to 'RTMP_Pause'
/tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_close:libavformat/librtmp.c:64: error: undefined reference to 'RTMP_Close'
/tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_write:libavformat/librtmp.c:145: error: undefined reference to 'RTMP_Write'
/tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_read:libavformat/librtmp.c:153: error: undefined reference to 'RTMP_Read'
/tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_open:libavformat/librtmp.c:96: error: undefined reference to 'RTMP_LogSetLevel'
/tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_open:libavformat/librtmp.c:97: error: undefined reference to 'RTMP_LogSetCallback'
/tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_open:libavformat/librtmp.c:118: error: undefined reference to 'RTMP_Init'
/tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_open:libavformat/librtmp.c:119: error: undefined reference to 'RTMP_SetupURL'
/tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_open:libavformat/librtmp.c:127: error: undefined reference to 'RTMP_Connect'
/tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_open:libavformat/librtmp.c:127: error: undefined reference to 'RTMP_ConnectStream'
/tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_open:libavformat/librtmp.c:125: error: undefined reference to 'RTMP_EnableWrite'
collect2: ld returned 1 exit status

和我不能让他们过去。这听起来像它不能找到rtmp.h,其中包括对这些函数的引用,但这是present它应该是(据我所知)。

And I can't get past them. It sounds like it can't find rtmp.h, which includes references to those functions, but that is present where it should be (afaik).

另外,我的项目需要librtmp - 内置的ffmpeg的RTMP功能是不够的,因为我需要librtmp的身份验证功能

Also, my project requires librtmp - the built-in rtmp features of ffmpeg are not sufficient because I require the authentication features of librtmp.

推荐答案

我已经记录我的成功与librtmp建设的FFmpeg 2.1.3 Android的过程。

I've documented my process of successfully building FFmpeg 2.1.3 with librtmp for Android.

简单地说,一旦你建立开放式/ PolarSSL和librtmp,下载最新发布的FFmpeg 并进行以下更改FFmpeg的配置

Briefly, once you build Open/PolarSSL and librtmp, download the latest FFmpeg release and make the following changes to FFmpeg's configure:

# ffmpegX.X.X/configure
...
# Replace the following lines:

#SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
#LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
#SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'
#SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'

# With: 

SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
SLIB_INSTALL_LINKS='$(SLIBNAME)'

...

# Replace this:
#enabled librtmp    && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
# With:
enabled librtmp    && require librtmp librtmp/rtmp.h RTMP_Socket -L/path/to/rtmpdump/librtmp/android/arm/lib -lrtmp

然后用下面的构建脚本编译FFmpeg的:

Then use the following build script to compile FFmpeg:

# ffmpegX.X.X/build_ffmpeg_with_librtmp_for_android.sh
#!/bin/bash
NDK=/path/to/android-ndk-r9c
SYSROOT=$NDK/platforms/android-19/arch-arm/
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64

OPENSSL_DIR=/path/to/openssl-android/
LIBRTMP_DIR=/path/to/rtmpdump/librtmp/
# Note: Change above variables to match your system
function build_one
{
./configure \
    --prefix=$PREFIX \
    --enable-librtmp \
    --enable-shared \
    --disable-static \
    --disable-doc \
    --disable-programs \
    --disable-doc \
    --disable-symver \
    --cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
    --target-os=linux \
    --arch=arm \
    --enable-cross-compile \
    --sysroot=$SYSROOT \
    --extra-cflags="-Os -fpic $ADDI_CFLAGS" \
    --extra-ldflags="$ADDI_LDFLAGS" \
    $ADDITIONAL_CONFIGURE_FLAG
make clean
make -j8
make install
}
CPU=arm
PREFIX=$(pwd)/android/$CPU 
ADDI_CFLAGS="-marm -I${OPENSSL_DIR}include -I${LIBRTMP_DIR}android/arm/include -L${LIBRTMP_DIR}android/arm/lib -lrtmp"
ADDI_LFLAGS="-L${OPENSSL_DIR}libs/armeabi -L${LIBRTMP_DIR}android/arm/lib -lrtmp" 
build_one

不可思议感谢我的朋友克里斯帮助我通过此。

这篇关于"未定义参考和QUOT;编译FFMPEG在Android librtmp时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆