Static build ffmpeg with librtmp on Android

Topics regarding RTMPDump.
Post Reply
elBradford
Posts: 8
Joined: Tue Sep 24, 2013 3:23 am

Static build ffmpeg with librtmp on Android

Post by elBradford » Tue Sep 24, 2013 3:38 am

I am coming from this other thread about building librtmp. I am not very experienced when it comes to building in general, and I feel like I am missing something basic.

I am attempting to build ffmpeg with librtmp enabled for Android. I have been following the build script provided here that builds ffmpeg for a few different android architectures (arm7, arm6, neon..).

I have successfully built librtmp following S74ck3r 's instructions on his github repo and stream-recorder thread (where I also posted earlier this year).

My problem is the step between building librtmp and ffmpeg - the ffmpeg build complains
ERROR: librtmp not found
even though I *believe* I have installed librtmp to the sysroot of the standalone toolchain I generated using the NDK.

So my questions are this:
  • What am I missing to get the ffmpeg make to detect where librtmp is? I have sys config installed but am pretty ignorant of how it functions
  • Do I need any special commands to compile PolarSSL and librtmp for the other architectures (arm7, arm6, neon, etc)?
I am pretty desperate, and am willing to offer a bounty for someone who can show me the way. I'll also try to scratch around on the irc channel tomorrow when I have some time to work on this.

Thanks!

Bradford

S74ck3r
Posts: 21
Joined: Fri Feb 01, 2013 8:31 am

Re: Static build ffmpeg with librtmp on Android

Post by S74ck3r » Wed Sep 25, 2013 8:12 am

Hi,

it could be that your setup can't find the linkable librtmp.a file.

There is a zip of all the artifacts created when building librtmp on my bitbucket here (https://bitbucket.org/S74ck3r/rtmpdump- ... s/local.7z).

I'll try and have a look (not sure how much time I'll be able to put into it) and see if we can't work out what the issue is.

Richard

elBradford
Posts: 8
Joined: Tue Sep 24, 2013 3:23 am

Re: Static build ffmpeg with librtmp on Android

Post by elBradford » Thu Sep 26, 2013 12:39 am

Hi Richard, thanks for the reply!

After building rtmpdump, I have a librtmp folder with librtmp.a and librtmp.so

My FFMPEG flags include:

Code: Select all

  --enable-librtmp \
  --extra-cflags=-I/home/bradford/Development/FFMPEG/rtmp/rtmpdump/librtmp/ \
  --extra-ldflags=-L/home/bradford/Development/FFMPEG/rtmp/rtmpdump/librtmp"
It appears to be building, however at the end I get the following errors:

Code: Select all

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
It sounds like I'm missing something in my librtmp build, or it's not finding a source file. However, without those last to lines in my flags, it fails much earlier than when I have them there.

To note, I had to comment out this line in ffmpegs configure file:

Code: Select all

enabled librtmp    && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
Any thoughts?

Bradford

elBradford
Posts: 8
Joined: Tue Sep 24, 2013 3:23 am

Re: Static build ffmpeg with librtmp on Android

Post by elBradford » Thu Sep 26, 2013 1:05 am

I realized that those errors are saying it's probably not finding my header file - rtmp.h - so I did a little more digging.

My local folder (/usr/local) looks exactly like yours, Richard. In fact, pkg-config says it is aware of librtmp:

Code: Select all

# pkg-config --list-all | grep rtmp
librtmp                        librtmp - RTMP implementation
However, just enabling librtmp and trying to build doesn't work - I have to disable the pkg-config line in ffmpeg's configure file (see last post).

My flags now look like this:

Code: Select all

  --enable-librtmp
  --extra-cflags=-I/usr/local/include \
  --extra-ldflags=-L/usr/local/lib"
And I get the same errors.

elBradford
Posts: 8
Joined: Tue Sep 24, 2013 3:23 am

Re: Static build ffmpeg with librtmp on Android

Post by elBradford » Sun Sep 29, 2013 7:10 am

I'm still trying to figure this out. I found this thread with similar error messages. The suggestion was that
This seems like librtmp was found at configure time and
possibly compile time), but not at link time. Your installation of
librtmp may be borked, e.g. by two conflicting versions.
I wonder if I messed up my librtmp install - I actually tried copying Richard's local folder to mine to see if that helped, and the error message is the same.

elBradford
Posts: 8
Joined: Tue Sep 24, 2013 3:23 am

Re: Static build ffmpeg with librtmp on Android

Post by elBradford » Tue Oct 01, 2013 11:00 pm

I'm getting pretty desperate. I'll pay whoever can help me solve this. Thanks

S74ck3r
Posts: 21
Joined: Fri Feb 01, 2013 8:31 am

Re: Static build ffmpeg with librtmp on Android

Post by S74ck3r » Wed Oct 02, 2013 9:35 pm

Hold on to your money (or donate it to someone like hyc to show some appreciation for rtmpdump).

I've got what looks to be a working build, just making sure I can reproduce the steps I took and will post results shortly.

Richard

elBradford
Posts: 8
Joined: Tue Sep 24, 2013 3:23 am

Re: Static build ffmpeg with librtmp on Android

Post by elBradford » Fri Oct 04, 2013 3:49 pm

S74ck3r wrote:Hold on to your money (or donate it to someone like hyc to show some appreciation for rtmpdump).

I've got what looks to be a working build, just making sure I can reproduce the steps I took and will post results shortly.

Richard
That sounds great Richard! You are so helpful. Let me know if I can do anything to help.

elBradford
Posts: 8
Joined: Tue Sep 24, 2013 3:23 am

Re: Static build ffmpeg with librtmp on Android

Post by elBradford » Fri Oct 11, 2013 5:09 pm

S74ck3r wrote:Hold on to your money (or donate it to someone like hyc to show some appreciation for rtmpdump).

I've got what looks to be a working build, just making sure I can reproduce the steps I took and will post results shortly.

Richard
What were the steps that got you to that point? Anything would be helpful at this point, thanks!

elBradford
Posts: 8
Joined: Tue Sep 24, 2013 3:23 am

Re: Static build ffmpeg with librtmp on Android

Post by elBradford » Wed Oct 30, 2013 12:22 am

Still chipping away at this, and still stuck at making ffmpeg, with the same undefined reference to RTMP function errors.

I switched to ndk 8b, as suggested by the project that I'm building ffmpeg for, with no real change.

Bounty is still on the table, I'll pay anyone who can guide me to a solution here!

Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests